diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/active_list_refresh.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/active_list_refresh.php index 10bbbd28..85e5f338 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/active_list_refresh.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/active_list_refresh.php @@ -166,7 +166,7 @@ if ($ADD==1) {echo "Extensões Ativas";} if ($ADD==2) {echo "Extensões Ocupadas";} if ($ADD==3) {echo "Linhas externas";} if ($ADD==4) {echo "Extensões Locais";} -if ($ADD==5) {echo "Conferencias";} +if ($ADD==5) {echo "Conferências";} if ($ADD==99999) {echo "AJUDA";} echo "\n"; echo "\n"; diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/astguiclient.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/astguiclient.php index f977e637..28d25068 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/astguiclient.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/astguiclient.php @@ -162,9 +162,9 @@ echo "\n"; echo "Senha do Usuário: "; echo "\n"; - echo "Login do Telefone: "; + echo "Login do Ramal: "; echo "\n"; - echo "Senha do Telefone: "; + echo "Senha do Ramal: "; echo "\n"; echo "\n"; echo "
VERSÃO: $version       CONFIGURAÇÃO: $build\n"; @@ -210,7 +210,7 @@ echo "\n"; if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) { -echo "astGUIclient web client: Login do Telefone\n"; +echo "astGUIclient web client: Login do Ramal\n"; echo "\n"; echo "\n"; echo "\n"; @@ -222,12 +222,12 @@ echo "\n"; echo "\n"; echo "


"; echo ""; -echo ""; +echo ""; echo "\n"; echo "\n"; -echo ""; +echo ""; echo "\n"; -echo ""; +echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -247,7 +247,7 @@ $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) { - echo "astGUIclient web client: Login do Telefone\n"; + echo "astGUIclient web client: Login do Ramal\n"; echo "\n"; echo "\n"; echo "
Login do Telefone Login do Ramal
 
Login do Telefone:
Login do Ramal:
Senha do Telefone:
Senha do Ramal:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; @@ -259,12 +259,12 @@ echo ""; echo "\n"; echo "\n"; - echo ""; + echo ""; echo "\n"; - echo ""; + echo ""; echo "\n"; echo ""; echo "\n"; @@ -790,10 +792,10 @@ echo ""; echo ""; echo "\n"; - echo "\n"; - echo ""; + echo "\n"; + echo ""; echo "\n"; - echo ""; + echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -2065,7 +2067,7 @@ else echo "Agent web client: Login da Campanha\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + echo " Relogio ponto
\n"; echo "
\n"; echo "


"; echo ""; - echo ""; + echo ""; echo "\n"; - echo "\n"; - echo ""; + echo "\n"; + echo ""; echo "\n"; - echo ""; + echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -887,7 +887,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} else { bsr_continue=0; - alert("Você so pode monitorar os canais ZAP:\n" + listenvalue); + alert("Você só pode monitorar os canais ZAP:\n" + listenvalue); } } if (bsr_continue == '1') @@ -1197,7 +1197,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} { recLIST = recLIST + "|" + monitorchannelvalue; filename = filedate + "_" + user_abb; - var rec_start_html = "Pare a Gravação"; + var rec_start_html = "Parar Gravação"; document.getElementById(taskspan).innerHTML = rec_start_html; } @@ -1259,7 +1259,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} recLIST = recLIST + "|" + taskconfrec; filename = filedate + "_" + user_abb; var channelrec = "Local/" + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "Pare a Gravação"; + var conf_rec_start_html = "Parar Gravação"; document.getElementById(taskconfspan).innerHTML = conf_rec_start_html; } @@ -1386,7 +1386,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=3; if (live_calls > 0) { - var live_calls_HTML = "CHAMADAS ATIVAS NESTE TELEFONE:
Login do Telefone Login do Ramal
 
Desculpe seu login de telefone e senha não estão ativos nesta campanha, por favor tente novamente:
 
Login do Telefone:
 
Desculpe seu login de ramal e senha não estão ativos nesta campanha, por favor tente novamente:
 
Login do Ramal:
Senha do Telefone:
Senha do Ramal:

VERSÃO: $version       CONFIGURAÇÃO: $build
"; + var live_calls_HTML = "CHAMADAS ATIVAS NESTE RAMAL:
#CANAL DO CLIENTECANAL REMOTORECORDDESLIGARTRANFERENCIAESPERA
"; if ( (LCAcount > live_calls) || (LCAcount < live_calls) ) { LCAe[0]=''; LCAe[1]=''; LCAe[2]=''; LCAe[3]=''; LCAe[4]=''; LCAe[5]=''; @@ -1412,11 +1412,11 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var regx = new RegExp("\\|"+channelfieldBtrunk_array[1],"ig"); if (recLIST.match(regx)) - {live_calls_HTML = live_calls_HTML + "Pare a Gravação";} + {live_calls_HTML = live_calls_HTML + "Parar Gravação";} else {live_calls_HTML = live_calls_HTML + "Gravar";} - live_calls_HTML = live_calls_HTML + ""; + live_calls_HTML = live_calls_HTML + ""; if (LCAe[ARY_ct].length < 1) {LCAe[ARY_ct] = channelfieldA_array[1]; LCAcontent_change++; LCAalter++;} @@ -1533,7 +1533,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=0; if (out_calls > 0) { - var out_log_HTML = "
#CANAL DO CLIENTECANAL REMOTORECORDDESLIGARTRANFERÊNCIAESPERA
DESLIGARTRANFERENCIAESPERA
DESLIGARTRANFERÊNCIAESPERA
" + var out_log_HTML = "
# DATA/HORA DA CHAMADANUMEROLENGTH (M:SS)
" while (loop_ct < out_calls) { loop_ct++; @@ -1561,7 +1561,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=0; if (in_calls > 0) { - var in_log_HTML = "
# DATA/HORA DA CHAMADANÚMEROLENGTH (M:SS)
" + var in_log_HTML = "
# DATA/HORA DA CHAMADANUMERO ENTRANTECALLERIDLENGTH
" while (loop_ct < in_calls) { loop_ct++; @@ -1636,7 +1636,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=-1; if (parked_count > 0) { - var park_HTML = "
# DATA/HORA DA CHAMADANÚMERO ENTRANTECALLERIDLENGTH
" + var park_HTML = "
#CHANNEL
  CHAMADA ID
EM ESPERA POR
  TEMPO EM ESPERA
DESLIGARTRANFERENCIACAPTURAR
" while (loop_ct < parked_count) { loop_ct++; @@ -1652,7 +1652,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var park_call_id = park_array[1]; var parked_by = park_array[3]; var parked_time = park_array[4]; - park_HTML = park_HTML + ""; + park_HTML = park_HTML + ""; } park_HTML = park_HTML + "
#CHANNEL
  CHAMADA ID
EM ESPERA POR
  TEMPO EM ESPERA
DESLIGARTRANFERÊNCIACAPTURAR
" + loop_ct + "" + park_channel + "
  " + park_call_id + "
" + parked_by + "
  " + parked_time + "
DESLIGARTRANFERENCIACAPTURAR
" + loop_ct + "" + park_channel + "
  " + park_call_id + "
" + parked_by + "
  " + parked_time + "
DESLIGARTRANFERÊNCIACAPTURAR
"; @@ -1764,7 +1764,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} show_reglink=1; reglink = "Register"; } - var conf_head_HTML = "CONFERENCIA " + head_conf + "    Registrado para: " + head_reg + "   " + reglink + "         Entrar na conferência
Atualizar     Gravar         Enviar DTMF         Dial From Conf
"; + var conf_head_HTML = "CONFERÊNCIA " + head_conf + "    Registrado para: " + head_reg + "   " + reglink + "         Entrar na conferência
Atualizar     Gravar         Enviar DTMF         Discar da confêrencia
"; document.getElementById("ConfereNceHeaderContent").innerHTML = conf_head_HTML; check_for_conf_calls(head_conf,taskrefresh); @@ -1825,7 +1825,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var LMAcontent_change=0; var LMAcontent_match=0; var conv_start=-1; - var live_conf_HTML = "CHAMADAS ATIVAS NESTA CONFERÊNCIA:
"; + var live_conf_HTML = "CHAMADAS ATIVAS NESTA CONFERÊNCIA:
#CANAL REMOTODESLIGARTRANFERENCIA
"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; @@ -1841,7 +1841,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} @@ -2290,7 +2290,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var VD_favlist_ct_half = parseInt(favlistCT / 2); if (VD_favlist_ct_half < 30) {VD_favlist_ct_half = 30;} var favlist_sec_col = 0; - var favedit_HTML = "
#CANAL REMOTODESLIGARTRANFERÊNCIA
" + loop_ct + "" + channelfieldA + "DESLIGARTRANFERENCIA
" + loop_ct + "" + channelfieldA + "DESLIGARTRANFERÊNCIA
EXTENSOES DISPONIVEISFAVORITOS
"; + var favedit_HTML = "
@@ -2759,7 +2759,7 @@ echo "\n";
EXTENSÕES DISPONÍVEISFAVORITOS
"; loop_ct = 0; while (loop_ct < favlistCT) { @@ -2718,7 +2718,7 @@ echo "\n";
-SAIR
\n"; ?> +SAIR
\n"; ?>
Painel Principal
- + -
TRANSFERIR CHAMADAS ATIVAS
Canal a ser transferido: Channel
Extensões:
Extensões do Menu
Extensões:
Menu de Extensões

Enviar para a extensão selecionada

@@ -2768,12 +2768,12 @@ echo "\n"; Atualizar


Voltar a página principal

Conferencias:
(Clique no número abaixo para enviar a conferência)
Enviar meu canal para
Menu das conferências
+
Conferências:
(clique no número abaixo para enviar a conferência)
Enviar meu canal para
Menu das conferências
- + "; echo "\n"; echo "\n"; -echo ""; +echo ""; echo "\n"; -echo ""; +echo ""; echo "\n"; echo ""; echo "\n"; @@ -706,7 +708,7 @@ if ($user_login_first == 1) echo "Agent web client: Login da Campanha\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + echo " Relogio ponto
\n"; echo "
Discar a extensão local
Telefone ligando de: Channel
Extensões:
Extensões do Menu
Extensões:
Menu de Extensões

Ligar para a extensão selecionada

@@ -2828,7 +2828,7 @@ echo "\n"; - +
FAVORITOS

 
PARA ENVIAR MODIFICACOES FAVORITAS E NECESSARIO FAZER O LOGOUT
ENVIAR ALTERAÇÕES FAVORITAS - requer logout
VOLTAR A TELA PRINCIPAL - as alterações serão ignoradas
@@ -2839,7 +2839,7 @@ echo "\n";
-STOP | START     Atualizar a taxa: 1000 ms Mais rápido | Mais devagar

+STOP | START     Taxa de Atualização: 1000 ms Mais rápido | Mais devagar

Inicializando..
Extensões Ativas
@@ -2858,11 +2858,11 @@ echo "\n";
- Data vai aqui

+ Os Dados vão aqui

- Data vai aqui

Atividade do Tronco + Os Dados vão aqui

Atividade do Tronco
- Data vai aqui

Atividade Local + Os Dados vão aqui

Atividade Local
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/conf_exten_check.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/conf_exten_check.php index 71b6fd1c..c440879d 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/conf_exten_check.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/conf_exten_check.php @@ -309,8 +309,8 @@ echo " if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03007',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $RingCalls=$row[0]; - if ($RingCalls > 0) {$RingCalls = "Solicita, em fila: $RingCalls";} - else {$RingCalls = "Solicita, em fila: $RingCalls";} + if ($RingCalls > 0) {$RingCalls = "Chamadas na fila: $RingCalls";} + else {$RingCalls = "Chamadas na fila: $RingCalls";} ### grab the number of calls being placed from this server and campaign $stmt="SELECT count(*) from vicidial_auto_calls where status NOT IN('XFER') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; @@ -644,7 +644,7 @@ echo " $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03013',$user,$server_ip,$session_name,$one_mysql_log);} } - echo "Conferencia $conf_exten já foi registrado para $exten\n"; + echo "Conferência $conf_exten já foi registrado para $exten\n"; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/inbound_popup.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/inbound_popup.php index 1032dd45..a2511ff1 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/inbound_popup.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/inbound_popup.php @@ -251,11 +251,11 @@ echo "";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02082',$user,$server_ip,$session_name,$one_mysql_log);} - echo "Volume comando enviado para Conferencia $exten, Stage $stage Canal $channelligado$server_ip\n"; + echo "Volume comando enviado para Conferência $exten, Stage $stage Canal $channelligado$server_ip\n"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/park_calls_display.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/park_calls_display.php index e5bcc93a..5e07fb7e 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/park_calls_display.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/park_calls_display.php @@ -99,7 +99,7 @@ if ($format=='debug') echo "\n"; echo "\n"; echo "\n"; -echo "Mostra as ligações em espera"; +echo "<title>Mostrar ligações em espera"; echo "\n"; echo "\n"; echo "\n"; diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/timeclock.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/timeclock.php index c62ae950..c6896e5f 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/timeclock.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/timeclock.php @@ -120,10 +120,10 @@ if ( ($stage == 'login') or ($stage == 'logout') ) if ($valid_user < 1) { ### NOT A VALID USER/PASS - $VDdisplayMESSAGE = "O usuário ea senha que você digitou não são ativos no sistema
Por favor, tente novamente:"; + $VDdisplayMESSAGE = "O usuário e a senha que você digitou não estão ativos no sistema
Por favor, tente novamente:"; echo"\n"; - echo"AgentTimeclock\n"; + echo"Agent Relogio ponto\n"; echo"\n"; echo"\n"; echo "\n"; @@ -138,7 +138,7 @@ if ( ($stage == 'login') or ($stage == 'logout') ) echo "

$VDdisplayMESSAGE

"; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo ""; @@ -225,10 +225,10 @@ if ( ($stage == 'login') or ($stage == 'logout') ) if ( ($last_action_sec < 30) and ($status != 'START') ) { ### You cannot log in or out within 30 segundos of your last login/logout - $VDdisplayMESSAGE = "Você não pode efetuar login ou para fora dentro de 30 segundos do seu último login ou logout"; + $VDdisplayMESSAGE = "Você não pode entrar ou sair dentro de 30 segundos do seu último login ou logout"; echo"\n"; - echo"AgentTimeclock\n"; + echo"Agent Relogio ponto\n"; echo"\n"; echo"\n"; echo "\n"; @@ -243,7 +243,7 @@ if ( ($stage == 'login') or ($stage == 'logout') ) echo "

$VDdisplayMESSAGE

"; echo "
Timeclock Relogio ponto
 
Login do Usuário:
"; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo ""; @@ -292,8 +292,8 @@ if ( ($stage == 'login') or ($stage == 'logout') ) if ( ($status=='LOGIN') and ($stage=='logout') ) { - $VDdisplayMESSAGE = "Você tem agora autenticado-out"; - $LOGtimeMESSAGE = "Você saiu em$NOW_TIME
Quantidade de tempo que foram registradas em:$totTIME_HMS"; + $VDdisplayMESSAGE = "Você efetuou logout"; + $LOGtimeMESSAGE = "Você saiu em$NOW_TIME
Quantidade de tempo que ficou logado:$totTIME_HMS"; ### Add a record to the timeclock log $stmt="INSERT INTO vicidial_timeclock_log set event='LOGOUT', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; @@ -333,24 +333,24 @@ if ( ($stage == 'login') or ($stage == 'logout') ) } if ( ( ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) ) - {echo "ERRO: timeclock entrada do log já realizados:$status|$stage"; exit;} + {echo "ERRO: relogio ponto já registrado:$status|$stage"; exit;} if ($referrer=='agent') - {$BACKlink = "BACK TO Agent Login Screen";} + {$BACKlink = "VOLTAR para tela de login do Agente";} if ($referrer=='admin') - {$BACKlink = "Retornar para Administração";} + {$BACKlink = "VOLTAR para Administração";} if ($referrer=='welcome') - {$BACKlink = "ANTERIOR a tela Bem-vindo";} + {$BACKlink = "VOLTAR para Tela Inicial";} echo"\n"; - echo"AgentTimeclock\n"; + echo"Agent Relogio ponto\n"; echo"\n"; echo"\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; echo "
Timeclock Relogio ponto
 
Login do Usuário:
"; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -368,21 +368,21 @@ if ( ($stage == 'login') or ($stage == 'logout') ) if ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') ) { - $VDdisplayMESSAGE = "Vez desde que foi registrado em:$totTIME_HMS"; + $VDdisplayMESSAGE = "Tempo desde o último login:$totTIME_HMS"; $log_action = 'login'; $button_name = 'LOGIN'; - $LOGtimeMESSAGE = "Você última autenticado-out em:$last_action_date

LOGIN Clique abaixo para log-in"; + $LOGtimeMESSAGE = "Você saiu pela última vez em:$last_action_date

Clique LOGIN abaixo para entrar"; } if ($status=='LOGIN') { - $VDdisplayMESSAGE = "Quantidade de tempo que tem sido registrado em:$totTIME_HMS"; + $VDdisplayMESSAGE = "Tempo total desde que entrou no sistema:$totTIME_HMS"; $log_action = 'logout'; $button_name = 'LOGOUT'; - $LOGtimeMESSAGE = "Você autenticado-nos em: $last_action_date
Quantidade de tempo que tem sido registrado em:$totTIME_HMS

SAIR Clique abaixo para log-out"; + $LOGtimeMESSAGE = "Você entrou em: $last_action_date
Tempo total desde que entrou no sistema:$totTIME_HMS

Clique LOGOUT abaixo para sair"; } echo"\n"; - echo"AgentTimeclock\n"; + echo"Agent Relogio ponto\n"; echo"\n"; echo"\n"; echo "\n"; @@ -400,7 +400,7 @@ if ( ($stage == 'login') or ($stage == 'logout') ) echo "

$VDdisplayMESSAGE

"; echo "
Timeclock Relogio ponto
 
$LOGtimeMESSAGE
 
"; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo "\n"; @@ -421,7 +421,7 @@ if ( ($stage == 'login') or ($stage == 'logout') ) else { echo"\n"; - echo"AgentTimeclock\n"; + echo"Agent Relogio ponto\n"; echo"\n"; echo"\n"; echo "\n"; @@ -436,7 +436,7 @@ else echo "

$VDdisplayMESSAGE

"; echo "
Timeclock Relogio ponto
 
$LOGtimeMESSAGE
 
"; echo ""; - echo ""; + echo ""; echo "\n"; echo "\n"; echo ""; diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/vdc_db_query.php index 08f968a2..b45d821e 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Usuário busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Inválido number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to STATUS INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Entrante calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Inválido call reference value.", +88 => "Incompatible destination.", +95 => "Inválido message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Inválido information element contents.", +101 => "Message not compatible with call state.", +102 => "Recoveryligadotimer expiry.", +103 => "Parameter non-existent or not implemented - passedligado(national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -614,7 +670,7 @@ if ($ACTION == 'LogiNCamPaigns') $shift_ok=0; if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) { - $VDdisplayMESSAGE = "ERRO: Não existem Shifts activado para o Grupo de Usuários\n"; + $VDdisplayMESSAGE = "ERRO: Não existem turnos ativos para seu Grupo de Usuários\n"; $VDloginDISPLAY=1; } else @@ -667,14 +723,14 @@ if ($ACTION == 'LogiNCamPaigns') if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) { - $VDdisplayMESSAGE = "ERRO: Você não tem permissão para iniciar sessão no para fora do seu turno\n"; + $VDdisplayMESSAGE = "ERRO: Você não tem permissão para iniciar sessão fora do seu turno\n"; $VDloginDISPLAY=1; } } if ($VDloginDISPLAY > 0) { $loginDATE = date("Ymd"); - $VDdisplayMESSAGE.= "

GERENTE Override:
\n"; + $VDdisplayMESSAGE.= "

SOBREPOR GERENTE:
\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; @@ -710,7 +766,7 @@ if ($ACTION == 'LogiNCamPaigns') else { echo "\n"; } exit; @@ -1061,7 +1117,7 @@ if ($ACTION == 'manDiaLnextCaLL') if ($row[0] > 0) { - echo "DNC NUMERO\n"; + echo "DNC NÚMERO\n"; exit; } $stmt="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign';"; @@ -1072,7 +1128,7 @@ if ($ACTION == 'manDiaLnextCaLL') if ($row[0] > 0) { - echo "DNC NUMERO\n"; + echo "DNC NÚMERO\n"; exit; } } @@ -1101,7 +1157,7 @@ if ($ACTION == 'manDiaLnextCaLL') if ($row[0] < 1) { - echo "NUMERO NOT IN CAMPLISTS\n"; + echo "NÚMERO NOT IN CAMPLISTS\n"; exit; } } @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2080,7 +2157,7 @@ if ($ACTION == 'alt_phone_change') if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) || (strlen($phone_number)<1) ) { $channel_live=0; - echo "TELEFONE ALTERNATIVO NUMERO STATUS NOT CHANGED\n"; + echo "FONE ALT NÚMERO STATUS NOT CHANGED\n"; echo "$phone_number $stage $lead_id or $called_count não é válido\n"; exit; } @@ -2091,7 +2168,7 @@ if ($ACTION == 'alt_phone_change') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00041',$user,$server_ip,$session_name,$one_mysql_log);} - echo "TELEFONE ALTERNATIVO NUMERO STATUS CHANGED\n"; + echo "FONE ALT NÚMERO STATUS CHANGED\n"; } } @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -5375,7 +5520,7 @@ if ($ACTION == 'updateDISPO') ### check and see if the custom date fields exist, if they do then update them if necessary - # Date of Ultimo Attempt, Date of Ultimo Non-Contact, Date of Ultimo Contact, Date of Ultimo Sale + # Date of Sobrenome Attempt, Date of Sobrenome Non-Contact, Date of Sobrenome Contact, Date of Sobrenome Sale # first find the sale statuses that are in the system $SALE_string_check = '|'; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/vicidial.php index 19a6231a..bd189ced 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_br/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -513,7 +515,7 @@ if ($campaign_login_list > 0) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$MGR_login', ip_address='$ip', event_section='AGENT', event_type='OVERRIDE', record_id='$VD_login', event_code='GERENTE Override OF AGENT SHIFT ENFORCEMENT', event_sql=\"$SQL_log\", event_notes='user: $VD_login';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$MGR_login', ip_address='$ip', event_section='AGENT', event_type='OVERRIDE', record_id='$VD_login', event_code='SOBREPOR GERENTE OF AGENT SHIFT ENFORCEMENT', event_sql=\"$SQL_log\", event_notes='user: $VD_login';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01060',$VD_login,$server_ip,$session_name,$one_mysql_log);} @@ -666,7 +668,7 @@ if ($relogin == 'YES') echo "Agent web client: Re-Login\n"; echo "\n"; echo "\n"; -echo "Timeclock
\n"; +echo " Relogio ponto
\n"; echo "
Timeclock Relogio ponto
 
Login do Usuário:
\n"; echo "\n"; echo "\n";echo "\n";echo "
English Brazil
\n"; @@ -679,9 +681,9 @@ echo "
Re-Login
 
Login do Telefone:
Login do Ramal:
Senha do Telefone:
Senha do Ramal:
Login do Usuário:
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -752,7 +754,7 @@ echo "
Agent web client: Login\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + echo " Relogio ponto
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -765,9 +767,9 @@ echo "
Login
 
Login do Telefone:
Login do Ramal:
Senha do Telefone:
Senha do Ramal:
Login do Usuário:
Agent web client: Login do Telefone\n"; +echo "Agent web client: Login do Ramal\n"; echo "\n"; echo "\n"; -echo "Timeclock
\n"; +echo " Relogio ponto
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Brazil
\n"; @@ -803,12 +805,12 @@ echo "\n"; echo "\n"; echo "


"; echo ""; -echo ""; +echo ""; echo "\n"; echo "\n"; -echo ""; +echo ""; echo "\n"; -echo ""; +echo ""; echo "\n"; echo "\n"; @@ -926,7 +928,7 @@ $VDloginDISPLAY=0; if ( (strlen($last_agent_event)<2) or (ereg('LOGOUT',$last_agent_event)) ) { $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "É necessário efetuar login AO PRIMEIRO TIMECLOCK
"; + $VDdisplayMESSAGE = "É necessário efetuar login no Relógio Ponto primeiro
"; } } ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR @@ -938,7 +940,7 @@ $VDloginDISPLAY=0; if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) { $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "ERRO: Não existem Shifts activado para o Grupo de Usuários
"; + $VDdisplayMESSAGE = "ERRO: Não existem turnos ativos para seu Grupo de Usuários
"; } else { @@ -991,12 +993,12 @@ $VDloginDISPLAY=0; if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) { $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "ERRO: Você não tem permissão para iniciar sessão no para fora do seu turno
"; + $VDdisplayMESSAGE = "ERRO: Você não tem permissão para iniciar sessão fora do seu turno
"; } } if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) { - $VDdisplayMESSAGE.= "

GERENTE Override:
\n"; + $VDdisplayMESSAGE.= "

SOBREPOR GERENTE:
\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; @@ -1034,7 +1036,7 @@ $VDloginDISPLAY=0; echo "Agent web client: Login da Campanha\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + echo " Relogio ponto
\n"; echo "
Login do Telefone Login do Ramal
 
Login do Telefone:
Login do Ramal:
Senha do Telefone:
Senha do Ramal:
  \n"; echo "
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -1475,7 +1477,7 @@ echo "
Agent web client: Login da Campanha\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + echo " Relogio ponto
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -1565,10 +1567,10 @@ $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) { - echo "Agent web client: Login do Telefone Error\n"; + echo "Agent web client: Login do Ramal Error\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + echo " Relogio ponto
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -1583,10 +1585,10 @@ echo "
Login Error
 
Desculpe seu login de telefone e senha não estão ativos nesta campanha, por favor tente novamente:
 
Login do Telefone:
 
Desculpe seu login de ramal e senha não estão ativos nesta campanha, por favor tente novamente:
 
Login do Ramal:
Senha do Telefone:
Senha do Ramal:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -2091,7 +2093,7 @@ echo "Agent web client: Login da Campanha\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + echo " Relogio ponto
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -2266,7 +2268,7 @@ $CTODAY = date("Y-m"); $CTODAYmday = date("j"); $CINC=0; -$Cmonths = Array('Janeiro','February','Março','Abril','Pode','Junho', +$Cmonths = Array('Janeiro','February','Março','Abril','Maio','Junho', 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'); $Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"Início\""; var DiaLControl_auto_HTML_ready = "\"\"Início\""; var DiaLControl_auto_HTML_OFF = "\"\"Início\""; @@ -3748,7 +3755,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (LIVE_campaign_recording == 'ALLFORCE') { - document.getElementById("RecorDControl").innerHTML = "\"Inicia"; + document.getElementById("RecorDControl").innerHTML = "\"Iniciar"; } else { @@ -3760,10 +3767,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} filename = taskconffile; var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Inicia"; + var conf_rec_start_html = "\"Iniciar"; if (LIVE_campaign_recording == 'ALLFORCE') { - document.getElementById("RecorDControl").innerHTML = "\"Inicia"; + document.getElementById("RecorDControl").innerHTML = "\"Iniciar"; } else { @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4125,7 +4132,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} reselect_alt_dial = 1; alt_dial_active = 1; alt_dial_status_display = 1; - var man_status = "Discar telefone alternativo: TELEFONE PRINCIPAL or TELEFONE ALTERNATIVO or ENDERECO3 or FINALIZAR CONTATO"; + var man_status = "Discar telefone alternativo: FONE PRINC or FONE ALT or ENDERECO3 or FINALIZAR CONTATO"; document.getElementById("MainStatuSSpan").innerHTML = man_status; } } @@ -4181,10 +4188,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // alert("VICIDIAL Call log entered:\n" + document.vicidial_form.uniqueid.value); if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { - var conf_rec_start_html = "\"Inicia"; + var conf_rec_start_html = "\"Iniciar"; if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { - document.getElementById("RecorDControl").innerHTML = "\"Inicia"; + document.getElementById("RecorDControl").innerHTML = "\"Iniciar"; } else {document.getElementById("RecorDControl").innerHTML = conf_rec_start_html;} @@ -4354,7 +4361,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CB_calls = all_CBs_array[0]; var loop_ct=0; var conv_start=0; - var CB_HTML = ">" + var CB_HTML = "
# CHAMADABACK DATE/TIMENUMERONAME STATUSCAMPAIGNLAST DATA/HORA DA CHAMADA COMMENTS
>" while (loop_ct < CB_calls) { loop_ct++; @@ -4435,8 +4442,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (agent_allow_group_alias == 'Y') { - document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Grupo Alias: " + active_group_alias + ""; - document.getElementById("ManuaLDiaLGrouP").innerHTML = "Clique aqui para escolher um grupo Alias"; + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Apelido de Grupo: " + active_group_alias + ""; + document.getElementById("ManuaLDiaLGrouP").innerHTML = "Clique aqui para escolher um apelido de grupo"; } showDiv('NeWManuaLDiaLBox'); } @@ -4512,7 +4519,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { - alert("VOCÊ DEVE DAR ENTRADA A um NÚMERO De TELEFONE E A um CÓDIGO DoSELETOR PARA USAR O SELETOR RÁPIDO"); + alert("VOCÊ DEVE ENTRAR UM NÚMERO E O CÓDIGO DE ÁREA PARA USAR A DISCAGEM RÁPIDA"); } else { @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4627,7 +4635,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Ligou para o terceiro: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck; - document.getElementById("Leave3WayCall").innerHTML ="\"ABANDONAR"; + document.getElementById("Leave3WayCall").innerHTML ="\"ABANDONAR"; document.getElementById("DialWithCustomer").innerHTML ="\"Discar"; @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -4686,7 +4695,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -5159,7 +5168,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { reselect_preview_dial = 1; var man_preview = 'YES'; - var man_status = "Mostrar o contato, então DISCAR CONTATO or IGNORAR CONTATO"; + var man_status = "Mostrar o contato, então DISCAR REGISTRO or PULAR REGISTRO"; } else { @@ -5231,9 +5240,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDnextCID.match(regMDFvarDNC)) {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR); alert_displayed=1;} if (MDnextCID.match(regMDFvarCAMP)) - {alert("Esse número de telefone não está na campanha listas:\n" + mdnPhonENumbeR); alert_displayed=1;} + {alert("Esse número de telefone não está na lista da campanha:\n" + mdnPhonENumbeR); alert_displayed=1;} if (alert_displayed==0) - {alert("Unspecified error:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + {alert("Erro não especificado:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} if (starting_dial_level == 0) { @@ -5540,7 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CHAMADABACK "; document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; document.getElementById("CBcommentsBoxA").innerHTML = "Última Chamada:" + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "Rechamada:" + CBcallback_time; + document.getElementById("CBcommentsBoxB").innerHTML = "Agendamento:" + CBcallback_time; document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; document.getElementById("CBcommentsBoxD").innerHTML = "Comentários:
" + CBcomments; showDiv('CBcommentsBox'); @@ -5748,7 +5757,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDSnextCID = MDSnextResponse_array[0]; if (MDSnextCID == "LEAD NOT REVERTED") { - alert("O contato não pode ser revertido. Houve um erro.:\n" + MDSnextResponse); + alert("O contato não pode ser lido. Houve um erro.:\n" + MDSnextResponse); } else { @@ -5852,23 +5861,23 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } if (dialed_label == 'ALT') - {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: ALT ";} + {document.getElementById("CusTInfOSpaN").innerHTML = " NÚMERO DE DISC. ALT.: ALT ";} if (dialed_label == 'ADDR3') - {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: ENDERECO3 ";} + {document.getElementById("CusTInfOSpaN").innerHTML = " NÚMERO DE DISC. ALT.: ENDERECO3 ";} var REGalt_dial = new RegExp("X","g"); if (dialed_label.match(REGalt_dial)) { - document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: " + dialed_label + ""; - document.getElementById("EAcommentsBoxA").innerHTML = "Telefone Código e Número: " + EAphone_code + " " + EAphone_number; + document.getElementById("CusTInfOSpaN").innerHTML = " NÚMERO DE DISC. ALT.: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Código de área e número: " + EAphone_code + " " + EAphone_number; var EAactive_link = ''; if (EAalt_phone_active == 'Y') - {EAactive_link = "Altere este número de telefone para INATIVO";} + {EAactive_link = "Alterar número de telefone para INATIVO";} else - {EAactive_link = "Altere este número de telefone para ACTIVAS";} + {EAactive_link = "Alterar número de telefone para ATIVO";} document.getElementById("EAcommentsBoxB").innerHTML = "Ativa:" + EAalt_phone_active + "
" + EAactive_link; - document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxC").innerHTML = "Contagem de Alt:" + EAalt_phone_count; document.getElementById("EAcommentsBoxD").innerHTML = "Notas:
" + EAalt_phone_notes; showDiv('EAcommentsBox'); } @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " CHAMADA NOT PLACED") { alert("A ligação não foi efetuada. Houve um erro.:\n" + MDOnextResponse); @@ -6270,9 +6280,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var EAactive_link = ''; if (APCactive == 'Y') - {EAactive_link = "Altere este número de telefone para INATIVO";} + {EAactive_link = "Alterar número de telefone para INATIVO";} else - {EAactive_link = "Altere este número de telefone para ACTIVAS";} + {EAactive_link = "Alterar número de telefone para ATIVO";} document.getElementById("EAcommentsBoxB").innerHTML = "Ativa:" + EAalt_phone_active + "
" + EAactive_link; @@ -6529,29 +6539,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CHAMADABACK "; document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; document.getElementById("CBcommentsBoxA").innerHTML = "Última Chamada:" + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "Rechamada:" + CBcallback_time; + document.getElementById("CBcommentsBoxB").innerHTML = "Agendamento:" + CBcallback_time; document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; document.getElementById("CBcommentsBoxD").innerHTML = "Comentários:
" + CBcomments; showDiv('CBcommentsBox'); } if (dialed_label == 'ALT') - {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: ALT ";} + {document.getElementById("CusTInfOSpaN").innerHTML = " NÚMERO DE DISC. ALT.: ALT ";} if (dialed_label == 'ADDR3') - {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: ENDERECO3 ";} + {document.getElementById("CusTInfOSpaN").innerHTML = " NÚMERO DE DISC. ALT.: ENDERECO3 ";} var REGalt_dial = new RegExp("X","g"); if (dialed_label.match(REGalt_dial)) { - document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: " + dialed_label + ""; - document.getElementById("EAcommentsBoxA").innerHTML = "Telefone Código e Número: " + EAphone_code + " " + EAphone_number; + document.getElementById("CusTInfOSpaN").innerHTML = " NÚMERO DE DISC. ALT.: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Código de área e número: " + EAphone_code + " " + EAphone_number; var EAactive_link = ''; if (EAalt_phone_active == 'Y') - {EAactive_link = "Altere este número de telefone para INATIVO";} + {EAactive_link = "Alterar número de telefone para INATIVO";} else - {EAactive_link = "Altere este número de telefone para ACTIVAS";} + {EAactive_link = "Alterar número de telefone para ATIVO";} document.getElementById("EAcommentsBoxB").innerHTML = "Ativa:" + EAalt_phone_active + "
" + EAactive_link; - document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxC").innerHTML = "Contagem de Alt:" + EAalt_phone_count; document.getElementById("EAcommentsBoxD").innerHTML = "Notas:" + EAalt_phone_notes; showDiv('EAcommentsBox'); } @@ -6579,7 +6589,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -7470,7 +7480,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Desligar"; document.getElementById("XferControl").innerHTML = "\"Transferir"; document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; document.getElementById("VolumeDownSpan").innerHTML = ""; @@ -7651,7 +7661,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - // document.getElementById("Leave3WayCall").innerHTML ="\"ABANDONAR"; + // document.getElementById("Leave3WayCall").innerHTML ="\"ABANDONAR"; document.getElementById("DialWithCustomer").innerHTML ="\"Discar"; @@ -7824,7 +7834,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) { - alert("VOCÊ DEVE SER PAUSADO PARA DAR ENTRADA A um CÓDIGO Da PAUSA NaMODALIDADE De AUTO-DIAL"); + alert("VOCÊ DEVE ESTAR EM PAUSA PARA ENTRAR UM CÓDIGO DE PAUSA NO MODO AUTOMÁTICO"); } else { @@ -7855,7 +7865,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } // ################################################################################ -// Generate the Grupo Alias Chooser panel +// Generate the Apelido de Grupo Chooser panel function GroupAliasSelectContent_create(task3way) { HidEGenDerPulldown(); @@ -8037,13 +8047,25 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { manual_dial_finished(); } document.getElementById("GENDERhideFORieALT").innerHTML = ''; - document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("GENDERhideFORie").innerHTML = ''; hideDiv('DispoSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); @@ -8158,7 +8180,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ -// Submit the Grupo Alias +// Submit the Apelido de Grupo function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) { hideDiv('GroupAliasSelectBox'); @@ -8168,8 +8190,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (newusegroup > 0) { active_group_alias = newgroupalias; - document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Grupo Alias: " + active_group_alias + ""; - document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Grupo Alias: " + active_group_alias + ""; + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Apelido de Grupo: " + active_group_alias + ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Apelido de Grupo: " + active_group_alias + ""; } cid_choice = newgroupcid; } @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Seu turno acabou ou foi alterado, você foi desconectado da sua sessão

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "CLIQUE AQUI PARA FAZER O LOGIN NOVAMENTE\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Seu Shift é mais ou mudou, você foi desconectado da sua sessão

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "CLIQUE AQUI PARA FAZER O LOGIN NOVAMENTE\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9545,7 +9569,7 @@ function phone_number_format(formatphone) { { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) { - alert("Você deve estar PAUSED PARA ALTERAR GRUPOS"); + alert("VOCÊ DEVE ESTAR EM PAUSA PARA ALTERAR OS GRUPOS"); } else { @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } @@ -9846,7 +9870,7 @@ else if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') ) { - document.getElementById("PauseCodeLinkSpan").innerHTML = "DÊ ENTRADA A um CÓDIGO Da PAUSA"; + document.getElementById("PauseCodeLinkSpan").innerHTML = "DIGITE UM CÓDIGO DE PAUSA"; } if (VICIDiaL_allow_closers < 1) { @@ -9855,7 +9879,7 @@ else document.getElementById("sessionIDspan").innerHTML = session_id; if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { - document.getElementById("RecorDControl").innerHTML = "\"Inicia"; + document.getElementById("RecorDControl").innerHTML = "\"Iniciar"; } if (INgroupCOUNT > 0) { @@ -9937,7 +9961,7 @@ else } CustomerData_update(); document.getElementById("GENDERhideFORie").innerHTML = ''; - document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("GENDERhideFORieALT").innerHTML = ''; showDiv('DispoSelectBox'); DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; @@ -10350,12 +10374,12 @@ else document.getElementById(divvar).innerHTML = ''; if (divvar == 'DiaLLeaDPrevieW') { - var buildDivHTML = " VISUALIZAR CONTATO
"; + var buildDivHTML = " VISUALIZAR REGISTRO
"; document.getElementById("DiaLLeaDPrevieWHide").innerHTML = buildDivHTML; } if (divvar == 'DiaLDiaLAltPhonE') { - var buildDivHTML = " DISCAR TELEFONE ALT
"; + var buildDivHTML = " DISCAR FONE ALT
"; document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML; } if (DefaulTAlTDiaL == '1') @@ -10370,7 +10394,7 @@ else if (divvar == 'DiaLLeaDPrevieW') { document.getElementById("DiaLLeaDPrevieWHide").innerHTML = ''; - var buildDivHTML = " VISUALIZAR CONTATO
"; + var buildDivHTML = " VISUALIZAR REGISTRO
"; document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_preview_dial==1) {document.vicidial_form.LeadPreview.checked=true} @@ -10378,7 +10402,7 @@ else if (divvar == 'DiaLDiaLAltPhonE') { document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = ''; - var buildDivHTML = " DISCAR TELEFONE ALT
"; + var buildDivHTML = " DISCAR FONE ALT
"; document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_alt_dial==1) {document.vicidial_form.DiaLAltPhonE.checked=true} @@ -10467,8 +10491,8 @@ else active_group_alias = LIVE_default_group_alias; cid_choice = LIVE_caller_id_number; } - document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Grupo Alias: " + active_group_alias + ""; - document.getElementById("XfeRCID").innerHTML = "Clique aqui para escolher um grupo Alias"; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Apelido de Grupo: " + active_group_alias + ""; + document.getElementById("XfeRCID").innerHTML = "Clique aqui para escolher um apelido de grupo"; } else { @@ -10552,7 +10576,7 @@ else var genderValue = document.getElementById('gender_list').options[genderIndex].value; if (genderValue == 'M') {var gIndex = 1;} if (genderValue == 'F') {var gIndex = 2;} - document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("GENDERhideFORieALT").innerHTML = ''; document.getElementById("GENDERhideFORie").innerHTML = ''; document.getElementById("gender_list").selectedIndex = gIndex; } @@ -10564,7 +10588,7 @@ else var genderValue = document.getElementById('gender_list').options[genderIndex].value; if (genderValue == 'M') {var gIndex = 1;} if (genderValue == 'F') {var gIndex = 2;} - document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("GENDERhideFORie").innerHTML = ''; document.getElementById("GENDERhideFORieALT").innerHTML = ''; document.getElementById("gender_list").selectedIndex = gIndex; } @@ -10614,7 +10638,7 @@ echo "\n"; - - + +
# CHAMADABACK DATE/TIMENÚMERONAME STATUSCAMPAIGNLAST DATA/HORA DA CHAMADA COMMENTS
- +     0) {echo "TERRITORIES     \n";} ?> @@ -10640,7 +10664,7 @@ echo "\n"; -DISCAGEM MANUAL       SELETOR RÁPIDO
+DISCAGEM MANUAL       DISCAGEM RÁPIDA
@@ -10698,8 +10722,8 @@ echo "\n";   (12 digits max - digits only)
Ligações Existentes Da Busca:   (Esta opção se verificado tentará encontrar o número de telefone no sistema antes de introduzi-lo como uma ligação nova) Pesquisar Registros Existentes:   (Esta opção caso esteja marcada irá tentar encontrar o número do fone no sistema antes de inserir um novo registro)
@@ -10715,7 +10739,7 @@ echo "\n";
Discar Agora                 - Preview Call + Chamada Preview                 Voltar
@@ -10780,13 +10804,13 @@ Your Status:
Calls Dialing: DISCAGEM SOBREPOSTA - ABANDONAR CHAMADA A TRES + ABANDONAR CHAMADA A TRÊS - Transferência sem acompanhamento + Transferência sem consulta   Discar com o cliente   @@ -10876,7 +10900,7 @@ if ($agent_display_dialable_leads > 0) height=70> - +
Informação Precedente Da Rechamada: Informação de Agendamento Anterior: close
@@ -10893,7 +10917,7 @@ if ($agent_display_dialable_leads > 0) height=70> - +
Extensão Alt Telefone Informação: Informações Complementares do Fone Alt.: minimizar
@@ -10915,7 +10939,7 @@ if ($agent_display_dialable_leads > 0) - height=>
Não existe ninguem na sua sessão:
+ height=>
Não existe ninguém na sua sessão:
Voltar

Ligar novamente para o agente @@ -10931,10 +10955,10 @@ if ($agent_display_dialable_leads > 0) - height=>
Chamada Wrapup: segundos restantes no wrapup

+ height=>
Chamada pós-atd: segundos restantes de pós-atendimento



- Revestimento Wrapup e movimento sobre + Finalizar pós-atendimento e seguir
@@ -10946,12 +10970,12 @@ if ($agent_display_dialable_leads > 0) - height=>
Sua sessão foi incapacitada
SAIR

Voltar + height=>
Sua sessão foi finalizada
SAIR

Voltar
- height=>
Há um tempo sincronização problema com o seu sistema, por favor informe o seu administrador de sistema


Voltar + height=>
Há um problema de sincronização no seu sistema, por favor informe o seu administrador de sistemas


Voltar
@@ -10973,10 +10997,10 @@ if ($agent_display_dialable_leads > 0) height=>
SELEÇÃO DE STATUS :       Desligue novamente       minimizar
- Fim da seleção de status + Seleção do Motivo de Finalização
PAUSAR DISCAGEM DO AGENTE
- LIMPAR FORMULARIO | + LIMPAR FORMULÁRIO | ENVIAR

WEB FORM ENVIAR @@ -10985,7 +11009,7 @@ if ($agent_display_dialable_leads > 0) - height=>
SELECIONE Um CÓDIGO Da PAUSA :
+ height=>
SELECIONE UM CÓDIGO DE PAUSA :
Pausa Code Selection

  @@ -10993,8 +11017,8 @@ if ($agent_display_dialable_leads > 0) - height=>
Selecionar um grupo ALIÁS :
- Grupo Alias Selecção + height=>
SELEC. UM APELIDO DE GRUPO :
+ Seleção de Apelido de Grupo

 
@@ -11046,7 +11070,7 @@ if ($agent_display_dialable_leads > 0)  
ESTE AGENDAMENTO SO APARECE PARA MIM
";} + {echo " SOMENTE MEUS AGENDAMENTOS
";} ?> Comentarios do CB:

@@ -11064,7 +11088,7 @@ if ($agent_display_dialable_leads > 0) if ( ($outbound_autodial_active > 0) and ($disable_blended_checkbox < 1) and ($dial_method != 'INBOUND_MAN') ) { ?> - LIGACAO MISTURADA(ligações externas ativadas)
+ LIGAÇÃO MESCLADA(ligações saintes ativadas)
@@ -11090,9 +11114,9 @@ if ($agent_display_dialable_leads > 0) Canal ESTE AGENDAMENTO SO APARECE PARA MIM
";} + {echo " SOMENTE MEUS AGENDAMENTOS
";} if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) or ($dial_method == 'INBOUND_MAN') ) - {echo " LIGACAO MISTURADA
";} + {echo " LIGAÇÃO MESCLADA
";} ?> @@ -11144,25 +11168,25 @@ else
Discar proximo número
- VISUALIZAR CONTATO
- DISCAR TELEFONE ALT
+ VISUALIZAR REGISTRO
+ DISCAR FONE ALT
-GRAVANDO ARQUIVO:
+ARQUIVO DE GRAVAÇÃO:

ID da gravação:
-Inicia Gravação
+Iniciar Gravação

Web Form
0) - + @@ -11240,7 +11264,7 @@ if ($call_requeue_button > 0) - + - + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/manager_send.php index 95fe0851..6506cb7b 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/vdc_db_query.php index fda1b428..d88f1f8f 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Benutzer busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Unzulässig number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to STATUS INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Eingehend calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Unzulässig call reference value.", +88 => "Incompatible destination.", +95 => "Unzulässig message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Unzulässig information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery an timer expiry.", +103 => "Parameter non-existent or not implemented - passed an (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/vicidial.php index 49b75dc4..e55a28ca 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_de/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"WiederAufnehmen\""; var DiaLControl_auto_HTML_ready = "\"\"WiederAufnehmen\""; var DiaLControl_auto_HTML_OFF = "\"\"WiederAufnehmen\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " ANRUF NOT PLACED") { alert("Anruf wurde nicht getätigt, es gab eine Störung:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Your Shift is over or has changed, you have been logged out of your session

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLICKEN SIE HIER, UM SICH WIEDER ANZUMELDEN\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Your Shift is over or has changed, you have been logged out of your session

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLICKEN SIE HIER, UM SICH WIEDER ANZUMELDEN\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/manager_send.php index 3f4ba453..e630ada8 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/vdc_db_query.php index 3b343bcb..d80ceea8 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Χρήστης busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Ακυρο number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to ΚΑΤΑΣΤΑΣΗ INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Εισερχόμενο calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Ακυρο call reference value.", +88 => "Incompatible destination.", +95 => "Ακυρο message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Ακυρο information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery στο timer expiry.", +103 => "Parameter non-existent or not implemented - passed στο (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/vicidial.php index 424b5848..d7032c99 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_el/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"Επανάληψη\""; var DiaLControl_auto_HTML_ready = "\"\"Επανάληψη\""; var DiaLControl_auto_HTML_OFF = "\"\"Επανάληψη\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " ΚΛΗΣΗ NOT PLACED") { alert("η κλήση δεν τοποθετήθηκε, υπήρξε ένα λάθος:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Your Shift is over or has changed, you have been logged out of your session

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "ΕΠΙΛΕΞΤΕ ΕΔΩ ΓΙΑ ΝΑ ΣΥΝΔΕΘΕΙΤΕ ΠΑΛΙ\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Your Shift is over or has changed, you have been logged out of your session

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "ΕΠΙΛΕΞΤΕ ΕΔΩ ΓΙΑ ΝΑ ΣΥΝΔΕΘΕΙΤΕ ΠΑΛΙ\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/manager_send.php index 861b3bf2..a4fdb696 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/vdc_db_query.php index 6860faa1..befb5107 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Usuario busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Inválido number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to ESTADO INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Entrante calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Inválido call reference value.", +88 => "Incompatible destination.", +95 => "Inválido message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Inválido information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery en timer expiry.", +103 => "Parameter non-existent or not implemented - passed en (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/vicidial.php index f3eb4b52..aff22ce6 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_es/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"Comienzo\""; var DiaLControl_auto_HTML_ready = "\"\"Comienzo\""; var DiaLControl_auto_HTML_OFF = "\"\"Comienzo\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " LLAMADA NOT PLACED") { alert("la llamada no fue atendida, hubo un error:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Su cambio es de más o ha cambiado, se le ha cerrado la sesión de su período de sesiones

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "PINCHA AQUÍ PARA ENTRAR OTRA VEZ\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Su cambio es de más o ha cambiado, se le ha cerrado la sesión de su período de sesiones

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "PINCHA AQUÍ PARA ENTRAR OTRA VEZ\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/manager_send.php index 335adb6a..f8434999 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/vdc_db_query.php index 704cf078..5616afa2 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Utilisateur busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Invalide number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to STATUT INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Entrant calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Invalide call reference value.", +88 => "Incompatible destination.", +95 => "Invalide message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Invalide information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery sur timer expiry.", +103 => "Parameter non-existent or not implemented - passed sur (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/vicidial.php index c390bc96..fe551f90 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_fr/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"Résumé\""; var DiaLControl_auto_HTML_ready = "\"\"Résumé\""; var DiaLControl_auto_HTML_OFF = "\"\"Résumé\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " APPEL NOT PLACED") { alert("l'appel n'a pas été composé, une erreur s'est produite:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Votre Shift est au dessus ou a changé, vous avez été déconnecté de votre session

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "APPUYER ICI POUR VOUS IDENTIFIER\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Votre Shift est au dessus ou a changé, vous avez été déconnecté de votre session

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "APPUYER ICI POUR VOUS IDENTIFIER\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/manager_send.php index fb1579e8..0406ce91 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/vdc_db_query.php index 1af0dbdb..d186768d 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Utente busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Non valido number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to STATO INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "In entrata calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Non valido call reference value.", +88 => "Incompatible destination.", +95 => "Non valido message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Non valido information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery su timer expiry.", +103 => "Parameter non-existent or not implemented - passed su (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/vicidial.php index d4f63d6d..c8bdc2ee 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_it/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"Riprendi\""; var DiaLControl_auto_HTML_ready = "\"\"Riprendi\""; var DiaLControl_auto_HTML_OFF = "\"\"Riprendi\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " CHIAMATA NOT PLACED") { alert("chiamata non effettuata, c`è un errore:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Il tuo turno è finito o è cambiato, sei stato disconnesso dalla tua sessione

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "FAI CLICK QUI PER AUTENTICARTI DI NUOVO\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Il tuo turno è finito o è cambiato, sei stato disconnesso dalla tua sessione

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "FAI CLICK QUI PER AUTENTICARTI DI NUOVO\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/manager_send.php index db564c75..79e089f0 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/vdc_db_query.php index 55d807a3..5a505dde 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Gebruiker busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Ongeldig number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to STATUS INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Inkomend calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Ongeldig call reference value.", +88 => "Incompatible destination.", +95 => "Ongeldig message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Ongeldig information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery op timer expiry.", +103 => "Parameter non-existent or not implemented - passed op (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/vicidial.php index 4f6934d5..abb5985b 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_nl/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"Doorgaan\""; var DiaLControl_auto_HTML_ready = "\"\"Doorgaan\""; var DiaLControl_auto_HTML_OFF = "\"\"Doorgaan\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " BEL NOT PLACED") { alert("gesprek is niet tot stand gebracht, er is een fout opgetreden:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Je dienst is afgelopen of veranderd, je bent afgemeld van de sessie

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLIK HIER OM OPNIEUW IN TE LOGGEN\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Je dienst is afgelopen of veranderd, je bent afgemeld van de sessie

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLIK HIER OM OPNIEUW IN TE LOGGEN\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/manager_send.php index 06fb12c7..95f3402e 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/vdc_db_query.php index 236f21b6..6930f5a9 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Użytkownik busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Nieprawidłowy number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to STATUS INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Przychodząca calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Nieprawidłowy call reference value.", +88 => "Incompatible destination.", +95 => "Nieprawidłowy message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Nieprawidłowy information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery na timer expiry.", +103 => "Parameter non-existent or not implemented - passed na (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/vicidial.php index 7f086516..3c4069be 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pl/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"Ponów\""; var DiaLControl_auto_HTML_ready = "\"\"Ponów\""; var DiaLControl_auto_HTML_OFF = "\"\"Ponów\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " Rozmowa NOT PLACED") { alert("nie wykonano połączenia, wystąpił błąd:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Twoja Shift jest ponad lub zmienił, zostałeś wylogowany z sesji

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLINKNIJ TU, ABY PONOWNIE ZALOGOWAĆ SIĘ\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Twoja Shift jest ponad lub zmienił, zostałeś wylogowany z sesji

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLINKNIJ TU, ABY PONOWNIE ZALOGOWAĆ SIĘ\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/manager_send.php index c66c5512..831b31fa 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/vdc_db_query.php index e1fe8bee..de3025e9 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Usuário busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Inválido number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to STATUS INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Entrante calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Inválido call reference value.", +88 => "Incompatible destination.", +95 => "Inválido message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Inválido information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery em timer expiry.", +103 => "Parameter non-existent or not implemented - passed em (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/vicidial.php index 863242f6..a405637e 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_pt/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"Resumo\""; var DiaLControl_auto_HTML_ready = "\"\"Resumo\""; var DiaLControl_auto_HTML_OFF = "\"\"Resumo\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " CHAMADA NOT PLACED") { alert("a chamada não foi colocada, não havia um erro:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Seu Shift é mais ou mudou, você foi desconectado da sua sessão

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "ESTALE AQUI PARA LOGON OUTRA VEZ\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Seu Shift é mais ou mudou, você foi desconectado da sua sessão

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "ESTALE AQUI PARA LOGON OUTRA VEZ\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/manager_send.php index 2f5829e0..9a38288d 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/vdc_db_query.php index 186becc2..20cf7d5f 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Пользователь busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Недопустимо number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to СТАТУС INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Входящий calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Недопустимо call reference value.", +88 => "Incompatible destination.", +95 => "Недопустимо message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Недопустимо information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery на timer expiry.", +103 => "Parameter non-existent or not implemented - passed на (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/vicidial.php index 53a23b4d..24c75182 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_ru/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"Резюме\""; var DiaLControl_auto_HTML_ready = "\"\"Резюме\""; var DiaLControl_auto_HTML_OFF = "\"\"Резюме\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " ВЫЗОВ NOT PLACED") { alert("вызов не был обслужен, была ошибка:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Ваш Shift больше или изменилась, Вы вышли из Вашей сессии

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "КЛИКНИТЕ ЗДЕСЬ, ЧТОБЫ СНОВА ВОЙТИ\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Ваш Shift больше или изменилась, Вы вышли из Вашей сессии

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "КЛИКНИТЕ ЗДЕСЬ, ЧТОБЫ СНОВА ВОЙТИ\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/manager_send.php index 7ab8d978..63ff75e3 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/vdc_db_query.php index c2f3dcaa..3b1319a3 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Užívateľ busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Nesprávny number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to STAV INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Príchodzie calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Nesprávny call reference value.", +88 => "Incompatible destination.", +95 => "Nesprávny message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Nesprávny information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery na timer expiry.", +103 => "Parameter non-existent or not implemented - passed na (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/vicidial.php index 8681ac10..7c2331e6 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_sk/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"Pokračovať\""; var DiaLControl_auto_HTML_ready = "\"\"Pokračovať\""; var DiaLControl_auto_HTML_OFF = "\"\"Pokračovať\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " HOVOR NOT PLACED") { alert("Hovor nebol uskutočnený, bola zistená chyba:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Vaša Shift je nad alebo sa zmenilo, ste boli odhlásený vašej relácie

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLIKNITE TU NA ZNOVU PRIHLÁSENIE\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Vaša Shift je nad alebo sa zmenilo, ste boli odhlásený vašej relácie

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLIKNITE TU NA ZNOVU PRIHLÁSENIE\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/manager_send.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/manager_send.php index c332817c..9810a13a 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/manager_send.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -94,10 +94,10 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records -# +# 100327-0846 - Fix for list_id override answering machine message -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.2.0-47'; +$build = '100327-0846'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -734,39 +734,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/vdc_db_query.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/vdc_db_query.php index 8bbc6a3d..6b8003dc 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/vdc_db_query.php @@ -234,12 +234,13 @@ # 100202-2306 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1110 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100301-1342 - Changed Available agents output for AGENTDIRECT selection +# 100413-1342 - Fixes for extended alt-dial # -$version = '2.2.0-142'; -$build = '100301-1342'; +$version = '2.2.0-143'; +$build = '100413-1342'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=309; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -435,6 +436,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "使用者 busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "無效 number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to 狀態 INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Incoming calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "無效 call reference value.", +88 => "Incompatible destination.", +95 => "無效 message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "無效 information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery on timer expiry.", +103 => "Parameter non-existent or not implemented - passed on (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -1859,28 +1915,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00301',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2288,27 +2365,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2326,8 +2467,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2336,7 +2476,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2433,9 +2572,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2465,7 +2605,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3970,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3840,7 +3980,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -4764,6 +4904,11 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4836,7 +4981,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4846,7 +4991,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -6144,7 +6289,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6712,7 +6857,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) + { + global $hangup_cause_dictionary; + if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } + else { return "Unidentified Hangup Cause Code."; } + } ##### MySQL Error Logging ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/vicidial.php b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/vicidial.php index 6fc70ed8..91de4031 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/vicidial.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/agc_tw/vicidial.php @@ -278,10 +278,12 @@ # 100301-1329 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100309-1709 - small fix for IE CRM popup # 100315-1149 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100327-0902 - fix for manual dial answering machine message +# 100413-1347 - Various fixes for logging and extended alt-dialing # -$version = '2.2.0-256'; -$build = '100315-1149'; +$version = '2.2.0-258'; +$build = '100413-1347'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2753,6 +2755,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var pause_code_counter=1; var last_uniqueid=''; var tmp_vicidial_id=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; var DiaLControl_auto_HTML = "\"\"恢復\""; var DiaLControl_auto_HTML_ready = "\"\"恢復\""; var DiaLControl_auto_HTML_OFF = "\"\"恢復\""; @@ -3885,7 +3892,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} no_delete_VDAC=0; if (taskvar == 'XfeRVMAIL') { - var blindxferdialstring = campaign_am_message_exten; + var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; no_delete_VDAC=1; } if (blindxferdialstring.length<'2') @@ -4606,7 +4613,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4649,7 +4657,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -5920,7 +5929,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " 撥號 NOT PLACED") { alert("錯誤!電話未置入!:\n" + MDOnextResponse); @@ -8037,6 +8047,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDuniqueid=''; XDuniqueid=''; tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; if (manual_dial_in_progress==1) { @@ -8662,56 +8684,58 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Your Shift is over or has changed, you have been logged out of your session

';} + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "按此重新登入\n"; + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Your Shift is over or has changed, you have been logged out of your session

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "按此重新登入\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9719,7 +9743,7 @@ else { if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_CLOSER_service_level.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_CLOSER_service_level.php new file mode 100644 index 00000000..5de47198 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_CLOSER_service_level.php @@ -0,0 +1,991 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 80509-0943 - First build +# 80510-1500 - Added fixed scale hold time graph +# 80519-0413 - rewrote time intervals code and stats gathering code +# 80528-2320 - fixed small calculation bugs and display bugs, added more shifts +# 90310-2117 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90801-0923 - Added in-group name to pulldown +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["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"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_names[$i] = $row[1]; + $i++; + } +?> + + + + + +\n"; +echo "\n"; + +echo "\n"; +echo "Inbound Service Level Report\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
Título:   Primeiro:   MI:  Ultimo:   Nome:   Inicial:  Sobrenome:
Endereço1: Vendedor: Sexo:
Telefone: @@ -11257,7 +11281,7 @@ else ?> Codigo de Area: Codigo de Área: Telefone Alternativo:
"; + +echo "\n"; +echo ""; + +?> + +"; + +?> + +\n"; + $o=0; +while ($groups_to_print > $o) + { + if ($groups[$o] == $group) {echo "\n";} + else {echo "\n";} + $o++; + } +echo "\n"; +echo "\n"; +echo "\n"; +echo "           ALTERAR | RELATÓRIOS \n"; +echo "\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+	{
+	echo "\n\n";
+	echo "POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+	}
+
+else
+{
+### FOR SHIFTS IT IS BEST TO STICK TO 15-MINUTE INCREMENTS FOR START TIMES ###
+
+if ($shift == 'AM') 
+	{
+#	$time_BEGIN=$AM_shift_BEGIN;
+#	$time_END=$AM_shift_END;
+#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+#	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}   
+	if (strlen($time_END) < 6) {$time_END = "11:59:59";}
+#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}   
+#	if (strlen($time_END) < 6) {$time_END = "11:59:59";}
+	}
+if ($shift == 'PM') 
+	{
+#	$time_BEGIN=$PM_shift_BEGIN;
+#	$time_END=$PM_shift_END;
+#	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+#	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "12:00:00";}
+	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+	}
+if ($shift == 'ALL') 
+	{
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+	}
+if ($shift == 'DAYTIME') 
+	{
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
+	if (strlen($time_END) < 6) {$time_END = "00:59:59";}
+	}
+if ($shift == '10AM-6PM') 
+	{
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "10:00:00";}
+	if (strlen($time_END) < 6) {$time_END = "17:59:59";}
+	}
+if ($shift == '9AM-1AM') 
+	{
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "09:00:00";}
+	if (strlen($time_END) < 6) {$time_END = "00:59:59";}
+	}
+if ($shift == '845-1745') 
+	{
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "08:45:00";}
+	if (strlen($time_END) < 6) {$time_END = "17:44:59";}
+	}
+if ($shift == '1745-100') 
+	{
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "17:45:00";}
+	if (strlen($time_END) < 6) {$time_END = "00:59:59";}
+	}
+
+$query_date_BEGIN = "$query_date $time_BEGIN";   
+$query_date_END = "$end_date $time_END";
+
+$SQdate_ARY =	explode(' ',$query_date_BEGIN);
+$SQday_ARY =	explode('-',$SQdate_ARY[0]);
+$SQtime_ARY =	explode(':',$SQdate_ARY[1]);
+$EQdate_ARY =	explode(' ',$query_date_END);
+$EQday_ARY =	explode('-',$EQdate_ARY[0]);
+$EQtime_ARY =	explode(':',$EQdate_ARY[1]);
+
+$SQepochDAY = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
+$SQepoch = mktime($SQtime_ARY[0], $SQtime_ARY[1], $SQtime_ARY[2], $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
+$EQepoch = mktime($EQtime_ARY[0], $EQtime_ARY[1], $EQtime_ARY[2], $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
+
+$SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1) );
+$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
+
+$DURATIONsec = ($EQepoch - $SQepoch);
+$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
+
+if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
+	{
+	$EQepoch = ($SQepochDAY + ($EQsec + 86400) );
+	$query_date_END = date("Y-m-d H:i:s", $EQepoch);
+	$DURATIONday++;
+	}
+
+echo "Inbound Service Level Report                      $NOW_TIME\n";
+echo "\n";
+echo "Time range $DURATIONday days: $query_date_BEGIN to $query_date_END\n\n";
+#echo "Time range day sec: $SQsec - $EQsec   Day range in epoch: $SQepoch - $EQepoch   Start: $SQepochDAY\n";
+
+$d=0;
+while ($d < $DURATIONday)
+	{
+	$dSQepoch = ($SQepoch + ($d * 86400) );
+	$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) ) );
+
+	if ($EQsec < $SQsec)
+		{
+		$dEQepoch = ($dEQepoch + 86400);
+		}
+
+	$daySTART[$d] = date("Y-m-d H:i:s", $dSQepoch);
+	$dayEND[$d] = date("Y-m-d H:i:s", $dEQepoch);
+
+	$d++;
+	}
+
+##########################################################################
+#########  CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
+
+### BUILD HOUR:MIN DISPLAY ARRAY ###
+$i=0;
+$h=4;
+$j=0;
+$Zhour=1;
+$active_time=0;
+$hour =		($SQtime_ARY[0] - 1);
+$startSEC = ($SQsec - 900);
+$endSEC =	($SQsec - 1);
+if ($SQtime_ARY[1] > 14) 
+	{
+	$h=1;
+	$hour++;
+	if ($hour < 10) {$hour = "0$hour";}
+	}
+if ($SQtime_ARY[1] > 29) {$h=2;}
+if ($SQtime_ARY[1] > 44) {$h=3;}
+while ($i < 96)
+	{
+	$startSEC = ($startSEC + 900);
+	$endSEC = ($endSEC + 900);
+	$time = '      ';
+	if ($h >= 4)
+		{
+		$hour++;
+		if ($Zhour == '00') 
+			{
+			$startSEC=0;
+			$endSEC=899;
+			}
+		$h=0;
+		if ($hour < 10) {$hour = "0$hour";}
+		$Stime="$hour:00";
+		$Etime="$hour:15";
+		$time = "+$Stime-$Etime+";
+		}
+	if ($h == 1)
+		{
+		$Stime="$hour:15";
+		$Etime="$hour:30";
+		$time = " $Stime-$Etime ";
+		}
+	if ($h == 2)
+		{
+		$Stime="$hour:30";
+		$Etime="$hour:45";
+		$time = " $Stime-$Etime ";
+		}
+	if ($h == 3)
+		{
+		$Zhour=$hour;
+		$Zhour++;
+		if ($Zhour < 10) {$Zhour = "0$Zhour";}
+		if ($Zhour == 24) {$Zhour = "00";}
+		$Stime="$hour:45";
+		$Etime="$Zhour:00";
+		$time = " $Stime-$Etime ";
+		if ($Zhour == '00') 
+			{$hour = ($Zhour - 1);}
+		}
+
+	if ( ( ($startSEC >= $SQsec) and ($endSEC <= $EQsec) and ($EQsec > $SQsec) ) or 
+		( ($startSEC >= $SQsec) and ($EQsec < $SQsec) ) or 
+		( ($endSEC <= $EQsec) and ($EQsec < $SQsec) ) )
+		{
+		$HMdisplay[$j] =	$time;
+		$HMstart[$j] =		$Stime;
+		$HMend[$j] =		$Etime;
+		$HMSepoch[$j] =		$startSEC;
+		$HMEepoch[$j] =		$endSEC;
+
+		$j++;
+		}
+
+	$h++;
+	$i++;
+	}
+
+$TOTintervals = $j;
+
+
+### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
+$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "';";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$records_to_grab = mysql_num_rows($rslt);
+$i=0;
+while ($i < $records_to_grab)
+	{
+	$row=mysql_fetch_row($rslt);
+	$qs[$i] = $row[0];
+	$dt[$i] = 0;
+	$ut[$i] = ($row[1] - $SQepochDAY);
+	while($ut[$i] >= 86400) 
+		{
+		$ut[$i] = ($ut[$i] - 86400);
+		$dt[$i]++;
+		}
+	if ( ($ut[$i] <= $EQsec) and ($EQsec < $SQsec) )
+		{
+		$dt[$i] = ($dt[$i] - 1);
+		}
+	$ls[$i] = $row[2];
+	$st[$i] = $row[3];
+
+#	echo "$qs[$i] $dt[$i] $ut[$i] $ls[$i] $st[$i]\n";
+
+	$i++;
+	}
+
+### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
+$MT[0]='0';
+$totCALLS=0;
+$totDROPS=0;
+$totQUEUE=0;
+$totCALLSsec=0;
+$totDROPSsec=0;
+$totQUEUEsec=0;
+$totCALLSmax=0;
+$totDROPSmax=0;
+$totQUEUEmax=0;
+$totCALLSdate=$MT;
+$totDROPSdate=$MT;
+$totQUEUEdate=$MT;
+$qrtCALLS=$MT;
+$qrtDROPS=$MT;
+$qrtQUEUE=$MT;
+$qrtCALLSsec=$MT;
+$qrtDROPSsec=$MT;
+$qrtQUEUEsec=$MT;
+$qrtCALLSavg=$MT;
+$qrtDROPSavg=$MT;
+$qrtQUEUEavg=$MT;
+$qrtCALLSmax=$MT;
+$qrtDROPSmax=$MT;
+$qrtQUEUEmax=$MT;
+$j=0;
+while ($j < $TOTintervals)
+	{
+	$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
+	$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
+	$qrtCALLS[$j]=0; $qrtCALLSsec[$j]=0; $qrtCALLSmax[$j]=0;
+	$qrtDROPS[$j]=0; $qrtDROPSsec[$j]=0; $qrtDROPSmax[$j]=0;
+	$qrtQUEUE[$j]=0; $qrtQUEUEsec[$j]=0; $qrtQUEUEmax[$j]=0;
+	$i=0;
+	while ($i < $records_to_grab)
+		{
+		if ( ($ut[$i] >= $HMSepoch[$j]) and ($ut[$i] <= $HMEepoch[$j]) )
+			{
+			$totCALLS++;
+			$totCALLSsec = ($totCALLSsec + $ls[$i]);
+			$totCALLSsecDATE[$dtt] = ($totCALLSsecDATE[$dtt] + $ls[$i]);
+			$qrtCALLS[$j]++;
+			$qrtCALLSsec[$j] = ($qrtCALLSsec[$j] + $ls[$i]);
+			$dtt = $dt[$i];
+			$totCALLSdate[$dtt]++;
+			if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
+			if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
+			if (ereg('DROP',$st[$i])) 
+				{
+				$totDROPS++;
+				$totDROPSsec = ($totDROPSsec + $ls[$i]);
+				$totDROPSsecDATE[$dtt] = ($totDROPSsecDATE[$dtt] + $ls[$i]);
+				$qrtDROPS[$j]++;
+				$qrtDROPSsec[$j] = ($qrtDROPSsec[$j] + $ls[$i]);
+				$totDROPSdate[$dtt]++;
+				if ($totDROPSmax < $ls[$i]) {$totDROPSmax = $ls[$i];}
+				if ($qrtDROPSmax[$j] < $ls[$i]) {$qrtDROPSmax[$j] = $ls[$i];}
+				}
+			if ($qs[$i] > 0) 
+				{
+				$totQUEUE++;
+				$totQUEUEsec = ($totQUEUEsec + $qs[$i]);
+				$totQUEUEsecDATE[$dtt] = ($totQUEUEsecDATE[$dtt] + $qs[$i]);
+				$qrtQUEUE[$j]++;
+				$qrtQUEUEsec[$j] = ($qrtQUEUEsec[$j] + $qs[$i]);
+				$totQUEUEdate[$dtt]++;
+				if ($totQUEUEmax < $qs[$i]) {$totQUEUEmax = $qs[$i];}
+				if ($qrtQUEUEmax[$j] < $qs[$i]) {$qrtQUEUEmax[$j] = $qs[$i];}
+				}
+
+			if ($qs[$i] == 0) {$hd__0[$j]++;}
+			if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20[$j]++;}
+			if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40[$j]++;}
+			if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60[$j]++;}
+			if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80[$j]++;}
+			if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100[$j]++;}
+			if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120[$j]++;}
+			if ($qs[$i] > 120) {$hd121[$j]++;}
+
+			}
+		
+		$i++;
+		}
+
+	$j++;
+	}
+
+
+
+
+###################################################
+### TOTALS SUMMARY SECTION ###
+echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
+echo "|                                           |        |        |        |        |        |  AVG   |  AVG   |        |  TOTAL   |  AVG   |\n";
+echo "| SHIFT                                     |        |        |  AVG   |        |        | HOLD(s)| HOLD(s)|        | CALLTIME |CALLTIME|\n";
+echo "| DATE-TIME RANGE                           | DROPS  | DROP % | DROP(s)| HOLD   | HOLD % |  HOLD  | TOTAL  | CALLS  | MIN:SEC  |SECONDS |\n";
+echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
+
+$d=0;
+while ($d < $DURATIONday)
+	{
+	if ($totDROPSdate[$d] < 1) {$totDROPSdate[$d]=0;}
+	if ($totQUEUEdate[$d] < 1) {$totQUEUEdate[$d]=0;}
+	if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;}
+
+	if ($totDROPSdate[$d] > 0)
+		{$totDROPSpctDATE[$d] = ( ($totDROPSdate[$d] / $totCALLSdate[$d]) * 100);}
+	else {$totDROPSpctDATE[$d] = 0;}
+	$totDROPSpctDATE[$d] = round($totDROPSpctDATE[$d], 2);
+	if ($totQUEUEdate[$d] > 0)
+		{$totQUEUEpctDATE[$d] = ( ($totQUEUEdate[$d] / $totCALLSdate[$d]) * 100);}
+	else {$totQUEUEpctDATE[$d] = 0;}
+	$totQUEUEpctDATE[$d] = round($totQUEUEpctDATE[$d], 2);
+
+	if ($totDROPSsecDATE[$d] > 0)
+		{$totDROPSavgDATE[$d] = ($totDROPSsecDATE[$d] / $totDROPSdate[$d]);}
+	else {$totDROPSavgDATE[$d] = 0;}
+	if ($totQUEUEsecDATE[$d] > 0)
+		{$totQUEUEavgDATE[$d] = ($totQUEUEsecDATE[$d] / $totQUEUEdate[$d]);}
+	else {$totQUEUEavgDATE[$d] = 0;}
+	if ($totQUEUEsecDATE[$d] > 0)
+		{$totQUEUEtotDATE[$d] = ($totQUEUEsecDATE[$d] / $totCALLSdate[$d]);}
+	else {$totQUEUEtotDATE[$d] = 0;}
+
+	if ($totCALLSsecDATE[$d] > 0)
+		{
+		$totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]);
+
+		$totTIME_M = ($totCALLSsecDATE[$d] / 60);
+		$totTIME_M_int = round($totTIME_M, 2);
+		$totTIME_M_int = intval("$totTIME_M");
+		$totTIME_S = ($totTIME_M - $totTIME_M_int);
+		$totTIME_S = ($totTIME_S * 60);
+		$totTIME_S = round($totTIME_S, 0);
+		if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
+		$totTIME_MS = "$totTIME_M_int:$totTIME_S";
+		$totTIME_MS =		sprintf("%8s", $totTIME_MS);
+		}
+	else 
+		{
+		$totCALLSavgDATE[$d] = 0;
+		$totTIME_MS='        ';
+		}
+
+	$totCALLSavgDATE[$d] =	sprintf("%6.0f", $totCALLSavgDATE[$d]);
+	$totDROPSavgDATE[$d] =	sprintf("%7.2f", $totDROPSavgDATE[$d]);
+	$totQUEUEavgDATE[$d] =	sprintf("%7.2f", $totQUEUEavgDATE[$d]);
+	$totQUEUEtotDATE[$d] =	sprintf("%7.2f", $totQUEUEtotDATE[$d]);
+	$totDROPSpctDATE[$d] =	sprintf("%6.2f", $totDROPSpctDATE[$d]);
+	$totQUEUEpctDATE[$d] =	sprintf("%6.2f", $totQUEUEpctDATE[$d]);
+	$totDROPSdate[$d] =	sprintf("%6s", $totDROPSdate[$d]);
+	$totQUEUEdate[$d] =	sprintf("%6s", $totQUEUEdate[$d]);
+	$totCALLSdate[$d] =	sprintf("%6s", $totCALLSdate[$d]);
+
+	echo "| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n";
+	$d++;
+	}
+
+	if ($totDROPS > 0)
+		{$totDROPSpct = ( ($totDROPS / $totCALLS) * 100);}
+	else {$totDROPSpct = 0;}
+	$totDROPSpct = round($totDROPSpct, 2);
+	if ($totQUEUE > 0)
+		{$totQUEUEpct = ( ($totQUEUE / $totCALLS) * 100);}
+	else {$totQUEUEpct = 0;}
+	$totQUEUEpct = round($totQUEUEpct, 2);
+
+	if ($totDROPSsec > 0)
+		{$totDROPSavg = ($totDROPSsec / $totDROPS);}
+	else {$totDROPSavg = 0;}
+	if ($totQUEUEsec > 0)
+		{$totQUEUEavg = ($totQUEUEsec / $totQUEUE);}
+	else {$totQUEUEavg = 0;}
+	if ($totQUEUEsec > 0)
+		{$totQUEUEtot = ($totQUEUEsec / $totCALLS);}
+	else {$totQUEUEtot = 0;}
+
+if ($totCALLSsec > 0)
+	{
+	$totCALLSavg = ($totCALLSsec / $totCALLS);
+
+	$totTIME_M = ($totCALLSsec / 60);
+	$totTIME_M_int = round($totTIME_M, 2);
+	$totTIME_M_int = intval("$totTIME_M");
+	$totTIME_S = ($totTIME_M - $totTIME_M_int);
+	$totTIME_S = ($totTIME_S * 60);
+	$totTIME_S = round($totTIME_S, 0);
+	if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
+	$totTIME_MS = "$totTIME_M_int:$totTIME_S";
+	$totTIME_MS =		sprintf("%9s", $totTIME_MS);
+	}
+else 
+	{
+	$totCALLSavg = 0;
+	$totTIME_MS='         ';
+	}
+
+
+	$FtotCALLSavg =	sprintf("%6.0f", $totCALLSavg);
+	$FtotDROPSavg =	sprintf("%7.2f", $totDROPSavg);
+	$FtotQUEUEavg =	sprintf("%7.2f", $totQUEUEavg);
+	$FtotQUEUEtot =	sprintf("%7.2f", $totQUEUEtot);
+	$FtotDROPSpct =	sprintf("%6.2f", $totDROPSpct);
+	$FtotQUEUEpct =	sprintf("%6.2f", $totQUEUEpct);
+	$FtotDROPS =	sprintf("%6s", $totDROPS);
+	$FtotQUEUE =	sprintf("%6s", $totQUEUE);
+	$FtotCALLS =	sprintf("%6s", $totCALLS);
+
+echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
+echo "|                                    TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n";
+echo "+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
+
+
+	## FORMAT OUTPUT ##
+	$i=0;
+	$hi_hour_count=0;
+	$hi_hold_count=0;
+
+	while ($i < $TOTintervals)
+		{
+
+		if ($qrtCALLS[$i] > 0)
+			{$qrtCALLSavg[$i] = ($qrtCALLSsec[$i] / $qrtCALLS[$i]);}
+		else {$qrtCALLSavg[$i] = 0;}
+		if ($qrtDROPS[$i] > 0)
+			{$qrtDROPSavg[$i] = ($qrtDROPSsec[$i] / $qrtDROPS[$i]);}
+		else {$qrtDROPSavg[$i] = 0;}
+		if ($qrtQUEUE[$i] > 0)
+			{$qrtQUEUEavg[$i] = ($qrtQUEUEsec[$i] / $qrtQUEUE[$i]);}
+		else {$qrtQUEUEavg[$i] = 0;}
+
+		if ($qrtCALLS[$i] > $hi_hour_count) {$hi_hour_count = $qrtCALLS[$i];}
+		if ($qrtQUEUEavg[$i] > $hi_hold_count) {$hi_hold_count = $qrtQUEUEavg[$i];}
+
+		$qrtQUEUEavg[$i] = round($qrtQUEUEavg[$i], 0);
+		if (strlen($qrtQUEUEavg[$i])<1) {$qrtQUEUEavg[$i]=0;}
+		$qrtQUEUEmax[$i] = round($qrtQUEUEmax[$i], 0);
+		if (strlen($qrtQUEUEmax[$i])<1) {$qrtQUEUEmax[$i]=0;}
+
+		$i++;
+		}
+
+if ($hi_hour_count < 1)
+	{$hour_multiplier = 0;}
+else
+	{$hour_multiplier = (20 / $hi_hour_count);}
+if ($hi_hold_count < 1)
+	{$hold_multiplier = 0;}
+else
+	{$hold_multiplier = (20 / $hi_hold_count);}
+
+
+
+
+###################################################################
+#########  HOLD TIME, CALL AND DROP STATS 15-MINUTE INCREMENTS ####
+
+echo "\n";
+echo "---------- HOLD TIME, CALL AND DROP STATS\n";
+
+echo "";
+
+echo "";
+echo "\n";
+echo "GRAPH IN 15 MINUTE INCREMENTS OF AVERAGE HOLD TIME FOR CALLS TAKEN INTO THIS IN-GROUP\n";
+
+
+$k=1;
+$Mk=0;
+$call_scale = '0';
+while ($k <= 22) 
+	{
+	if ( ($k < 1) or ($hour_multiplier <= 0) )
+		{$scale_num = 20;}
+	else
+		{
+		$TMPscale_num=(23 / $hour_multiplier);
+		$TMPscale_num = round($TMPscale_num, 0);
+		$scale_num=($k / $hour_multiplier);
+		$scale_num = round($scale_num, 0);
+		}
+	$tmpscl = "$call_scale$TMPscale_num";
+
+	if ( ($Mk >= 4) or (strlen($tmpscl)==23) )
+		{
+		$Mk=0;
+		$LENscale_num = (strlen($scale_num));
+		$k = ($k + $LENscale_num);
+		$call_scale .= "$scale_num";
+		}
+	else
+		{
+		$call_scale .= " ";
+		$k++;   $Mk++;
+		}
+	}
+$k=1;
+$Mk=0;
+$hold_scale = '0';
+while ($k <= 22) 
+	{
+	if ( ($k < 1) or ($hold_multiplier <= 0) )
+		{$scale_num = 20;}
+	else
+		{
+		$TMPscale_num=(23 / $hold_multiplier);
+		$TMPscale_num = round($TMPscale_num, 0);
+		$scale_num=($k / $hold_multiplier);
+		$scale_num = round($scale_num, 0);
+		}
+	$tmpscl = "$hold_scale$TMPscale_num";
+
+	if ( ($Mk >= 4) or (strlen($tmpscl)==23) )
+		{
+		$Mk=0;
+		$LENscale_num = (strlen($scale_num));
+		$k = ($k + $LENscale_num);
+		$hold_scale .= "$scale_num";
+		}
+	else
+		{
+		$hold_scale .= " ";
+		$k++;   $Mk++;
+		}
+	}
+
+
+echo "+-------------+-----------------------+-------+-------+  +-----------------------+-------+-------+\n";
+echo "|    TIME     |  AVG HOLD TIME (sec)  | (in seconds)  |  |    CALLS HANDLED      |       |       |\n";
+echo "| 15 MIN INT  |$hold_scale| AVG   | MAX   |  |$call_scale| DROPS | TOTAL |\n";
+echo "+-------------+-----------------------+-------+-------+  +-----------------------+-------+-------+\n";
+
+$i=0;
+while ($i < $TOTintervals)
+	{
+	$char_counter=0;
+	### BEGIN HOLD TIME TOTALS GRAPH ###
+		$Ghour_count = $qrtCALLS[$i];
+	if ($Ghour_count > 0) {$no_lines_yet=0;}
+
+	$Gavg_hold = $qrtQUEUEavg[$i];
+	if ($Gavg_hold < 1) 
+		{
+		if ($i < 0)
+			{
+			$do_nothing=1;
+			}
+		else
+			{
+			$TOT_lines++;
+			$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
+			$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
+			echo "|$HMdisplay[$i]|";
+			$k=0;   while ($k <= 22) {echo " ";   $k++;}
+			echo "| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
+			}
+		}
+	else
+		{
+		$TOT_lines++;
+		$no_lines_yet=0;
+		$Xavg_hold = ($Gavg_hold * $hold_multiplier);
+		$Yavg_hold = (19 - $Xavg_hold);
+
+		$qrtQUEUEavg[$i] =	sprintf("%5s", $qrtQUEUEavg[$i]);
+		$qrtQUEUEmax[$i] =	sprintf("%5s", $qrtQUEUEmax[$i]);
+
+		echo "|$HMdisplay[$i]|";
+		$k=0;   while ($k <= $Xavg_hold) {echo "*";   $k++;   $char_counter++;}
+		if ($char_counter >= 22) {echo "H";   $char_counter++;}
+		else {echo "*H";   $char_counter++;   $char_counter++;}
+		$k=0;   while ($k <= $Yavg_hold) {echo " ";   $k++;   $char_counter++;}
+			while ($char_counter <= 22) {echo " ";   $char_counter++;}
+		echo "| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
+		}
+	### END HOLD TIME TOTALS GRAPH ###
+
+	$char_counter=0;
+ 	### BEGIN CALLS TOTALS GRAPH ###
+	$Ghour_count = $qrtCALLS[$i];
+	if ($Ghour_count < 1) 
+		{
+		if ($i < 0)
+			{
+			$do_nothing=1;
+			}
+		else
+			{
+			$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
+			echo "  |";
+			$k=0;   while ($k <= 22) {echo " ";   $k++;}
+			echo "| $qrtCALLS[$i] |     0 |\n";
+			}
+		}
+	else
+		{
+		$no_lines_yet=0;
+		$Xhour_count = ($Ghour_count * $hour_multiplier);
+		$Yhour_count = (19 - $Xhour_count);
+
+		$Gdrop_count = $qrtDROPS[$i];
+		if ($Gdrop_count < 1) 
+			{
+			$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
+
+			echo "  |";
+			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
+			if ($char_counter > 21) {echo "C";   $char_counter++;}
+			else {echo "*C";   $char_counter++;   $char_counter++;}
+			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
+				while ($char_counter <= 22) {echo " ";   $char_counter++;}
+			echo "|     0 | $qrtCALLS[$i] |\n";
+			}
+		else
+			{
+			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
+
+		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
+
+			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
+
+			$qrtCALLS[$i] =	sprintf("%5s", $qrtCALLS[$i]);
+			$qrtDROPS[$i] =	sprintf("%5s", $qrtDROPS[$i]);
+
+			echo "  |";
+			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
+			echo "D";   $char_counter++;
+			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
+			echo "C";   $char_counter++;
+			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
+				while ($char_counter <= 22) {echo " ";   $char_counter++;}
+			echo "| $qrtDROPS[$i] | $qrtCALLS[$i] |\n";
+			}
+		}
+	### END CALLS TOTALS GRAPH ###
+
+	$i++;
+	}
+
+
+if ($totQUEUEsec > 0)
+	{$totQUEUEavgRAW = ($totCALLS / $totQUEUEsec);}
+else
+	{$totQUEUEavgRAW = 0;}
+$totQUEUEavg =	sprintf("%5s", $totQUEUEavg); 
+	while (strlen($totQUEUEavg)>5) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);}
+$totQUEUEmax =	sprintf("%5s", $totQUEUEmax);
+	while (strlen($totQUEUEmax)>5) {$totQUEUEmax = ereg_replace(".$",'',$totQUEUEmax);}
+$totDROPS =	sprintf("%5s", $totDROPS);
+$totCALLS =	sprintf("%5s", $totCALLS);
+
+
+echo "+-------------+-----------------------+-------+-------+  +-----------------------+-------+-------+\n";
+echo "| TOTAL                               | $totQUEUEavg | $totQUEUEmax |  |                       | $totDROPS | $totCALLS |\n";
+echo "+-------------------------------------+-------+-------+  +-----------------------+-------+-------+\n";
+
+
+
+
+##############################
+#########  CALL HOLD TIME BREAKDOWN IN SECONDS, 15-MINUTE INCREMENT
+
+
+echo "\n";
+echo "---------- TEMPO DE ESPERA POR SEGUNDOS\n";
+echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
+echo "|    TIME     |       |  % OF CALLS GROUPED BY HOLD TIME (SEC)  | |   AVERAGE TIME BEFORE RESPOSTA (SEC)    |\n";
+echo "| 15 MIN INT  | CALLS |    0   20   40   60   80  100  120 120+ | | AVG  |0   20   40   60   80  100  120 |\n";
+echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
+
+$APhd__0=0; $APhd_20=0; $APhd_40=0; $APhd_60=0; $APhd_80=0; $APhd100=0; $APhd120=0; $APhd121=0;
+$h=0;
+while ($h < $TOTintervals)
+	{
+	$Aavg_hold[$h] = $qrtQUEUEavg[$h]; 
+	if ($hd__0[$h] > 0) {$Phd__0[$h] = round( ( ($hd__0[$h] / $qrtCALLS[$h]) * 100) );}
+		else {$Phd__0[$h]=0;}
+	if ($hd_20[$h] > 0) {$Phd_20[$h] = round( ( ($hd_20[$h] / $qrtCALLS[$h]) * 100) );}
+		else {$Phd_20[$h]=0;}
+	if ($hd_40[$h] > 0) {$Phd_40[$h] = round( ( ($hd_40[$h] / $qrtCALLS[$h]) * 100) );}
+		else {$Phd_40[$h]=0;}
+	if ($hd_60[$h] > 0) {$Phd_60[$h] = round( ( ($hd_60[$h] / $qrtCALLS[$h]) * 100) );}
+		else {$Phd_60[$h]=0;}
+	if ($hd_80[$h] > 0) {$Phd_80[$h] = round( ( ($hd_80[$h] / $qrtCALLS[$h]) * 100) );}
+		else {$Phd_80[$h]=0;}
+	if ($hd100[$h] > 0) {$Phd100[$h] = round( ( ($hd100[$h] / $qrtCALLS[$h]) * 100) );}
+		else {$Phd100[$h]=0;}
+	if ($hd120[$h] > 0) {$Phd120[$h] = round( ( ($hd120[$h] / $qrtCALLS[$h]) * 100) );}
+		else {$Phd120[$h]=0;}
+	if ($hd121[$h] > 0) {$Phd121[$h] = round( ( ($hd121[$h] / $qrtCALLS[$h]) * 100) );}
+		else {$Phd121[$h]=0;}
+		while (strlen($qrtQUEUEavg[$h])>4) {$qrtQUEUEavg[$h] = ereg_replace(".$",'',$qrtQUEUEavg[$h]);}
+	$hd__0[$h] =	sprintf("%4s", $hd__0[$h]);
+	$hd_20[$h] =	sprintf("%4s", $hd_20[$h]);
+	$hd_40[$h] =	sprintf("%4s", $hd_40[$h]);
+	$hd_60[$h] =	sprintf("%4s", $hd_60[$h]);
+	$hd_80[$h] =	sprintf("%4s", $hd_80[$h]);
+	$hd100[$h] =	sprintf("%4s", $hd100[$h]);
+	$hd120[$h] =	sprintf("%4s", $hd120[$h]);
+	$hd121[$h] =	sprintf("%4s", $hd121[$h]);
+	$Phd__0[$h] =	sprintf("%4s", $Phd__0[$h]);
+	$Phd_20[$h] =	sprintf("%4s", $Phd_20[$h]);
+	$Phd_40[$h] =	sprintf("%4s", $Phd_40[$h]);
+	$Phd_60[$h] =	sprintf("%4s", $Phd_60[$h]);
+	$Phd_80[$h] =	sprintf("%4s", $Phd_80[$h]);
+	$Phd100[$h] =	sprintf("%4s", $Phd100[$h]);
+	$Phd120[$h] =	sprintf("%4s", $Phd120[$h]);
+	$Phd121[$h] =	sprintf("%4s", $Phd121[$h]);
+
+	$ALLcalls = ($ALLcalls + $qrtCALLS[$h]);
+	$ALLhd__0 = ($ALLhd__0 + $hd__0[$h]);
+	$ALLhd_20 = ($ALLhd_20 + $hd_20[$h]);
+	$ALLhd_40 = ($ALLhd_40 + $hd_40[$h]);
+	$ALLhd_60 = ($ALLhd_60 + $hd_60[$h]);
+	$ALLhd_80 = ($ALLhd_80 + $hd_80[$h]);
+	$ALLhd100 = ($ALLhd100 + $hd100[$h]);
+	$ALLhd120 = ($ALLhd120 + $hd120[$h]);
+	$ALLhd121 = ($ALLhd121 + $hd121[$h]);
+
+	if ( ($Aavg_hold[$h] < 1) or ($Aavg_hold[$h] > 119) )
+		{
+		if ($Aavg_hold[$h] < 1)		{$qrtQUEUEavg_scale[$h] = '                                ';}
+		if ($Aavg_hold[$h] > 119)	{$qrtQUEUEavg_scale[$h] = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';}
+		}
+	else
+		{
+		$qrtQUEUEavg_val[$h] = ( (32 / 120) * $Aavg_hold[$h] );
+		$k=0;
+		$blank=0;
+		while ($k < 32)
+			{
+			if ($k <= $qrtQUEUEavg_val[$h]) 
+				{
+				if ($k < 1) {$qrtQUEUEavg_scale[$h] .= '';}
+				$qrtQUEUEavg_scale[$h] .= 'x';
+				}
+			else 
+				{
+				if ( ($k > 0) and ($blank < 1) ) {$qrtQUEUEavg_scale[$h] .= '';}
+				$qrtQUEUEavg_scale[$h] .= ' ';
+				$blank++;
+				}
+			$k++;
+			if ( ($k > 31) and ($blank < 1) ) {$qrtQUEUEavg_scale[$h] .= '';}
+			}
+		}
+
+	$Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]);
+	while (strlen($Aavg_hold[$h])>4) {$Aavg_hold[$h] = ereg_replace("^.",'',$Aavg_hold[$h]);}
+
+	echo "|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n";
+	
+	$h++;
+	}
+
+if ($ALLhd__0 > 0) {$APhd__0 = round( ( ($ALLhd__0 / $ALLcalls) * 100) );}
+if ($ALLhd_20 > 0) {$APhd_20 = round( ( ($ALLhd_20 / $ALLcalls) * 100) );}
+if ($ALLhd_40 > 0) {$APhd_40 = round( ( ($ALLhd_40 / $ALLcalls) * 100) );}
+if ($ALLhd_60 > 0) {$APhd_60 = round( ( ($ALLhd_60 / $ALLcalls) * 100) );}
+if ($ALLhd_80 > 0) {$APhd_80 = round( ( ($ALLhd_80 / $ALLcalls) * 100) );}
+if ($ALLhd100 > 0) {$APhd100 = round( ( ($ALLhd100 / $ALLcalls) * 100) );}
+if ($ALLhd120 > 0) {$APhd120 = round( ( ($ALLhd120 / $ALLcalls) * 100) );}
+if ($ALLhd121 > 0) {$APhd121 = round( ( ($ALLhd121 / $ALLcalls) * 100) );}
+
+$ALLcalls =	sprintf("%5s", $ALLcalls);
+$APhd__0 =	sprintf("%4s", $APhd__0);
+$APhd_20 =	sprintf("%4s", $APhd_20);
+$APhd_40 =	sprintf("%4s", $APhd_40);
+$APhd_60 =	sprintf("%4s", $APhd_60);
+$APhd_80 =	sprintf("%4s", $APhd_80);
+$APhd100 =	sprintf("%4s", $APhd100);
+$APhd120 =	sprintf("%4s", $APhd120);
+$APhd121 =	sprintf("%4s", $APhd121);
+
+	while (strlen($totQUEUEavg)>4) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);}
+
+echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
+echo "| TOTAL       | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n";
+echo "+-------------+-------+-----------------------------------------+ +------+\n";
+
+$ENDtime = date("U");
+$RUNtime = ($ENDtime - $STARTtime);
+echo "\nRun Time: $RUNtime seconds\n";
+}
+
+
+
+?>
+
+
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_CLOSERstats.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_CLOSERstats.php new file mode 100644 index 00000000..cd897e3d --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_CLOSERstats.php @@ -0,0 +1,1537 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# 60905-1326 - Added queue time stats +# 71008-1436 - Added shift to be defined in dbconnect.php +# 71025-0021 - Added status breakdown +# 71218-1155 - Added end_date for multi-day reports +# 80430-1920 - Added Customer hangup cause stats +# 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 +# 81105-2118 - Added Answered calls 15-minute breakdown +# 81109-2340 - Added custom indicators section +# 90116-1040 - Rewrite of the 15-minute sections to speed it up and allow multi-day calculations +# 90310-2037 - Admin header +# 90508-0644 - Changed to PHP long tags +# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion +# 90801-0921 - Added in-group name to pulldown +# 91214-0955 - Added INITIAL QUEUE POSITION BREAKDOWN +# 100206-1454 - Fixed TMR(service level) calculation +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["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"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +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); + +$MT[0]='0'; +if (strlen($shift)<2) {$shift='ALL';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$gmt_conf_ct = mysql_num_rows($rslt); +$dst = date("I"); +if ($gmt_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + $epoch_offset = (($local_gmt + $dst) * 3600); + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$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); + $LISTgroups[$i] = $row[0]; + $LISTgroup_names[$i] = $row[1]; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$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";} +$statcats_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statcats_to_print) + { + $row=mysql_fetch_row($rslt); + $vsc_id[$i] = $row[0]; + $vsc_name[$i] = $row[1]; + $vsc_count[$i] = 0; + $i++; + } +?> + + + + + +\n"; +echo "\n"; + +echo "\n"; +echo "Inbound Stats\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
"; + +if ($DB > 0) + { + echo "
\n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "
\n"; + echo "$shift|$query_date|$end_date\n"; + echo "
\n"; + } + +echo "
\n"; +echo "\n"; +echo "
\n"; +echo "\n"; +echo "Período:
\n"; +echo ""; + +?> + +"; + +?> + +
\n"; +echo "Grupos de Entrada: \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ALTERAR | "; +echo "RELATÓRIOS | "; +echo "IVR REPORT \n"; +echo "\n"; + +echo "
\n"; + +#echo "\n"; +echo "Shift: \n"; +echo "   \n"; +echo "
\n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if ($groups_to_print < 1)
+{
+echo "\n\n";
+echo "POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+}
+
+else
+{
+if ($shift == 'AM') 
+	{
+	$time_BEGIN=$AM_shift_BEGIN;
+	$time_END=$AM_shift_END;
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+	}
+if ($shift == 'PM') 
+	{
+	$time_BEGIN=$PM_shift_BEGIN;
+	$time_END=$PM_shift_END;
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+	}
+if ($shift == 'ALL') 
+	{
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+	}
+$query_date_BEGIN = "$query_date $time_BEGIN";   
+$query_date_END = "$end_date $time_END";
+
+
+
+echo "Inbound Call Stats: $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 <= 49999 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 "Time range: $query_date_BEGIN to $query_date_END\n\n";
+echo "---------- TOTALS\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 IN($group_SQL);";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+$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 status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$rowy=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 IN($group_SQL) and comment_b='START';";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$rowx=mysql_fetch_row($rslt);
+
+$TOTALcalls =	sprintf("%10s", $row[0]);
+$IVRcalls =	sprintf("%10s", $rowx[0]);
+$TOTALsec =		$row[1];
+if ( ($row[0] < 1) or ($TOTALsec < 1) )
+	{$average_call_seconds = '         0';}
+else
+	{
+	$average_call_seconds = ($TOTALsec / $row[0]);
+	$average_call_seconds = round($average_call_seconds, 0);
+	$average_call_seconds =	sprintf("%10s", $average_call_seconds);
+	}
+$RESPOSTAEDcalls  =	sprintf("%10s", $rowy[0]);
+if ( ($RESPOSTAEDcalls < 1) or ($TOTALcalls < 1) )
+	{$RESPOSTAEDpercent = '0';}
+else
+	{
+	$RESPOSTAEDpercent = (($RESPOSTAEDcalls / $TOTALcalls) * 100);
+	$RESPOSTAEDpercent = round($RESPOSTAEDpercent, 0);
+	}
+if ( ($rowy[0] < 1) or ($RESPOSTAEDcalls < 1) )
+	{$average_answer_seconds = '         0';}
+else
+	{
+	$average_answer_seconds = ($rowy[1] / $rowy[0]);
+	$average_answer_seconds = round($average_answer_seconds, 2);
+	$average_answer_seconds =	sprintf("%10s", $average_answer_seconds);
+	}
+
+
+echo "Total de chamadas recebidas pelo Grupo:        $TOTALcalls\n";
+echo "Average Call Length for all Calls:            $average_call_seconds seconds\n";
+echo "Answered Calls:                               $RESPOSTAEDcalls  $RESPOSTAEDpercent%\n";
+echo "Average queue time for Answered Calls:        $average_answer_seconds seconds\n";
+echo "Calls taken into the IVR for this In-Grupo:   $IVRcalls\n";
+
+
+echo "\n";
+echo "---------- DERRUBADAS\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 IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+$DROPcalls =	sprintf("%10s", $row[0]);
+if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
+	{$DROPpercent = '0';}
+else
+	{
+	$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
+	$DROPpercent = round($DROPpercent, 0);
+	}
+
+if ( ($row[0] < 1) or ($row[1] < 1) )
+	{
+	$average_hold_seconds = '         0';
+	}
+else
+	{
+	$average_hold_seconds = ($row[1] / $row[0]);
+	$average_hold_seconds = round($average_hold_seconds, 0);
+	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
+	}
+if ( ($RESPOSTAEDcalls < 1) or ($DROPcalls < 1) )
+	{$DROP_RESPOSTAEDpercent = '0';}
+else
+	{
+	$DROP_RESPOSTAEDpercent = (($DROPcalls / $RESPOSTAEDcalls) * 100);
+	$DROP_RESPOSTAEDpercent = round($DROP_RESPOSTAEDpercent, 0);
+	}
+
+echo "Total de chamadas derrubadas:                 $DROPcalls  $DROPpercent%               drop/answered: $DROP_RESPOSTAEDpercent%\n";
+echo "Average hold time for DROP Calls:             $average_hold_seconds seconds\n";
+
+
+
+
+if (strlen($group_SQL)>3)
+	{
+	$stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$Sanswer_sec_pct_rt_stat_one = $row[0];
+	$Sanswer_sec_pct_rt_stat_two = $row[1];
+
+	$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$answer_sec_pct_rt_stat_one = $row[0];
+
+	$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$answer_sec_pct_rt_stat_two = $row[0];
+
+	if ( ($RESPOSTAEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) )
+		{
+		$PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $RESPOSTAEDcalls) * 100);
+		$PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0);
+		#$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one);
+		$PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $RESPOSTAEDcalls) * 100);
+		$PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0);
+		#$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two);
+		}
+	}
+echo "\n";
+echo "---------- CUSTOM INDICATORS\n";
+echo "GDE (Answered/Chamadas totais atendidas in to this In-Group):  $RESPOSTAEDpercent%\n";
+echo "ACR (Dropped/Answered):                                $DROP_RESPOSTAEDpercent%\n";
+echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):            $PCTanswer_sec_pct_rt_stat_one%\n";
+echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):            $PCTanswer_sec_pct_rt_stat_two%\n";
+
+
+# GET LIST OF ALL STATUSES and create SQL from human_answered statuses
+$q=0;
+$stmt = "SELECT status,status_name,human_answered,category from vicidial_statuses;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$statuses_to_print = mysql_num_rows($rslt);
+$p=0;
+while ($p < $statuses_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$status[$q] =			$row[0];
+	$status_name[$q] =		$row[1];
+	$human_answered[$q] =	$row[2];
+	$category[$q] =			$row[3];
+	$statname_list["$status[$q]"] = "$status_name[$q]";
+	$statcat_list["$status[$q]"] = "$category[$q]";
+	$q++;
+	$p++;
+	}
+$stmt = "SELECT status,status_name,human_answered,category from vicidial_campaign_statuses;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$statuses_to_print = mysql_num_rows($rslt);
+$p=0;
+while ($p < $statuses_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$status[$q] =			$row[0];
+	$status_name[$q] =		$row[1];
+	$human_answered[$q] =	$row[2];
+	$category[$q] =			$row[3];
+	$statname_list["$status[$q]"] = "$status_name[$q]";
+	$statcat_list["$status[$q]"] = "$category[$q]";
+	$q++;
+	$p++;
+	}
+
+##############################
+#########  CALL QUEUE STATS
+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 IN($group_SQL) and (queue_seconds > 0);";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+$QUEUEcalls =	sprintf("%10s", $row[0]);
+if ( ($QUEUEcalls < 1) or ($TOTALcalls < 1) )
+	{$QUEUEpercent = '0';}
+else
+	{
+	$QUEUEpercent = (($QUEUEcalls / $TOTALcalls) * 100);
+	$QUEUEpercent = round($QUEUEpercent, 0);
+	}
+
+if ( ($row[0] < 1) or ($row[1] < 1) )
+	{$average_queue_seconds = '         0';}
+else
+	{
+	$average_queue_seconds = ($row[1] / $row[0]);
+	$average_queue_seconds = round($average_queue_seconds, 2);
+	$average_queue_seconds = sprintf("%10.2f", $average_queue_seconds);
+	}
+
+if ( ($TOTALcalls < 1) or ($row[1] < 1) )
+	{$average_total_queue_seconds = '         0';}
+else
+	{
+	$average_total_queue_seconds = ($row[1] / $TOTALcalls);
+	$average_total_queue_seconds = round($average_total_queue_seconds, 2);
+	$average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds);
+	}
+
+echo "Total Calls That entered Queue:               $QUEUEcalls  $QUEUEpercent%\n";
+echo "Average QUEUE Length for queue calls:         $average_queue_seconds seconds\n";
+echo "Average QUEUE Length across all calls:        $average_total_queue_seconds seconds\n";
+
+
+
+##############################
+#########  CALL HOLD TIME BREAKDOWN IN SECONDS
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- TEMPO DE ESPERA POR SEGUNDOS\n";
+echo "+-------------------------------------------------------------------------------------------+------------+\n";
+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 IN($group_SQL) group by queue_seconds;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$reasons_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $reasons_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+
+	$TOTALcalls = ($TOTALcalls + $row[0]);
+
+	if ($row[1] == 0) {$hd_0 = ($hd_0 + $row[0]);}
+	if ( ($row[1] > 0) and ($row[1] <= 5) ) {$hd_5 = ($hd_5 + $row[0]);}
+	if ( ($row[1] > 5) and ($row[1] <= 10) ) {$hd10 = ($hd10 + $row[0]);}
+	if ( ($row[1] > 10) and ($row[1] <= 15) ) {$hd15 = ($hd15 + $row[0]);}
+	if ( ($row[1] > 15) and ($row[1] <= 20) ) {$hd20 = ($hd20 + $row[0]);}
+	if ( ($row[1] > 20) and ($row[1] <= 25) ) {$hd25 = ($hd25 + $row[0]);}
+	if ( ($row[1] > 25) and ($row[1] <= 30) ) {$hd30 = ($hd30 + $row[0]);}
+	if ( ($row[1] > 30) and ($row[1] <= 35) ) {$hd35 = ($hd35 + $row[0]);}
+	if ( ($row[1] > 35) and ($row[1] <= 40) ) {$hd40 = ($hd40 + $row[0]);}
+	if ( ($row[1] > 40) and ($row[1] <= 45) ) {$hd45 = ($hd45 + $row[0]);}
+	if ( ($row[1] > 45) and ($row[1] <= 50) ) {$hd50 = ($hd50 + $row[0]);}
+	if ( ($row[1] > 50) and ($row[1] <= 55) ) {$hd55 = ($hd55 + $row[0]);}
+	if ( ($row[1] > 55) and ($row[1] <= 60) ) {$hd60 = ($hd60 + $row[0]);}
+	if ( ($row[1] > 60) and ($row[1] <= 90) ) {$hd90 = ($hd90 + $row[0]);}
+	if ($row[1] > 90) {$hd99 = ($hd99 + $row[0]);}
+	$i++;
+	}
+
+$hd_0 =	sprintf("%5s", $hd_0);
+$hd_5 =	sprintf("%5s", $hd_5);
+$hd10 =	sprintf("%5s", $hd10);
+$hd15 =	sprintf("%5s", $hd15);
+$hd20 =	sprintf("%5s", $hd20);
+$hd25 =	sprintf("%5s", $hd25);
+$hd30 =	sprintf("%5s", $hd30);
+$hd35 =	sprintf("%5s", $hd35);
+$hd40 =	sprintf("%5s", $hd40);
+$hd45 =	sprintf("%5s", $hd45);
+$hd50 =	sprintf("%5s", $hd50);
+$hd55 =	sprintf("%5s", $hd55);
+$hd60 =	sprintf("%5s", $hd60);
+$hd90 =	sprintf("%5s", $hd90);
+$hd99 =	sprintf("%5s", $hd99);
+
+$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+
+echo "| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n";
+echo "+-------------------------------------------------------------------------------------------+------------+\n";
+
+
+
+##############################
+#########  CALL DROP TIME BREAKDOWN IN SECONDS
+
+$BDdropCALLS = 0;
+
+echo "\n";
+echo "---------- CALL DROP TIME BREAKDOWN IN SECONDS\n";
+echo "+-------------------------------------------------------------------------------------------+------------+\n";
+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 IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$reasons_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $reasons_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+
+	$BDdropCALLS = ($BDdropCALLS + $row[0]);
+
+	if ($row[1] == 0) {$dd_0 = ($dd_0 + $row[0]);}
+	if ( ($row[1] > 0) and ($row[1] <= 5) ) {$dd_5 = ($dd_5 + $row[0]);}
+	if ( ($row[1] > 5) and ($row[1] <= 10) ) {$dd10 = ($dd10 + $row[0]);}
+	if ( ($row[1] > 10) and ($row[1] <= 15) ) {$dd15 = ($dd15 + $row[0]);}
+	if ( ($row[1] > 15) and ($row[1] <= 20) ) {$dd20 = ($dd20 + $row[0]);}
+	if ( ($row[1] > 20) and ($row[1] <= 25) ) {$dd25 = ($dd25 + $row[0]);}
+	if ( ($row[1] > 25) and ($row[1] <= 30) ) {$dd30 = ($dd30 + $row[0]);}
+	if ( ($row[1] > 30) and ($row[1] <= 35) ) {$dd35 = ($dd35 + $row[0]);}
+	if ( ($row[1] > 35) and ($row[1] <= 40) ) {$dd40 = ($dd40 + $row[0]);}
+	if ( ($row[1] > 40) and ($row[1] <= 45) ) {$dd45 = ($dd45 + $row[0]);}
+	if ( ($row[1] > 45) and ($row[1] <= 50) ) {$dd50 = ($dd50 + $row[0]);}
+	if ( ($row[1] > 50) and ($row[1] <= 55) ) {$dd55 = ($dd55 + $row[0]);}
+	if ( ($row[1] > 55) and ($row[1] <= 60) ) {$dd60 = ($dd60 + $row[0]);}
+	if ( ($row[1] > 60) and ($row[1] <= 90) ) {$dd90 = ($dd90 + $row[0]);}
+	if ($row[1] > 90) {$dd99 = ($dd99 + $row[0]);}
+	$i++;
+	}
+
+$dd_0 =	sprintf("%5s", $dd_0);
+$dd_5 =	sprintf("%5s", $dd_5);
+$dd10 =	sprintf("%5s", $dd10);
+$dd15 =	sprintf("%5s", $dd15);
+$dd20 =	sprintf("%5s", $dd20);
+$dd25 =	sprintf("%5s", $dd25);
+$dd30 =	sprintf("%5s", $dd30);
+$dd35 =	sprintf("%5s", $dd35);
+$dd40 =	sprintf("%5s", $dd40);
+$dd45 =	sprintf("%5s", $dd45);
+$dd50 =	sprintf("%5s", $dd50);
+$dd55 =	sprintf("%5s", $dd55);
+$dd60 =	sprintf("%5s", $dd60);
+$dd90 =	sprintf("%5s", $dd90);
+$dd99 =	sprintf("%5s", $dd99);
+
+$BDdropCALLS =		sprintf("%10s", $BDdropCALLS);
+
+echo "| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n";
+echo "+-------------------------------------------------------------------------------------------+------------+\n";
+
+
+
+
+##############################
+#########  CALL ANSWERED TIME AND PERCENT BREAKDOWN IN SECONDS
+
+$BDansweredCALLS = 0;
+
+echo "\n";
+echo "           CALL RESPOSTAED TIME AND PERCENT BREAKDOWN IN SECONDS\n";
+echo "          +-------------------------------------------------------------------------------------------+------------+\n";
+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 IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$reasons_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $reasons_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+
+	$BDansweredCALLS = ($BDansweredCALLS + $row[0]);
+	
+	### Get interval totals
+	if ($row[1] == 0) {$ad_0 = ($ad_0 + $row[0]);}
+	if ( ($row[1] > 0) and ($row[1] <= 5) ) {$ad_5 = ($ad_5 + $row[0]);}
+	if ( ($row[1] > 5) and ($row[1] <= 10) ) {$ad10 = ($ad10 + $row[0]);}
+	if ( ($row[1] > 10) and ($row[1] <= 15) ) {$ad15 = ($ad15 + $row[0]);}
+	if ( ($row[1] > 15) and ($row[1] <= 20) ) {$ad20 = ($ad20 + $row[0]);}
+	if ( ($row[1] > 20) and ($row[1] <= 25) ) {$ad25 = ($ad25 + $row[0]);}
+	if ( ($row[1] > 25) and ($row[1] <= 30) ) {$ad30 = ($ad30 + $row[0]);}
+	if ( ($row[1] > 30) and ($row[1] <= 35) ) {$ad35 = ($ad35 + $row[0]);}
+	if ( ($row[1] > 35) and ($row[1] <= 40) ) {$ad40 = ($ad40 + $row[0]);}
+	if ( ($row[1] > 40) and ($row[1] <= 45) ) {$ad45 = ($ad45 + $row[0]);}
+	if ( ($row[1] > 45) and ($row[1] <= 50) ) {$ad50 = ($ad50 + $row[0]);}
+	if ( ($row[1] > 50) and ($row[1] <= 55) ) {$ad55 = ($ad55 + $row[0]);}
+	if ( ($row[1] > 55) and ($row[1] <= 60) ) {$ad60 = ($ad60 + $row[0]);}
+	if ( ($row[1] > 60) and ($row[1] <= 90) ) {$ad90 = ($ad90 + $row[0]);}
+	if ($row[1] > 90) {$ad99 = ($ad99 + $row[0]);}
+	$i++;
+	}
+
+### Calculate cumulative totals
+$Cad_0 =$ad_0;
+$Cad_5 =($Cad_0 + $ad_5);
+$Cad10 =($Cad_5 + $ad10);
+$Cad15 =($Cad10 + $ad15);
+$Cad20 =($Cad15 + $ad20);
+$Cad25 =($Cad20 + $ad25);
+$Cad30 =($Cad25 + $ad30);
+$Cad35 =($Cad30 + $ad35);
+$Cad40 =($Cad35 + $ad40);
+$Cad45 =($Cad40 + $ad45);
+$Cad50 =($Cad45 + $ad50);
+$Cad55 =($Cad50 + $ad55);
+$Cad60 =($Cad55 + $ad60);
+$Cad90 =($Cad60 + $ad90);
+$Cad99 =($Cad90 + $ad99);
+
+### Calculate interval percentages
+$pad_0=0; $pad_5=0; $pad10=0; $pad15=0; $pad20=0; $pad25=0; $pad30=0; $pad35=0; $pad40=0; $pad45=0; $pad50=0; $pad55=0; $pad60=0; $pad90=0; $pad99=0; 
+$pCad_0=0; $pCad_5=0; $pCad10=0; $pCad15=0; $pCad20=0; $pCad25=0; $pCad30=0; $pCad35=0; $pCad40=0; $pCad45=0; $pCad50=0; $pCad55=0; $pCad60=0; $pCad90=0; $pCad99=0; 
+if ( ($BDansweredCALLS > 0) and ($TOTALcalls > 0) )
+	{
+	if ($ad_0 > 0) {$pad_0 = (($ad_0 / $TOTALcalls) * 100);	$pad_0 = round($pad_0, 0);}
+	if ($ad_5 > 0) {$pad_5 = (($ad_5 / $TOTALcalls) * 100);	$pad_5 = round($pad_5, 0);}
+	if ($ad10 > 0) {$pad10 = (($ad10 / $TOTALcalls) * 100);	$pad10 = round($pad10, 0);}
+	if ($ad15 > 0) {$pad15 = (($ad15 / $TOTALcalls) * 100);	$pad15 = round($pad15, 0);}
+	if ($ad20 > 0) {$pad20 = (($ad20 / $TOTALcalls) * 100);	$pad20 = round($pad20, 0);}
+	if ($ad25 > 0) {$pad25 = (($ad25 / $TOTALcalls) * 100);	$pad25 = round($pad25, 0);}
+	if ($ad30 > 0) {$pad30 = (($ad30 / $TOTALcalls) * 100);	$pad30 = round($pad30, 0);}
+	if ($ad35 > 0) {$pad35 = (($ad35 / $TOTALcalls) * 100);	$pad35 = round($pad35, 0);}
+	if ($ad40 > 0) {$pad40 = (($ad40 / $TOTALcalls) * 100);	$pad40 = round($pad40, 0);}
+	if ($ad45 > 0) {$pad45 = (($ad45 / $TOTALcalls) * 100);	$pad45 = round($pad45, 0);}
+	if ($ad50 > 0) {$pad50 = (($ad50 / $TOTALcalls) * 100);	$pad50 = round($pad50, 0);}
+	if ($ad55 > 0) {$pad55 = (($ad55 / $TOTALcalls) * 100);	$pad55 = round($pad55, 0);}
+	if ($ad60 > 0) {$pad60 = (($ad60 / $TOTALcalls) * 100);	$pad60 = round($pad60, 0);}
+	if ($ad90 > 0) {$pad90 = (($ad90 / $TOTALcalls) * 100);	$pad90 = round($pad90, 0);}
+	if ($ad99 > 0) {$pad99 = (($ad99 / $TOTALcalls) * 100);	$pad99 = round($pad99, 0);}
+
+	if ($Cad_0 > 0) {$pCad_0 = (($Cad_0 / $TOTALcalls) * 100);	$pCad_0 = round($pCad_0, 0);}
+	if ($Cad_5 > 0) {$pCad_5 = (($Cad_5 / $TOTALcalls) * 100);	$pCad_5 = round($pCad_5, 0);}
+	if ($Cad10 > 0) {$pCad10 = (($Cad10 / $TOTALcalls) * 100);	$pCad10 = round($pCad10, 0);}
+	if ($Cad15 > 0) {$pCad15 = (($Cad15 / $TOTALcalls) * 100);	$pCad15 = round($pCad15, 0);}
+	if ($Cad20 > 0) {$pCad20 = (($Cad20 / $TOTALcalls) * 100);	$pCad20 = round($pCad20, 0);}
+	if ($Cad25 > 0) {$pCad25 = (($Cad25 / $TOTALcalls) * 100);	$pCad25 = round($pCad25, 0);}
+	if ($Cad30 > 0) {$pCad30 = (($Cad30 / $TOTALcalls) * 100);	$pCad30 = round($pCad30, 0);}
+	if ($Cad35 > 0) {$pCad35 = (($Cad35 / $TOTALcalls) * 100);	$pCad35 = round($pCad35, 0);}
+	if ($Cad40 > 0) {$pCad40 = (($Cad40 / $TOTALcalls) * 100);	$pCad40 = round($pCad40, 0);}
+	if ($Cad45 > 0) {$pCad45 = (($Cad45 / $TOTALcalls) * 100);	$pCad45 = round($pCad45, 0);}
+	if ($Cad50 > 0) {$pCad50 = (($Cad50 / $TOTALcalls) * 100);	$pCad50 = round($pCad50, 0);}
+	if ($Cad55 > 0) {$pCad55 = (($Cad55 / $TOTALcalls) * 100);	$pCad55 = round($pCad55, 0);}
+	if ($Cad60 > 0) {$pCad60 = (($Cad60 / $TOTALcalls) * 100);	$pCad60 = round($pCad60, 0);}
+	if ($Cad90 > 0) {$pCad90 = (($Cad90 / $TOTALcalls) * 100);	$pCad90 = round($pCad90, 0);}
+	if ($Cad99 > 0) {$pCad99 = (($Cad99 / $TOTALcalls) * 100);	$pCad99 = round($pCad99, 0);}
+
+	if ($Cad_0 > 0) {$ApCad_0 = (($Cad_0 / $BDansweredCALLS) * 100);	$ApCad_0 = round($ApCad_0, 0);}
+	if ($Cad_5 > 0) {$ApCad_5 = (($Cad_5 / $BDansweredCALLS) * 100);	$ApCad_5 = round($ApCad_5, 0);}
+	if ($Cad10 > 0) {$ApCad10 = (($Cad10 / $BDansweredCALLS) * 100);	$ApCad10 = round($ApCad10, 0);}
+	if ($Cad15 > 0) {$ApCad15 = (($Cad15 / $BDansweredCALLS) * 100);	$ApCad15 = round($ApCad15, 0);}
+	if ($Cad20 > 0) {$ApCad20 = (($Cad20 / $BDansweredCALLS) * 100);	$ApCad20 = round($ApCad20, 0);}
+	if ($Cad25 > 0) {$ApCad25 = (($Cad25 / $BDansweredCALLS) * 100);	$ApCad25 = round($ApCad25, 0);}
+	if ($Cad30 > 0) {$ApCad30 = (($Cad30 / $BDansweredCALLS) * 100);	$ApCad30 = round($ApCad30, 0);}
+	if ($Cad35 > 0) {$ApCad35 = (($Cad35 / $BDansweredCALLS) * 100);	$ApCad35 = round($ApCad35, 0);}
+	if ($Cad40 > 0) {$ApCad40 = (($Cad40 / $BDansweredCALLS) * 100);	$ApCad40 = round($ApCad40, 0);}
+	if ($Cad45 > 0) {$ApCad45 = (($Cad45 / $BDansweredCALLS) * 100);	$ApCad45 = round($ApCad45, 0);}
+	if ($Cad50 > 0) {$ApCad50 = (($Cad50 / $BDansweredCALLS) * 100);	$ApCad50 = round($ApCad50, 0);}
+	if ($Cad55 > 0) {$ApCad55 = (($Cad55 / $BDansweredCALLS) * 100);	$ApCad55 = round($ApCad55, 0);}
+	if ($Cad60 > 0) {$ApCad60 = (($Cad60 / $BDansweredCALLS) * 100);	$ApCad60 = round($ApCad60, 0);}
+	if ($Cad90 > 0) {$ApCad90 = (($Cad90 / $BDansweredCALLS) * 100);	$ApCad90 = round($ApCad90, 0);}
+	if ($Cad99 > 0) {$ApCad99 = (($Cad99 / $BDansweredCALLS) * 100);	$ApCad99 = round($ApCad99, 0);}
+	}
+
+### Format variables
+$ad_0 = sprintf("%5s", $ad_0);
+$ad_5 = sprintf("%5s", $ad_5);
+$ad10 = sprintf("%5s", $ad10);
+$ad15 = sprintf("%5s", $ad15);
+$ad20 = sprintf("%5s", $ad20);
+$ad25 = sprintf("%5s", $ad25);
+$ad30 = sprintf("%5s", $ad30);
+$ad35 = sprintf("%5s", $ad35);
+$ad40 = sprintf("%5s", $ad40);
+$ad45 = sprintf("%5s", $ad45);
+$ad50 = sprintf("%5s", $ad50);
+$ad55 = sprintf("%5s", $ad55);
+$ad60 = sprintf("%5s", $ad60);
+$ad90 = sprintf("%5s", $ad90);
+$ad99 = sprintf("%5s", $ad99);
+$Cad_0 = sprintf("%5s", $Cad_0);
+$Cad_5 = sprintf("%5s", $Cad_5);
+$Cad10 = sprintf("%5s", $Cad10);
+$Cad15 = sprintf("%5s", $Cad15);
+$Cad20 = sprintf("%5s", $Cad20);
+$Cad25 = sprintf("%5s", $Cad25);
+$Cad30 = sprintf("%5s", $Cad30);
+$Cad35 = sprintf("%5s", $Cad35);
+$Cad40 = sprintf("%5s", $Cad40);
+$Cad45 = sprintf("%5s", $Cad45);
+$Cad50 = sprintf("%5s", $Cad50);
+$Cad55 = sprintf("%5s", $Cad55);
+$Cad60 = sprintf("%5s", $Cad60);
+$Cad90 = sprintf("%5s", $Cad90);
+$Cad99 = sprintf("%5s", $Cad99);
+$pad_0 = sprintf("%4s", $pad_0) . '%';
+$pad_5 = sprintf("%4s", $pad_5) . '%';
+$pad10 = sprintf("%4s", $pad10) . '%';
+$pad15 = sprintf("%4s", $pad15) . '%';
+$pad20 = sprintf("%4s", $pad20) . '%';
+$pad25 = sprintf("%4s", $pad25) . '%';
+$pad30 = sprintf("%4s", $pad30) . '%';
+$pad35 = sprintf("%4s", $pad35) . '%';
+$pad40 = sprintf("%4s", $pad40) . '%';
+$pad45 = sprintf("%4s", $pad45) . '%';
+$pad50 = sprintf("%4s", $pad50) . '%';
+$pad55 = sprintf("%4s", $pad55) . '%';
+$pad60 = sprintf("%4s", $pad60) . '%';
+$pad90 = sprintf("%4s", $pad90) . '%';
+$pad99 = sprintf("%4s", $pad99) . '%';
+$pCad_0 = sprintf("%4s", $pCad_0) . '%';
+$pCad_5 = sprintf("%4s", $pCad_5) . '%';
+$pCad10 = sprintf("%4s", $pCad10) . '%';
+$pCad15 = sprintf("%4s", $pCad15) . '%';
+$pCad20 = sprintf("%4s", $pCad20) . '%';
+$pCad25 = sprintf("%4s", $pCad25) . '%';
+$pCad30 = sprintf("%4s", $pCad30) . '%';
+$pCad35 = sprintf("%4s", $pCad35) . '%';
+$pCad40 = sprintf("%4s", $pCad40) . '%';
+$pCad45 = sprintf("%4s", $pCad45) . '%';
+$pCad50 = sprintf("%4s", $pCad50) . '%';
+$pCad55 = sprintf("%4s", $pCad55) . '%';
+$pCad60 = sprintf("%4s", $pCad60) . '%';
+$pCad90 = sprintf("%4s", $pCad90) . '%';
+$pCad99 = sprintf("%4s", $pCad99) . '%';
+$ApCad_0 = sprintf("%4s", $ApCad_0) . '%';
+$ApCad_5 = sprintf("%4s", $ApCad_5) . '%';
+$ApCad10 = sprintf("%4s", $ApCad10) . '%';
+$ApCad15 = sprintf("%4s", $ApCad15) . '%';
+$ApCad20 = sprintf("%4s", $ApCad20) . '%';
+$ApCad25 = sprintf("%4s", $ApCad25) . '%';
+$ApCad30 = sprintf("%4s", $ApCad30) . '%';
+$ApCad35 = sprintf("%4s", $ApCad35) . '%';
+$ApCad40 = sprintf("%4s", $ApCad40) . '%';
+$ApCad45 = sprintf("%4s", $ApCad45) . '%';
+$ApCad50 = sprintf("%4s", $ApCad50) . '%';
+$ApCad55 = sprintf("%4s", $ApCad55) . '%';
+$ApCad60 = sprintf("%4s", $ApCad60) . '%';
+$ApCad90 = sprintf("%4s", $ApCad90) . '%';
+$ApCad99 = sprintf("%4s", $ApCad99) . '%';
+
+$BDansweredCALLS =		sprintf("%10s", $BDansweredCALLS);
+
+### Format and output
+$answeredTOTALs = "$ad_0 $ad_5 $ad10 $ad15 $ad20 $ad25 $ad30 $ad35 $ad40 $ad45 $ad50 $ad55 $ad60 $ad90 $ad99 | $BDansweredCALLS |";
+$answeredCUMULATIVE = "$Cad_0 $Cad_5 $Cad10 $Cad15 $Cad20 $Cad25 $Cad30 $Cad35 $Cad40 $Cad45 $Cad50 $Cad55 $Cad60 $Cad90 $Cad99 | $BDansweredCALLS |";
+$answeredINT_PERCENT = "$pad_0 $pad_5 $pad10 $pad15 $pad20 $pad25 $pad30 $pad35 $pad40 $pad45 $pad50 $pad55 $pad60 $pad90 $pad99 |            |";
+$answeredCUM_PERCENT = "$pCad_0 $pCad_5 $pCad10 $pCad15 $pCad20 $pCad25 $pCad30 $pCad35 $pCad40 $pCad45 $pCad50 $pCad55 $pCad60 $pCad90 $pCad99 |            |";
+$answeredCUM_ANS_PERCENT = "$ApCad_0 $ApCad_5 $ApCad10 $ApCad15 $ApCad20 $ApCad25 $ApCad30 $ApCad35 $ApCad40 $ApCad45 $ApCad50 $ApCad55 $ApCad60 $ApCad90 $ApCad99 |            |";
+echo "INTERVAL  | $answeredTOTALs\n";
+echo "INT %     | $answeredINT_PERCENT\n";
+echo "CUMULATIVE| $answeredCUMULATIVE\n";
+echo "CUM %     | $answeredCUM_PERCENT\n";
+echo "CUM ANS % | $answeredCUM_ANS_PERCENT\n";
+echo "----------+-------------------------------------------------------------------------------------------+------------+\n";
+
+
+
+
+
+##############################
+#########  CALL HANGUP REASON STATS
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO\n";
+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 IN($group_SQL) group by term_reason;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$reasons_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $reasons_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+
+	$TOTALcalls = ($TOTALcalls + $row[0]);
+
+	$REASONcount =	sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);}
+	$reason =	sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);}
+#	if (ereg("NONE",$reason)) {$reason = 'NO ANSWER           ';}
+
+	echo "| $reason | $REASONcount |\n";
+
+	$i++;
+	}
+
+$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+
+echo "+----------------------+------------+\n";
+echo "| TOTAL:               | $TOTALcalls |\n";
+echo "+----------------------+------------+\n";
+
+
+
+
+##############################
+#########  CALL STATUS STATS
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- CALL STATUS STATS\n";
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
+echo "| STATUS | DESCRIPTION          | CATEGORIA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
+
+
+## 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 IN($group_SQL) group by status;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$statuses_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $statuses_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+
+	$STATUScount =	$row[0];
+	$RAWstatus =	$row[1];
+	$r=0;  $foundstat=0;
+	while ($r < $statcats_to_print)
+		{
+		if ( ($statcat_list[$RAWstatus] == "$vsc_id[$r]") and ($foundstat < 1) )
+			{
+			$vsc_count[$r] = ($vsc_count[$r] + $STATUScount);
+			}
+		$r++;
+		}
+
+	$TOTALcalls =	($TOTALcalls + $row[0]);
+	if ( ($STATUScount < 1) or ($TOTALsec < 1) )
+		{$STATUSrate = 0;}
+	else
+		{$STATUSrate =	($STATUScount / ($TOTALsec / 3600) );}
+	$STATUSrate =	sprintf("%.2f", $STATUSrate);
+
+	$STATUShours =		sec_convert($row[2],'H'); 
+	$STATUSavg_sec =	($row[2] / $STATUScount); 
+	$STATUSavg =		sec_convert($STATUSavg_sec,'H'); 
+
+	$STATUScount =	sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
+	$status =	sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);}
+	$STATUShours =	sprintf("%10s", $STATUShours);while(strlen($STATUShours)>10) {$STATUShours = substr("$STATUShours", 0, -1);}
+	$STATUSavg =	sprintf("%8s", $STATUSavg);while(strlen($STATUSavg)>8) {$STATUSavg = substr("$STATUSavg", 0, -1);}
+	$STATUSrate =	sprintf("%8s", $STATUSrate);while(strlen($STATUSrate)>8) {$STATUSrate = substr("$STATUSrate", 0, -1);}
+
+	if ($non_latin < 1)
+		{
+		$status_name =	sprintf("%-20s", $statname_list[$RAWstatus]); 
+		while(strlen($status_name)>20) {$status_name = substr("$status_name", 0, -1);}	
+		$statcat =	sprintf("%-20s", $statcat_list[$RAWstatus]); 
+		while(strlen($statcat)>20) {$statcat = substr("$statcat", 0, -1);}	
+		}
+	else
+		{
+		$status_name =	sprintf("%-60s", $statname_list[$RAWstatus]); 
+		while(mb_strlen($status_name,'utf-8')>20) {$status_name = mb_substr("$status_name", 0, -1,'utf-8');}	
+		$statcat =	sprintf("%-60s", $statcat_list[$RAWstatus]); 
+		while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');}	
+		}
+
+
+	echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n";
+
+	$i++;
+	}
+
+if ($TOTALcalls < 1)
+	{
+	$TOTALhours =	'0:00:00';
+	$TOTALavg =		'0:00:00';
+	$TOTALrate =	'0.00';
+	}
+else
+	{
+	if ( ($TOTALcalls < 1) or ($TOTALsec < 1) )
+		{$TOTALrate = 0;}
+	else
+		{$TOTALrate =	($TOTALcalls / ($TOTALsec / 3600) );}
+	$TOTALrate =	sprintf("%.2f", $TOTALrate);
+
+	$TOTALhours =		sec_convert($TOTALsec,'H'); 
+	$TOTALavg_sec =		($TOTALsec / $TOTALcalls);
+	$TOTALavg =			sec_convert($TOTALavg_sec,'H'); 
+	}
+$TOTALcalls =	sprintf("%10s", $TOTALcalls);
+$TOTALhours =	sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTALhours = substr("$TOTALhours", 0, -1);}
+$TOTALavg =	sprintf("%8s", $TOTALavg);while(strlen($TOTALavg)>8) {$TOTALavg = substr("$TOTALavg", 0, -1);}
+$TOTALrate =	sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);}
+
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
+echo "| TOTAL:                                               | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n";
+echo "+------------------------------------------------------+------------+------------+----------+----------+\n";
+
+
+##############################
+#########  STATUS CATEGORY STATS
+
+echo "\n";
+echo "---------- CUSTOM STATUS CATEGORIA STATS\n";
+echo "+----------------------+------------+--------------------------------+\n";
+echo "| CATEGORIA             | CALLS      | DESCRIPTION                    |\n";
+echo "+----------------------+------------+--------------------------------+\n";
+
+$TOTCATcalls=0;
+$r=0;
+while ($r < $statcats_to_print)
+	{
+	if ($vsc_id[$r] != 'UNDEFINED')
+		{
+		$TOTCATcalls = ($TOTCATcalls + $vsc_count[$r]);
+		$category =	sprintf("%-20s", $vsc_id[$r]); while(strlen($category)>20) {$category = substr("$category", 0, -1);}
+		$CATcount =	sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);}
+		$CATname =	sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);}
+
+		echo "| $category | $CATcount | $CATname |\n";
+		}
+
+	$r++;
+	}
+
+$TOTCATcalls =	sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);}
+
+echo "+----------------------+------------+--------------------------------+\n";
+echo "| TOTAL                | $TOTCATcalls |\n";
+echo "+----------------------+------------+\n";
+
+
+##############################
+#########  CALL INITIAL QUEUE POSITION BREAKDOWN
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- CALL INITIAL QUEUE POSITION BREAKDOWN\n";
+echo "+-------------------------------------------------------------------------------------+------------+\n";
+echo "|     1     2     3     4     5     6     7     8     9    10    15    20    25   +25 | TOTAL      |\n";
+echo "+-------------------------------------------------------------------------------------+------------+\n";
+
+$stmt="select count(*),queue_position 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_position;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$positions_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $positions_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+
+	$TOTALcalls = ($TOTALcalls + $row[0]);
+
+	if ( ($row[1] > 0) and ($row[1] <= 1) ) {$qp_1 = ($qp_1 + $row[0]);}
+	if ( ($row[1] > 1) and ($row[1] <= 2) ) {$qp_2 = ($qp_2 + $row[0]);}
+	if ( ($row[1] > 2) and ($row[1] <= 3) ) {$qp_3 = ($qp_3 + $row[0]);}
+	if ( ($row[1] > 3) and ($row[1] <= 4) ) {$qp_4 = ($qp_4 + $row[0]);}
+	if ( ($row[1] > 4) and ($row[1] <= 5) ) {$qp_5 = ($qp_5 + $row[0]);}
+	if ( ($row[1] > 5) and ($row[1] <= 6) ) {$qp_6 = ($qp_6 + $row[0]);}
+	if ( ($row[1] > 6) and ($row[1] <= 7) ) {$qp_7 = ($qp_7 + $row[0]);}
+	if ( ($row[1] > 7) and ($row[1] <= 8) ) {$qp_8 = ($qp_8 + $row[0]);}
+	if ( ($row[1] > 8) and ($row[1] <= 9) ) {$qp_9 = ($qp_9 + $row[0]);}
+	if ( ($row[1] > 9) and ($row[1] <= 10) ) {$qp10 = ($qp10 + $row[0]);}
+	if ( ($row[1] > 10) and ($row[1] <= 15) ) {$qp15 = ($qp15 + $row[0]);}
+	if ( ($row[1] > 15) and ($row[1] <= 20) ) {$qp20 = ($qp20 + $row[0]);}
+	if ( ($row[1] > 20) and ($row[1] <= 25) ) {$qp25 = ($qp25 + $row[0]);}
+	if ($row[1] > 25) {$qp99 = ($qp99 + $row[0]);}
+	$i++;
+	}
+
+$qp_1 =	sprintf("%5s", $qp_1);
+$qp_2 =	sprintf("%5s", $qp_2);
+$qp_3=	sprintf("%5s", $qp_3);
+$qp_4 =	sprintf("%5s", $qp_4);
+$qp_5 =	sprintf("%5s", $qp_5);
+$qp_6 =	sprintf("%5s", $qp_6);
+$qp_7 =	sprintf("%5s", $qp_7);
+$qp_8 =	sprintf("%5s", $qp_8);
+$qp_9 =	sprintf("%5s", $qp_9);
+$qp10 =	sprintf("%5s", $qp10);
+$qp15 =	sprintf("%5s", $qp15);
+$qp20 =	sprintf("%5s", $qp20);
+$qp25 =	sprintf("%5s", $qp25);
+$qp99 =	sprintf("%5s", $qp99);
+
+$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+
+echo "| $qp_1 $qp_2 $qp_3 $qp_4 $qp_5 $qp_6 $qp_7 $qp_8 $qp_9 $qp10 $qp15 $qp20 $qp25 $qp99 | $TOTALcalls |\n";
+echo "+-------------------------------------------------------------------------------------+------------+\n";
+
+
+
+##############################
+#########  USER STATS
+
+$TOTagents=0;
+$TOTcalls=0;
+$TOTtime=0;
+$TOTavg=0;
+
+echo "\n";
+echo "---------- AGENTE STATS\n";
+echo "+--------------------------+------------+------------+--------+\n";
+echo "| AGENTE                    | CALLS      | TIME H:M:S |AVERAGE |\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 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);
+$i=0;
+while ($i < $users_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+
+	$TOTcalls = ($TOTcalls + $row[2]);
+	$TOTtime = ($TOTtime + $row[3]);
+
+	$user =			sprintf("%-6s", $row[0]);
+	if ($non_latin < 1)
+		{
+		$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}	
+		}
+	else
+		{
+		$full_name =	sprintf("%-45s", $row[1]); while(mb_strlen($full_name,'utf-8')>15) {$full_name = mb_substr("$full_name", 0, -1,'utf-8');}	
+		}
+	$USERcalls =	sprintf("%10s", $row[2]);
+	$USERtotTALK =	$row[3];
+	$USERavgTALK =	$row[4];
+
+	$USERtotTALK_MS =	sec_convert($USERtotTALK,'H'); 
+	$USERavgTALK_MS =	sec_convert($USERavgTALK,'H'); 
+
+	$USERtotTALK_MS =	sprintf("%9s", $USERtotTALK_MS);
+	$USERavgTALK_MS =	sprintf("%6s", $USERavgTALK_MS);
+
+	echo "| $user - $full_name | $USERcalls |  $USERtotTALK_MS | $USERavgTALK_MS |\n";
+
+	$i++;
+	}
+
+if ($TOTcalls < 1) {$TOTcalls = 0; $TOTavg=0;}
+else
+	{
+	$TOTavg = ($TOTtime / $TOTcalls);
+	$TOTavg_MS =	sec_convert($TOTavg,'H'); 
+	$TOTavg =		sprintf("%6s", $TOTavg_MS);
+	}
+
+$TOTtime_MS =	sec_convert($TOTtime,'H'); 
+$TOTtime =		sprintf("%10s", $TOTtime_MS);
+
+$TOTagents =		sprintf("%10s", $i);
+$TOTcalls =			sprintf("%10s", $TOTcalls);
+$TOTtime =			sprintf("%8s", $TOTtime);
+$TOTavg =			sprintf("%6s", $TOTavg);
+
+echo "+--------------------------+------------+------------+--------+\n";
+echo "| TOTAL Agentes: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
+echo "+--------------------------+------------+------------+--------+\n";
+
+
+##############################
+#########  TIME STATS
+
+echo "\n";
+echo "---------- ESTATÍSTICAS DE TEMPO\n";
+
+echo "\n";
+
+
+##############################
+#########  15-minute increment breakdowns of total calls and drops, then answered table
+$BDansweredCALLS = 0;
+$stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date 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";}
+$calls_to_print = mysql_num_rows($rslt);
+$j=0;
+while ($j < $calls_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$Cstatus[$j] =	$row[0];
+	$Cqueue[$j] =	$row[1];
+	$Cepoch[$j] =	$row[2];
+	$Cdate[$j] =	$row[3];
+	$Crem[$j] = ( ($Cepoch[$j] + $epoch_offset) % 86400); # find the remainder(Modulus) of seconds since start of the day
+#	echo "|$Cepoch[$j]|$Crem[$j]|$Cdate[$j]|\n";
+	$j++;
+	}
+
+### Loop through all call records and gather stats for total call/drop report and answered report
+$j=0;
+while ($j < $calls_to_print)
+	{
+	$i=0; $sec=0; $sec_end=900;
+	while ($i <= 96)
+		{
+		if ( ($Crem[$j] >= $sec) and ($Crem[$j] < $sec_end) ) 
+			{
+			$Ftotal[$i]++;
+			if (ereg("DROP",$Cstatus[$j])) {$Fdrop[$i]++;}
+			if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND",$Cstatus[$j]))
+				{
+				$BDansweredCALLS++;
+				$Fanswer[$i]++;
+
+				if ($Cqueue[$j] == 0)								{$adB_0[$i]++;}
+				if ( ($Cqueue[$j] > 0) and ($Cqueue[$j] <= 5) )		{$adB_5[$i]++;}
+				if ( ($Cqueue[$j] > 5) and ($Cqueue[$j] <= 10) )	{$adB10[$i]++;}
+				if ( ($Cqueue[$j] > 10) and ($Cqueue[$j] <= 15) )	{$adB15[$i]++;}
+				if ( ($Cqueue[$j] > 15) and ($Cqueue[$j] <= 20) )	{$adB20[$i]++;}
+				if ( ($Cqueue[$j] > 20) and ($Cqueue[$j] <= 25) )	{$adB25[$i]++;}
+				if ( ($Cqueue[$j] > 25) and ($Cqueue[$j] <= 30) )	{$adB30[$i]++;}
+				if ( ($Cqueue[$j] > 30) and ($Cqueue[$j] <= 35) )	{$adB35[$i]++;}
+				if ( ($Cqueue[$j] > 35) and ($Cqueue[$j] <= 40) )	{$adB40[$i]++;}
+				if ( ($Cqueue[$j] > 40) and ($Cqueue[$j] <= 45) )	{$adB45[$i]++;}
+				if ( ($Cqueue[$j] > 45) and ($Cqueue[$j] <= 50) )	{$adB50[$i]++;}
+				if ( ($Cqueue[$j] > 50) and ($Cqueue[$j] <= 55) )	{$adB55[$i]++;}
+				if ( ($Cqueue[$j] > 55) and ($Cqueue[$j] <= 60) )	{$adB60[$i]++;}
+				if ( ($Cqueue[$j] > 60) and ($Cqueue[$j] <= 90) )	{$adB90[$i]++;}
+				if ($Cqueue[$j] > 90)								{$adB99[$i]++;}
+				}
+
+			}
+		$sec = ($sec + 900);
+		$sec_end = ($sec_end + 900);
+		$i++;
+		}
+	$j++;
+	}	##### END going through all records
+
+
+
+
+
+
+
+##### 15-minute total and drops graph
+$hi_hour_count=0;
+$last_full_record=0;
+$i=0;
+$h=0;
+while ($i <= 96)
+	{
+	$hour_count[$i] = $Ftotal[$i];
+	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
+	if ($hour_count[$i] > 0) {$last_full_record = $i;}
+	$drop_count[$i] = $Fdrop[$i];
+	$i++;
+	}
+
+if ($hi_hour_count < 1)
+	{$hour_multiplier = 0;}
+else
+	{
+	$hour_multiplier = (100 / $hi_hour_count);
+	#$hour_multiplier = round($hour_multiplier, 0);
+	}
+
+echo "\n";
+echo "GRÁFICO TOTAL DE CHAMADAS A CADA 15 MINUTOS TAKEN INTO THIS IN-GROUP\n";
+
+$k=1;
+$Mk=0;
+$call_scale = '0';
+while ($k <= 102) 
+	{
+	if ($Mk >= 5) 
+		{
+		$Mk=0;
+		if ( ($k < 1) or ($hour_multiplier <= 0) )
+			{$scale_num = 100;}
+		else
+			{
+			$scale_num=($k / $hour_multiplier);
+			$scale_num = round($scale_num, 0);
+			}
+		$LENscale_num = (strlen($scale_num));
+		$k = ($k + $LENscale_num);
+		$call_scale .= "$scale_num";
+		}
+	else
+		{
+		$call_scale .= " ";
+		$k++;   $Mk++;
+		}
+	}
+
+
+echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
+#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
+echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
+echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
+
+$ZZ = '00';
+$i=0;
+$h=4;
+$hour= -1;
+$no_lines_yet=1;
+
+while ($i <= 96)
+	{
+	$char_counter=0;
+	$time = '      ';
+	if ($h >= 4) 
+		{
+		$hour++;
+		$h=0;
+		if ($hour < 10) {$hour = "0$hour";}
+		$time = "+$hour$ZZ+";
+		}
+	if ($h == 1) {$time = "   15 ";}
+	if ($h == 2) {$time = "   30 ";}
+	if ($h == 3) {$time = "   45 ";}
+	$Ghour_count = $hour_count[$i];
+	if ($Ghour_count < 1) 
+		{
+		if ( ($no_lines_yet) or ($i > $last_full_record) )
+			{
+			$do_nothing=1;
+			}
+		else
+			{
+			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
+			echo "|$time|";
+			$k=0;   while ($k <= 102) {echo " ";   $k++;}
+			echo "| $hour_count[$i] |\n";
+			}
+		}
+	else
+		{
+		$no_lines_yet=0;
+		$Xhour_count = ($Ghour_count * $hour_multiplier);
+		$Yhour_count = (99 - $Xhour_count);
+
+		$Gdrop_count = $drop_count[$i];
+		if ($Gdrop_count < 1) 
+			{
+			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
+
+			echo "|$time|";
+			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
+			echo "*X";   $char_counter++;
+			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
+				while ($char_counter <= 101) {echo " ";   $char_counter++;}
+			echo "| 0     | $hour_count[$i] |\n";
+
+			}
+		else
+			{
+			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
+
+		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
+
+			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
+
+			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
+			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
+
+			echo "|$time|";
+			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
+			echo "D";   $char_counter++;
+			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
+			echo "X";   $char_counter++;
+			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
+				while ($char_counter <= 102) {echo " ";   $char_counter++;}
+			echo "| $drop_count[$i] | $hour_count[$i] |\n";
+			}
+		}
+	
+	
+	$i++;
+	$h++;
+	}
+
+echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n";
+
+
+
+
+
+
+##### Answered wait time breakdown
+echo "\n";
+echo "---------- CALL RESPOSTAED TIME BREAKDOWN IN SECONDS\n";
+echo "+------+-------------------------------------------------------------------------------------------+------------+\n";
+echo "| HOUR |     0     5    10    15    20    25    30    35    40    45    50    55    60    90   +90 | TOTAL      |\n";
+echo "+------+-------------------------------------------------------------------------------------------+------------+\n";
+
+$ZZ = '00';
+$i=0;
+$h=4;
+$hour= -1;
+$no_lines_yet=1;
+while ($i <= 96)
+	{
+	$char_counter=0;
+	$time = '      ';
+	if ($h >= 4) 
+		{
+		$hour++;
+		$h=0;
+		if ($hour < 10) {$hour = "0$hour";}
+		$time = "+$hour$ZZ+";
+		$SQLtime = "$hour:$ZZ:00";
+		$SQLtimeEND = "$hour:15:00";
+		}
+	if ($h == 1) {$time = "   15 ";   $SQLtime = "$hour:15:00";   $SQLtimeEND = "$hour:30:00";}
+	if ($h == 2) {$time = "   30 ";   $SQLtime = "$hour:30:00";   $SQLtimeEND = "$hour:45:00";}
+	if ($h == 3) 
+		{
+		$time = "   45 ";
+		$SQLtime = "$hour:45:00";
+		$hourEND = ($hour + 1);
+		if ($hourEND < 10) {$hourEND = "0$hourEND";}
+		if ($hourEND > 23) {$SQLtimeEND = "23:59:59";}
+		else {$SQLtimeEND = "$hourEND:00:00";}
+		}
+
+
+	if (strlen($adB_0[$i]) < 1)  {$adB_0[$i]='-';}
+	if (strlen($adB_5[$i]) < 1)  {$adB_5[$i]='-';}
+	if (strlen($adB10[$i]) < 1)  {$adB10[$i]='-';}
+	if (strlen($adB15[$i]) < 1)  {$adB15[$i]='-';}
+	if (strlen($adB20[$i]) < 1)  {$adB20[$i]='-';}
+	if (strlen($adB25[$i]) < 1)  {$adB25[$i]='-';}
+	if (strlen($adB30[$i]) < 1)  {$adB30[$i]='-';}
+	if (strlen($adB35[$i]) < 1)  {$adB35[$i]='-';}
+	if (strlen($adB40[$i]) < 1)  {$adB40[$i]='-';}
+	if (strlen($adB45[$i]) < 1)  {$adB45[$i]='-';}
+	if (strlen($adB50[$i]) < 1)  {$adB50[$i]='-';}
+	if (strlen($adB55[$i]) < 1)  {$adB55[$i]='-';}
+	if (strlen($adB60[$i]) < 1)  {$adB60[$i]='-';}
+	if (strlen($adB90[$i]) < 1)  {$adB90[$i]='-';}
+	if (strlen($adB99[$i]) < 1)  {$adB99[$i]='-';}
+	if (strlen($Fanswer[$i]) < 1)  {$Fanswer[$i]='0';}
+
+	$adB_0[$i] = sprintf("%5s", $adB_0[$i]);
+	$adB_5[$i] = sprintf("%5s", $adB_5[$i]);
+	$adB10[$i] = sprintf("%5s", $adB10[$i]);
+	$adB15[$i] = sprintf("%5s", $adB15[$i]);
+	$adB20[$i] = sprintf("%5s", $adB20[$i]);
+	$adB25[$i] = sprintf("%5s", $adB25[$i]);
+	$adB30[$i] = sprintf("%5s", $adB30[$i]);
+	$adB35[$i] = sprintf("%5s", $adB35[$i]);
+	$adB40[$i] = sprintf("%5s", $adB40[$i]);
+	$adB45[$i] = sprintf("%5s", $adB45[$i]);
+	$adB50[$i] = sprintf("%5s", $adB50[$i]);
+	$adB55[$i] = sprintf("%5s", $adB55[$i]);
+	$adB60[$i] = sprintf("%5s", $adB60[$i]);
+	$adB90[$i] = sprintf("%5s", $adB90[$i]);
+	$adB99[$i] = sprintf("%5s", $adB99[$i]);
+	$Fanswer[$i] = sprintf("%10s", $Fanswer[$i]);
+
+	echo "|$time| $adB_0[$i] $adB_5[$i] $adB10[$i] $adB15[$i] $adB20[$i] $adB25[$i] $adB30[$i] $adB35[$i] $adB40[$i] $adB45[$i] $adB50[$i] $adB55[$i] $adB60[$i] $adB90[$i] $adB99[$i] | $Fanswer[$i] |\n";
+
+	$i++;
+	$h++;
+	}
+
+$BDansweredCALLS =		sprintf("%10s", $BDansweredCALLS);
+
+echo "+------+-------------------------------------------------------------------------------------------+------------+\n";
+echo "|TOTALS|                                                                                           | $BDansweredCALLS |\n";
+echo "+------+-------------------------------------------------------------------------------------------+------------+\n";
+
+
+
+$ENDtime = date("U");
+$RUNtime = ($ENDtime - $STARTtime);
+echo "\nRun Time: $RUNtime seconds\n";
+}
+
+
+
+
+?>
+
+
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_CLOSERsummary_hourly.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_CLOSERsummary_hourly.php new file mode 100644 index 00000000..2c5f60dc --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_CLOSERsummary_hourly.php @@ -0,0 +1,689 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90801-0910 - First build +# 90809-0216 - Added Exclude Outbound Drop Group option +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + +if (isset($_GET["print_calls"])) {$print_calls=$_GET["print_calls"];} + elseif (isset($_POST["print_calls"])) {$print_calls=$_POST["print_calls"];} +if (isset($_GET["exclude_rollover"])) {$exclude_rollover=$_GET["exclude_rollover"];} + elseif (isset($_POST["exclude_rollover"])) {$exclude_rollover=$_POST["exclude_rollover"];} +if (isset($_GET["inbound_rate"])) {$inbound_rate=$_GET["inbound_rate"];} + elseif (isset($_POST["inbound_rate"])) {$inbound_rate=$_POST["inbound_rate"];} +if (isset($_GET["outbound_rate"])) {$outbound_rate=$_GET["outbound_rate"];} + elseif (isset($_POST["outbound_rate"])) {$outbound_rate=$_POST["outbound_rate"];} +if (isset($_GET["bareformat"])) {$bareformat=$_GET["bareformat"];} + elseif (isset($_POST["bareformat"])) {$bareformat=$_POST["bareformat"];} +if (isset($_GET["costformat"])) {$costformat=$_GET["costformat"];} + elseif (isset($_POST["costformat"])) {$costformat=$_POST["costformat"];} +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["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"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +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); + +$MT[0]='0'; +if (strlen($shift)<2) {$shift='ALL';} +if (strlen($exclude_rollover)<2) {$exclude_rollover='NO';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$gmt_conf_ct = mysql_num_rows($rslt); +$dst = date("I"); +if ($gmt_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + $epoch_offset = (($local_gmt + $dst) * 3600); + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$exclude_rolloverSQL=''; +if (eregi("YES",$exclude_rollover)) + {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns)";} +$stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;"; +$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); + $LISTgroups[$i] = $row[0]; + $LISTgroup_names[$i] = $row[1]; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$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";} +$statcats_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statcats_to_print) + { + $row=mysql_fetch_row($rslt); + $vsc_id[$i] = $row[0]; + $vsc_name[$i] = $row[1]; + $vsc_count[$i] = 0; + $i++; + } + +$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$times_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $times_to_print) + { + $row=mysql_fetch_row($rslt); + $call_times[$i] = $row[0]; + $call_time_names[$i] = $row[1]; + $i++; + } + +?> + + + + + +\n"; +echo "\n"; + +echo "\n"; +echo "Inbound Summary Hourly Report\n"; + +if ($bareformat < 1) + { + $short_header=1; + + require("admin_header.php"); + + echo "
"; + + if ($DB > 0) + { + echo "
\n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "
\n"; + echo "$shift|$query_date|$end_date\n"; + echo "
\n"; + } + + echo "
\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Date Range:
\n"; + echo ""; + + ?> + + "; + + ?> + +
  \n"; + echo "\n"; + echo "Inbound Groups:
\n"; + echo "\n"; + echo "
\n"; + echo "           "; + echo "MODIFY | "; + echo "REPORTS"; + echo "

\n"; + echo "   Exclude Outbound Drop Groups:
"; + echo "   \n"; + echo "
                      "; + echo "\n"; + + echo "
\n"; + + echo "Call Time:
\n"; + echo "\n"; + echo "
\n"; + echo "
\n"; + echo "
\n\n"; + + echo "
\n\n";
+	}
+
+if ($groups_to_print < 1)
+	{
+	echo "\n\n";
+	echo "PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
+	}
+
+else
+	{
+	if ($shift == 'ALL') 
+		{
+		$Gct_default_start = "0";
+		$Gct_default_stop = "2400";
+		}
+	else 
+		{
+		$stmt="SELECT call_time_id,call_time_name,call_time_comments,ct_default_start,ct_default_stop,ct_sunday_start,ct_sunday_stop,ct_monday_start,ct_monday_stop,ct_tuesday_start,ct_tuesday_stop,ct_wednesday_start,ct_wednesday_stop,ct_thursday_start,ct_thursday_stop,ct_friday_start,ct_friday_stop,ct_saturday_start,ct_saturday_stop,ct_state_call_times FROM vicidial_call_times where call_time_id='$shift';";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$calltimes_to_print = mysql_num_rows($rslt);
+		if ($calltimes_to_print > 0)
+			{
+			$row=mysql_fetch_row($rslt);
+			$Gct_default_start =	$row[3];
+			$Gct_default_stop =		$row[4];
+			$Gct_sunday_start =		$row[5];
+			$Gct_sunday_stop =		$row[6];
+			$Gct_monday_start =		$row[7];
+			$Gct_monday_stop =		$row[8];
+			$Gct_tuesday_start =	$row[9];
+			$Gct_tuesday_stop =		$row[10];
+			$Gct_wednesday_start =	$row[11];
+			$Gct_wednesday_stop =	$row[12];
+			$Gct_thursday_start =	$row[13];
+			$Gct_thursday_stop =	$row[14];
+			$Gct_friday_start =		$row[15];
+			$Gct_friday_stop =		$row[16];
+			$Gct_saturday_start =	$row[17];
+			$Gct_saturday_stop =	$row[18];
+			}
+		else
+			{
+			$Gct_default_start = "0";
+			$Gct_default_stop = "2400";
+			}
+		}
+	$h=0;
+	while ($h < 24)
+		{
+		$H_test = $h . "00";
+		if ( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) )
+			{
+			$Hcalltime[$h]++;
+			}
+		$h++;
+		}
+
+	$query_date_BEGIN = "$query_date 00:00:00";   
+	$query_date_END = "$end_date 23:59:59";
+
+
+	$MAIN .= "Inbound Summary Hourly Report: $group_string          $NOW_TIME\n";
+
+
+	if ($group_ct > 0)
+		{
+		$MAIN .= "\n";
+		$MAIN .= "---------- MULTI-GROUP BREAKDOWN:\n";
+		$MAIN .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
+		$MAIN .= "|                                          |        |        |           |         | TOTAL     | AVERAGE | MAXIMUM | TOTAL  |\n";
+		$MAIN .= "|                                          | TOTAL  | TOTAL  | TOTAL     | AVERAGE | QUEUE     | QUEUE   | QUEUE   | ABANDON|\n";
+		$MAIN .= "| IN-GROUP                                 | CALLS  | ANSWER | TALK      | TALK    | TIME      | TIME    | TIME    | CALLS  |\n";
+		$MAIN .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
+
+		$i=0;
+		$TOTcalls_count=0;
+		$TOTanswer_count=0;
+		$TOTtalk_sec=0;
+		$TOTtalk_avg=0;
+		$TOTqueue_seconds=0;
+		$TOTqueue_avg=0;
+		$TOTmax_queue_seconds=0;
+		$TOTdrop_count=0;
+		$SUBoutput='';
+
+		while($i < $group_ct)
+			{
+			$stmt="select group_name,agent_alert_delay from vicidial_inbound_groups where group_id='$group[$i]';";
+			$rslt=mysql_query($stmt, $link);
+			if ($DB) {echo "$stmt\n";}
+			$row=mysql_fetch_row($rslt);
+			$group_name[$i] =			$row[0];
+			$agent_alert_delay[$i] =	round($row[1] / 1000);
+
+			$out_of_call_time=0;
+			$length_in_sec[$i]=0;
+			$queue_seconds[$i]=0;
+			$talk_sec[$i]=0;
+			$calls_count[$i]=0;
+			$drop_count[$i]=0;
+			$answer_count[$i]=0;
+			$max_queue_seconds[$i]=0;
+			$Hlength_in_sec=$MT;
+			$Hqueue_seconds=$MT;
+			$Htalk_sec=$MT;
+			$Hcalls_count=$MT;
+			$Hdrop_count=$MT;
+			$Hanswer_count=$MT;
+			$Hmax_queue_seconds=$MT;
+			$hTOTALcalls =	0;
+			$hANSWERcalls =	0;
+			$hSUMtalk =		0;
+			$hAVGtalk =		0;
+			$hSUMqueue =	0;
+			$hAVGqueue =	0;
+			$hMAXqueue =	0;
+			$hDROPcalls =	0;
+			$hPRINT =		0;
+			$hTOTcalls_count =			0;
+			$hTOTanswer_count =			0;
+			$hTOTtalk_sec =				0;
+			$hTOTtalk_avg =				0;
+			$hTOTqueue_seconds =		0;
+			$hTOTqueue_avg =			0;
+			$hTOTmax_queue_seconds =	0;
+			$hTOTdrop_count =			0;
+
+			$stmt = "SELECT status,length_in_sec,queue_seconds,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id 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";}
+			$calls_to_parse = mysql_num_rows($rslt);
+			$p=0;
+			while ($p < $calls_to_parse)
+				{
+				$row=mysql_fetch_row($rslt);
+				$call_date = explode(" ", $row[3]);
+				$call_time = ereg_replace("[^0-9]","",$call_date[1]);
+				$epoch = $row[4];
+				$Cwday = date("w", $epoch);
+
+				$CTstart = $Gct_default_start . "00";
+				$CTstop = $Gct_default_stop . "59";
+
+				if ( ($Cwday == 0) and ( ($Gct_sunday_start > 0) and ($Gct_sunday_stop > 0) ) )
+					{$CTstart = $Gct_sunday_start . "00";   $CTstop = $Gct_sunday_stop . "59";}
+				if ( ($Cwday == 1) and ( ($Gct_monday_start > 0) and ($Gct_monday_stop > 0) ) )
+					{$CTstart = $Gct_monday_start . "00";   $CTstop = $Gct_monday_stop . "59";}
+				if ( ($Cwday == 2) and ( ($Gct_tuesday_start > 0) and ($Gct_tuesday_stop > 0) ) )
+					{$CTstart = $Gct_tuesday_start . "00";   $CTstop = $Gct_tuesday_stop . "59";}
+				if ( ($Cwday == 3) and ( ($Gct_wednesday_start > 0) and ($Gct_wednesday_stop > 0) ) )
+					{$CTstart = $Gct_wednesday_start . "00";   $CTstop = $Gct_wednesday_stop . "59";}
+				if ( ($Cwday == 4) and ( ($Gct_thursday_start > 0) and ($Gct_thursday_stop > 0) ) )
+					{$CTstart = $Gct_thursday_start . "00";   $CTstop = $Gct_thursday_stop . "59";}
+				if ( ($Cwday == 5) and ( ($Gct_friday_start > 0) and ($Gct_friday_stop > 0) ) )
+					{$CTstart = $Gct_friday_start . "00";   $CTstop = $Gct_friday_stop . "59";}
+				if ( ($Cwday == 6) and ( ($Gct_saturday_start > 0) and ($Gct_saturday_stop > 0) ) )
+					{$CTstart = $Gct_saturday_start . "00";   $CTstop = $Gct_saturday_stop . "59";}
+
+				$Chour = date("G", $epoch);
+				if ( ($call_time > $CTstart) and ($call_time < $CTstop) )
+					{
+					$calls_count[$i]++;
+					$length_in_sec[$i] =	($length_in_sec[$i] + $row[1]);
+					$queue_seconds[$i] =	($queue_seconds[$i] + $row[2]);
+					$TEMPtalk = ( ($row[1] - $row[2]) - $agent_alert_delay[$i]);
+					if ($TEMPtalk < 0) {$TEMPtalk = 0;}
+					$talk_sec[$i] =	($talk_sec[$i] + $TEMPtalk);
+					if ($max_queue_seconds[$i] < $row[2])
+						{$max_queue_seconds[$i] = $row[2];}
+					if (eregi("DROP",$row[0]))
+						{$drop_count[$i]++;}
+					else
+						{$answer_count[$i]++;}
+
+					$Hcalls_count[$Chour]++;
+					$Hlength_in_sec[$Chour] =	($Hlength_in_sec[$Chour] + $row[1]);
+					$Hqueue_seconds[$Chour] =	($Hqueue_seconds[$Chour] + $row[2]);
+					$Htalk_sec[$Chour] =	($Htalk_sec[$Chour] + $TEMPtalk);
+					if ($Hmax_queue_seconds[$Chour] < $row[2])
+						{$Hmax_queue_seconds[$Chour] = $row[2];}
+					if (eregi("DROP",$row[0]))
+						{$Hdrop_count[$Chour]++;}
+					else
+						{$Hanswer_count[$Chour]++;}
+					$Hcalltime[$Chour]++;
+
+					if ($print_calls > 0)
+						{
+						echo "$row[5]\t$row[6]\t$TEMPtalk\n";
+						$PCtemptalk = ($PCtemptalk + $TEMPtalk);
+						}
+					$q++;
+					}
+				else
+					{$out_of_call_time++;}
+				if ($DB)
+					{echo "$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";}
+				$p++;
+				}
+			if ( ($answer_count[$i] > 0) and ($talk_sec[$i] > 0) )
+				{$talk_avg[$i] = ($talk_sec[$i] / $answer_count[$i]);}
+			else
+				{$talk_avg[$i] = 0;}
+			if ( ($calls_count[$i] > 0) and ($queue_seconds[$i] > 0) )
+				{$queue_avg[$i] = ($queue_seconds[$i] / $calls_count[$i]);}
+			else
+				{$queue_avg[$i] = 0;}
+
+			if ($print_calls > 0)
+				{
+				$PCtemptalkmin = ($PCtemptalk  / 60);
+				echo "$q\t$PCtemptalk\t$PCtemptalkmin\n";
+				}
+
+			$TOTcalls_count =			($TOTcalls_count + $calls_count[$i]);
+			$TOTanswer_count =			($TOTanswer_count + $answer_count[$i]);
+			$TOTtalk_sec =				($TOTtalk_sec + $talk_sec[$i]);
+			$TOTqueue_seconds =			($TOTqueue_seconds + $queue_seconds[$i]);
+			$TOTdrop_count =			($TOTdrop_count + $drop_count[$i]);
+			if ($max_queue_seconds[$i] > $TOTmax_queue_seconds)
+				{$TOTmax_queue_seconds = $max_queue_seconds[$i];}
+
+			$talk_sec[$i] =				sec_convert($talk_sec[$i],'H'); 
+			$talk_avg[$i] =				sec_convert($talk_avg[$i],'H'); 
+			$queue_seconds[$i] =		sec_convert($queue_seconds[$i],'H'); 
+			$queue_avg[$i] =			sec_convert($queue_avg[$i],'H'); 
+			$max_queue_seconds[$i] =	sec_convert($max_queue_seconds[$i],'H'); 
+
+			$groupDISPLAY =	sprintf("%-40s", "$group[$i] - $group_name[$i]");
+			$gTOTALcalls =	sprintf("%6s", $calls_count[$i]);
+			$gANSWERcalls =	sprintf("%6s", $answer_count[$i]);
+			$gSUMtalk =		sprintf("%9s", $talk_sec[$i]);
+			$gAVGtalk =		sprintf("%7s", $talk_avg[$i]);
+			$gSUMqueue =	sprintf("%9s", $queue_seconds[$i]);
+			$gAVGqueue =	sprintf("%7s", $queue_avg[$i]);
+			$gMAXqueue =	sprintf("%7s", $max_queue_seconds[$i]);
+			$gDROPcalls =	sprintf("%6s", $drop_count[$i]);
+
+			while(strlen($groupDISPLAY)>40) {$groupDISPLAY = substr("$groupDISPLAY", 0, -1);}
+
+			$MAIN .= "| $groupDISPLAY | $gTOTALcalls | $gANSWERcalls | $gSUMtalk | $gAVGtalk | $gSUMqueue | $gAVGqueue | $gMAXqueue | $gDROPcalls |";
+			$MAIN .= "\n";
+
+			### hour by hour sumaries
+			$SUBoutput .= "\n---------- $group[$i] - $group_name[$i]     HOURLY BREAKDOWN:\n";
+			$SUBoutput .= "+------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
+			$SUBoutput .= "|      |        |        |           |         | TOTAL     | AVERAGE | MAXIMUM | TOTAL  |\n";
+			$SUBoutput .= "|      | TOTAL  | TOTAL  | TOTAL     | AVERAGE | QUEUE     | QUEUE   | QUEUE   | ABANDON|\n";
+			$SUBoutput .= "| HOUR | CALLS  | ANSWER | TALK      | TALK    | TIME      | TIME    | TIME    | CALLS  |\n";
+			$SUBoutput .= "+------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
+
+			$h=0;
+			while ($h < 24)
+				{
+				if ($Hcalltime[$h] > 0)
+					{
+					if (strlen($Hcalls_count[$h]) < 1)			{$Hcalls_count[$h] = 0;}
+					if (strlen($Hanswer_count[$h]) < 1)			{$Hanswer_count[$h] = 0;}
+					if (strlen($Htalk_sec[$h]) < 1)				{$Htalk_sec[$h] = 0;}
+					if (strlen($Hqueue_seconds[$h]) < 1)		{$Hqueue_seconds[$h] = 0;}
+					if (strlen($Hmax_queue_seconds[$h]) < 1)	{$Hmax_queue_seconds[$h] = 0;}
+					if (strlen($Hdrop_count[$h]) < 1)			{$Hdrop_count[$h] = 0;}
+
+					$hTOTcalls_count =			($hTOTcalls_count + $Hcalls_count[$h]);
+					$hTOTanswer_count =			($hTOTanswer_count + $Hanswer_count[$h]);
+					$hTOTtalk_sec =				($hTOTtalk_sec + $Htalk_sec[$h]);
+					$hTOTqueue_seconds =		($hTOTqueue_seconds + $Hqueue_seconds[$h]);
+					$hTOTdrop_count =			($hTOTdrop_count + $Hdrop_count[$h]);
+					if ($Hmax_queue_seconds[$h] > $hTOTmax_queue_seconds)
+						{$hTOTmax_queue_seconds = $Hmax_queue_seconds[$h];}
+
+					if ( ($Hanswer_count[$h] > 0) and ($Htalk_sec[$h] > 0) )
+						{$Htalk_avg[$h] = ($Htalk_sec[$h] / $Hanswer_count[$h]);}
+					else
+						{$Htalk_avg[$h] = 0;}
+					if ( ($Hcalls_count[$h] > 0) and ($Hqueue_seconds[$h] > 0) )
+						{$Hqueue_avg[$h] = ($Hqueue_seconds[$h] / $Hcalls_count[$h]);}
+					else
+						{$Hqueue_avg[$h] = 0;}
+
+					$Htalk_sec[$h] =			sec_convert($Htalk_sec[$h],'H'); 
+					$Htalk_avg[$h] =			sec_convert($Htalk_avg[$h],'H'); 
+					$Hqueue_seconds[$h] =		sec_convert($Hqueue_seconds[$h],'H'); 
+					$Hqueue_avg[$h] =			sec_convert($Hqueue_avg[$h],'H'); 
+					$Hmax_queue_seconds[$h] =	sec_convert($Hmax_queue_seconds[$h],'H');
+					
+					$hTOTALcalls =	sprintf("%6s", $Hcalls_count[$h]);
+					$hANSWERcalls =	sprintf("%6s", $Hanswer_count[$h]);
+					$hSUMtalk =		sprintf("%9s", $Htalk_sec[$h]);
+					$hAVGtalk =		sprintf("%7s", $Htalk_avg[$h]);
+					$hSUMqueue =	sprintf("%9s", $Hqueue_seconds[$h]);
+					$hAVGqueue =	sprintf("%7s", $Hqueue_avg[$h]);
+					$hMAXqueue =	sprintf("%7s", $Hmax_queue_seconds[$h]);
+					$hDROPcalls =	sprintf("%6s", $Hdrop_count[$h]);
+					$hPRINT =		sprintf("%2s", $h);
+
+					$SUBoutput .= "| $hPRINT   | $hTOTALcalls | $hANSWERcalls | $hSUMtalk | $hAVGtalk | $hSUMqueue | $hAVGqueue | $hMAXqueue | $hDROPcalls |\n";
+					}
+
+				$h++;
+				}
+
+			if ( ($hTOTanswer_count > 0) and ($hTOTtalk_sec > 0) )
+				{$hTOTtalk_avg = ($hTOTtalk_sec / $hTOTanswer_count);}
+			else
+				{$hTOTtalk_avg = 0;}
+			if ( ($hTOTcalls_count > 0) and ($hTOTqueue_seconds > 0) )
+				{$hTOTqueue_avg = ($hTOTqueue_seconds / $hTOTcalls_count);}
+			else
+				{$hTOTqueue_avg = 0;}
+
+			$hTOTtalk_sec =			sec_convert($hTOTtalk_sec,'H'); 
+			$hTOTtalk_avg =			sec_convert($hTOTtalk_avg,'H'); 
+			$hTOTqueue_seconds =		sec_convert($hTOTqueue_seconds,'H'); 
+			$hTOTqueue_avg =			sec_convert($hTOTqueue_avg,'H'); 
+			$hTOTmax_queue_seconds =	sec_convert($hTOTmax_queue_seconds,'H'); 
+
+			$hTOTcalls_count =			sprintf("%6s", $hTOTcalls_count);
+			$hTOTanswer_count =			sprintf("%6s", $hTOTanswer_count);
+			$hTOTtalk_sec =				sprintf("%9s", $hTOTtalk_sec);
+			$hTOTtalk_avg =				sprintf("%7s", $hTOTtalk_avg);
+			$hTOTqueue_seconds =		sprintf("%9s", $hTOTqueue_seconds);
+			$hTOTqueue_avg =			sprintf("%7s", $hTOTqueue_avg);
+			$hTOTmax_queue_seconds =	sprintf("%7s", $hTOTmax_queue_seconds);
+			$hTOTdrop_count =			sprintf("%6s", $hTOTdrop_count);
+
+			$SUBoutput .= "+------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
+			$SUBoutput .= "|TOTALS| $hTOTcalls_count | $hTOTanswer_count | $hTOTtalk_sec | $hTOTtalk_avg | $hTOTqueue_seconds | $hTOTqueue_avg | $hTOTmax_queue_seconds | $hTOTdrop_count |\n";
+			$SUBoutput .= "+------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
+
+			$i++;
+			}
+
+		$rawTOTtalk_sec = $TOTtalk_sec;
+		$rawTOTtalk_min = round($rawTOTtalk_sec / 60);
+
+		if ( ($TOTanswer_count > 0) and ($TOTtalk_sec > 0) )
+			{$TOTtalk_avg = ($TOTtalk_sec / $TOTanswer_count);}
+		else
+			{$TOTtalk_avg = 0;}
+		if ( ($TOTcalls_count > 0) and ($TOTqueue_seconds > 0) )
+			{$TOTqueue_avg = ($TOTqueue_seconds / $TOTcalls_count);}
+		else
+			{$TOTqueue_avg = 0;}
+
+		$TOTtalk_sec =			sec_convert($TOTtalk_sec,'H'); 
+		$TOTtalk_avg =			sec_convert($TOTtalk_avg,'H'); 
+		$TOTqueue_seconds =		sec_convert($TOTqueue_seconds,'H'); 
+		$TOTqueue_avg =			sec_convert($TOTqueue_avg,'H'); 
+		$TOTmax_queue_seconds =	sec_convert($TOTmax_queue_seconds,'H'); 
+
+		$i =					sprintf("%4s", $i);
+		$TOTcalls_count =		sprintf("%6s", $TOTcalls_count);
+		$TOTanswer_count =		sprintf("%6s", $TOTanswer_count);
+		$TOTtalk_sec =			sprintf("%9s", $TOTtalk_sec);
+		$TOTtalk_avg =			sprintf("%7s", $TOTtalk_avg);
+		$TOTqueue_seconds =		sprintf("%9s", $TOTqueue_seconds);
+		$TOTqueue_avg =			sprintf("%7s", $TOTqueue_avg);
+		$TOTmax_queue_seconds =	sprintf("%7s", $TOTmax_queue_seconds);
+		$TOTdrop_count =		sprintf("%6s", $TOTdrop_count);
+
+		$MAIN .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
+		$MAIN .= "| TOTALS       In-Groups: $i             | $TOTcalls_count | $TOTanswer_count | $TOTtalk_sec | $TOTtalk_avg | $TOTqueue_seconds | $TOTqueue_avg | $TOTmax_queue_seconds | $TOTdrop_count |\n";
+		$MAIN .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
+		}
+
+	if ($costformat > 0)
+		{
+		echo "
\n"; + $inbound_cost = ($rawTOTtalk_min * $inbound_rate); + $inbound_cost = sprintf("%8.2f", $inbound_cost); + + echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + + exit; + } + + + echo "$MAIN"; + echo "$SUBoutput"; + + + + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + echo "\n\nRun Time: $RUNtime seconds\n"; + } + + + + +?> + +
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_IVRfilter.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_IVRfilter.php new file mode 100644 index 00000000..32810a0e --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_IVRfilter.php @@ -0,0 +1,249 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 81030-0432 - First build +# 90310-2054 - Admin header +# 90508-0644 - Changed to PHP long tags +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +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); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$i=0; + +?> + + + + + +\n"; +echo "VICIDIAL: VDL IVR Filter Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo "
\n"; +echo "\n"; +echo "Período:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ADMIN | "; +echo "RELATÓRIOS\n"; +echo "\n"; + +echo "
\n"; + +echo "   \n"; +echo "
\n"; +echo "
\n\n"; + +echo "
\n\n";
+
+$shift = 'ALL';
+
+if ($shift == 'AM') 
+	{
+	$time_BEGIN=$AM_shift_BEGIN;
+	$time_END=$AM_shift_END;
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+	}
+if ($shift == 'PM') 
+	{
+	$time_BEGIN=$PM_shift_BEGIN;
+	$time_END=$PM_shift_END;
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+	}
+if ($shift == 'ALL') 
+	{
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+	}
+$query_date_BEGIN = "$query_date $time_BEGIN";   
+$query_date_END = "$end_date $time_END";
+
+
+
+echo "VDL: IVR Filter Stats:           $NOW_TIME\n";
+
+
+echo "\n";
+echo "+----------------------+---------+---------+---------+\n";
+echo "| CATEGORIA             | CALLS   | UNIQUE  |      %  |\n";
+echo "+----------------------+---------+---------+---------+\n";
+
+
+$stmtA="select count(*),count(distinct caller_id) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='ENTRANTE_IVR_FILTER' and comment_b='CLEAN';";
+$rsltA=mysql_query($stmtA, $link);
+if ($DB) {echo "$stmtA\n";}
+$rowA=mysql_fetch_row($rsltA);
+
+$stmtB="select count(*),count(distinct caller_id) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='ENTRANTE_IVR_FILTER' and comment_b='NOT_FOUND';";
+$rsltB=mysql_query($stmtB, $link);
+if ($DB) {echo "$stmtB\n";}
+$rowB=mysql_fetch_row($rsltB);
+
+$stmtC="select count(*),count(distinct caller_id) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='ENTRANTE_IVR_FILTER' and comment_b='EXISTING' and comment_c='DNC';";
+$rsltC=mysql_query($stmtC, $link);
+if ($DB) {echo "$stmtC\n";}
+$rowC=mysql_fetch_row($rsltC);
+
+$stmtD="select count(*),count(distinct caller_id) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='ENTRANTE_IVR_FILTER' and comment_b='EXISTING' and comment_c='SALE';";
+$rsltD=mysql_query($stmtD, $link);
+if ($DB) {echo "$stmtD\n";}
+$rowD=mysql_fetch_row($rsltD);
+
+$stmtE="select count(*),count(distinct caller_id) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='ENTRANTE_IVR_FILTER' and comment_b='EXISTING' and comment_c='ARCHIVE';";
+$rsltE=mysql_query($stmtE, $link);
+if ($DB) {echo "$stmtE\n";}
+$rowE=mysql_fetch_row($rsltE);
+
+
+$total = ($rowA[0] + $rowB[0] + $rowC[0] + $rowD[0] + $rowE[0]);
+$Utotal = ($rowA[1] + $rowB[1] + $rowC[1] + $rowD[1] + $rowE[1]);
+
+$agent =	sprintf("%7s", $rowA[0]);
+$Uagent =	sprintf("%7s", $rowA[1]);
+if ( ($Utotal < 1) or ($rowA[1] < 1) )
+	{$UagentPERCENT = '0';}
+else
+	{$UagentPERCENT = (($rowA[1] / $Utotal) * 100);   $UagentPERCENT = round($UagentPERCENT, 2);}
+$UagentPERCENT =	sprintf("%6s", $UagentPERCENT);
+
+$ntfnd =	sprintf("%7s", $rowB[0]);
+$Untfnd =	sprintf("%7s", $rowB[1]);
+if ( ($Utotal < 1) or ($rowB[1] < 1) )
+	{$UntfndPERCENT = '0';}
+else
+	{$UntfndPERCENT = (($rowB[1] / $Utotal) * 100);   $UntfndPERCENT = round($UntfndPERCENT, 2);}
+$UntfndPERCENT =	sprintf("%6s", $UntfndPERCENT);
+
+$prdnc =	sprintf("%7s", $rowC[0]);
+$Uprdnc =	sprintf("%7s", $rowC[1]);
+if ( ($Utotal < 1) or ($rowC[1] < 1) )
+	{$UprdncPERCENT = '0';}
+else
+	{$UprdncPERCENT = (($rowC[1] / $Utotal) * 100);   $UprdncPERCENT = round($UprdncPERCENT, 2);}
+$UprdncPERCENT =	sprintf("%6s", $UprdncPERCENT);
+
+$psale =	sprintf("%7s", $rowD[0]);
+$Upsale =	sprintf("%7s", $rowD[1]);
+if ( ($Utotal < 1) or ($rowD[1] < 1) )
+	{$UpsalePERCENT = '0';}
+else
+	{$UpsalePERCENT = (($rowD[1] / $Utotal) * 100);   $UpsalePERCENT = round($UpsalePERCENT, 2);}
+$UpsalePERCENT =	sprintf("%6s", $UpsalePERCENT);
+
+$archv =	sprintf("%7s", $rowE[0]);
+$Uarchv =	sprintf("%7s", $rowE[1]);
+if ( ($Utotal < 1) or ($rowE[1] < 1) )
+	{$UarchvPERCENT = '0';}
+else
+	{$UarchvPERCENT = (($rowE[1] / $Utotal) * 100);   $UarchvPERCENT = round($UarchvPERCENT, 2);}
+$UarchvPERCENT =	sprintf("%6s", $UarchvPERCENT);
+
+$total =	sprintf("%7s", $total);
+$Utotal =	sprintf("%7s", $Utotal);
+
+
+echo "| CALL SENT TO AGENTE   | $agent | $Uagent | $UagentPERCENT% |\n";
+echo "| CALLERID NOT FOUND   | $ntfnd | $Untfnd | $UntfndPERCENT% |\n";
+echo "| PREVIOUS DNC         | $prdnc | $Uprdnc | $UprdncPERCENT% |\n";
+echo "| PREVIOUS SALE        | $psale | $Upsale | $UpsalePERCENT% |\n";
+echo "| ARCHIVE ONLY         | $archv | $Uarchv | $UarchvPERCENT% |\n";
+echo "+----------------------+---------+---------+---------+\n";
+echo "|               TOTALS:| $total | $Utotal |\n";
+echo "+----------------------+---------+---------+\n";
+
+
+
+
+$ENDtime = date("U");
+$RUNtime = ($ENDtime - $STARTtime);
+echo "\nRun Time: $RUNtime seconds\n";
+
+
+
+
+?>
+
+
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_IVRstats.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_IVRstats.php new file mode 100644 index 00000000..80291e02 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_IVRstats.php @@ -0,0 +1,733 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 81026-2026 - First build +# 81107-0341 - Added time range and option and 15-minute increment graph +# 81107-1148 - Added average times and totals +# 81108-0922 - Added no-callerID and unique caller counts +# 90310-2056 - Admin header +# 90508-0644 - Changed to PHP long tags +# 91112-0719 - Added in-group names to select list +# 100214-1421 - Sort menu alphabetically +# 100301-1401 - Added popup date selector +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["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"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +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); + +if (strlen($shift)<2) {$shift='ALL';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} +if (!isset($end_date)) {$end_date = "$NOW_DATE 23:23:59";} + +$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; + $LISTgroups[$i]='CALLMENU'; + $LISTgroups_names[$i]='IVR'; + $i++; + $groups_to_print++; + $LISTgroups[$i]='XMLPULL'; + $LISTgroups_names[$i]='Dynamic Application'; + $i++; + $groups_to_print++; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTgroups[$i] = $row[0]; + $LISTgroups_names[$i] = $row[1]; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$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";} +$statcats_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statcats_to_print) + { + $row=mysql_fetch_row($rslt); + $vsc_id[$i] = $row[0]; + $vsc_name[$i] = $row[1]; + $vsc_count[$i] = 0; + $i++; + } +?> + + + + + + + + + + +\n"; +echo "IVR Stats Report\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +if ($DB > 0) + { + echo "
\n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "
\n"; + echo "$shift|$query_date|$end_date\n"; + echo "
\n"; + } + +echo "
\n"; +echo "\n"; +echo "
\n"; +echo "\n"; +echo "Período:
\n"; + +echo "\n"; +echo "\n"; +echo ""; + +?> + +"; + +echo "
to
"; + +?> + +"; + + +echo "
\n"; +echo "Grupos de Entrada: \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ALTERAR | "; +echo "RELATÓRIOS | "; +echo "RELATÓRIO DE FINALIZADOR(CLOSER) \n"; +echo "\n"; + +echo "
\n"; + +#echo "\n"; +echo "Shift: \n"; + +?> + + +   +
\n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if ($groups_to_print < 1)
+	{
+	echo "\n\n";
+	echo "POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+	}
+
+else
+	{
+	echo "IVR Stats Report: $query_date_BEGIN to $query_date_END               $NOW_TIME\n";
+	echo "                  $group_string\n";
+
+	$TOTALcalls=0;
+	$NOCALLERIDcalls=0;
+	$UNIQUEcallers=0;
+	$totFLOWivr_time=0;
+	$totFLOWtotal_time=0;
+
+	##### Grab all records for the IVR for the specified time period
+	$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$logs_to_print = mysql_num_rows($rslt);
+	$p=0;
+	while ($p < $logs_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$uniqueid[$p] =		$row[0];
+		$extension[$p] =	$row[1];
+		$start_time[$p] =	$row[2];
+		$comment_a[$p] =	$row[3];
+		$comment_b[$p] =	$row[4];
+		$comment_d[$p] =	$row[5];
+		$epoch[$p] =		$row[6];
+		$phone_ext[$p] =	$row[7];
+		$p++;
+		}
+
+	### create the call flow of all calls by uniqueid
+	$last_uniqueid='';
+	$first_epoch='';
+	$last_epoch='';
+	$p=0;
+	$r=-1;
+	while ($p < $logs_to_print)
+		{
+		if ($DB > 0) {echo "$p|$uniqueid[$p]|$comment_b[$p]";}
+		if ($last_uniqueid === "$uniqueid[$p]")
+			{
+			$unique_calls[$r] .= "----------$comment_b[$p]";
+			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
+			$last_epoch[$r]=$epoch[$p];
+			}
+		else
+			{
+			$r++;
+			$caller_id[$r]=$phone_ext[$p];
+			if (strlen($phone_ext[$p])<2)
+				{$NOCALLERIDcalls++;}
+			else
+				{
+				if (!ereg("_$phone_ext[$p]_",$unique_callerIDs))
+					{
+					$unique_callerIDs .= "_$phone_ext[$p]_";
+					$UNIQUEcallers++;
+					}
+				}
+			$first_epoch[$r]=$epoch[$p];
+			$last_epoch[$r]=$epoch[$p];
+			$unique_calls[$r] = $comment_b[$p];
+			$FLOWuniqueid[$r] = "$uniqueid[$p]";
+			$last_uniqueid = "$uniqueid[$p]";
+			if ($DB > 0) {echo "   $r|$unique_calls[$r]\n";}
+			}
+		$p++;
+		}
+
+	### sort call flows for counting
+	$RAWunique_calls = $unique_calls;
+	if ($logs_to_print > 0)
+		{sort($unique_calls);}
+
+
+	### count each unique call flow
+	$last_Suniqueid='';
+	$p=-1;
+	$s=0;
+	while ($s <= $r)
+		{
+		if ($DB > 0) {echo "$s|$unique_calls[$s]\n";}
+		if ($last_Suniqueid === "$unique_calls[$s]")
+			{
+			$STunique_calls_count[$p]++;
+			}
+		else
+			{
+			$p++;
+			$STunique_calls[$p] = $unique_calls[$s];
+			$last_Suniqueid = "$unique_calls[$s]";
+			$STunique_calls_count[$p]=1;
+			}
+		$s++;
+		}
+
+
+	### put call flows and counts together for sorting again
+	$TOTALcalls=0;
+	$s=0;
+	while ($s <= $p)
+		{
+		$TOTALcalls = ($TOTALcalls + $STunique_calls_count[$s]);
+		$STunique_calls_count[$s] = sprintf("%07s", $STunique_calls_count[$s]);
+		$FLOWunique_calls[$s] = "$STunique_calls_count[$s]__________$STunique_calls[$s]";
+		$s++;
+		}
+
+	#### PRINT TOTAL DE CHAMADAS INTO THIS IVR
+	echo "\n";
+	echo "Calls taken into this IVR:   $TOTALcalls\n";
+	echo "Calls with no CallerID:      $NOCALLERIDcalls\n";
+	echo "Unique Callers:              $UNIQUEcallers\n";
+	echo "\n";
+
+	### sort call flows for counting
+	if ($p > 0)
+		{rsort($FLOWunique_calls);}
+
+
+	### put call flows and counts together for sorting again
+	$RUC_ct = count($RAWunique_calls);
+	$s=0;
+	while ($s <= $p)
+		{
+		$FLOWsummary = explode('__________',$FLOWunique_calls[$s]);
+		$FLOWsummary[0] = ($FLOWsummary[0] + 0);
+
+		$t=0;
+		while ($t < $RUC_ct)
+			{
+			if ($FLOWsummary[1] === "$RAWunique_calls[$t]")
+				{
+				$FLOWunique_calls_list[$s] .= "'$FLOWuniqueid[$t]',";
+				if ($last_epoch[$t] <= $first_epoch[$t]) {$last_epoch[$t] = ($first_epoch[$t] + 5);}
+				else {$last_epoch[$t] = ($last_epoch[$t] + 10);}
+				$FLOWivr_time[$s] = ($FLOWivr_time[$s] + ($last_epoch[$t] - $first_epoch[$t]));
+				}
+			$t++;
+			}
+
+		$s++;
+		}
+
+
+	### put call flows and counts together for sorting again
+	$s=0;
+
+	echo "+--------+--------+--------+--------+------+------+\n";
+	echo "|        |        | QUEUE  | QUEUE  | IVR  | TOTAL|\n";
+	echo "| IVR    | QUEUE  | DROP   | DROP   | AVG  | AVG  |\n";
+	echo "| CALLS  | CALLS  | CALLS  | PERCENT| TIME | TIME | CALL PATH\n";
+	echo "+--------+--------+--------+--------+------+------+------------\n";
+
+	while ($s <= $p)
+		{
+		$vcl_statuses = $MT;
+		$FLOWdrop[$s]=0;
+		$FLOWtotal[$s]=0;
+		$FLOWdropPCT[$s]=0;
+		$FLOWsummary = explode('__________',$FLOWunique_calls[$s]);
+		$FLOWsummary[0] = ($FLOWsummary[0] + 0);
+
+		$FLOWunique_calls_list[$s] = preg_replace("/,$/","",$FLOWunique_calls_list[$s]);
+
+
+		##### Grab all records for the IVR for the specified time period
+		$stmt="select status,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 uniqueid IN($FLOWunique_calls_list[$s]);";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$vcl_statuses_to_print = mysql_num_rows($rslt);
+		$w=0;
+		while ($w < $vcl_statuses_to_print)
+			{
+			$row=mysql_fetch_row($rslt);
+			$vcl_statuses[$w] =		$row[0];
+			if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) )
+				{$FLOWdrop[$s]++;}
+			$FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]);
+			$FLOWtotal[$s]++;
+			$w++;
+			}
+		if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) )
+			{
+			$FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100);
+			$FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2);
+			}
+		$FLOWsummary[0] =	sprintf("%6s", $FLOWsummary[0]);
+		$FLOWtotal[$s] =	sprintf("%6s", $FLOWtotal[$s]);
+		$FLOWdrop[$s] =		sprintf("%6s", $FLOWdrop[$s]);
+		$FLOWdropPCT[$s] =	sprintf("%6s", $FLOWdropPCT[$s]);
+		$FLOWsummary[1] = ereg_replace('----------',' / ',$FLOWsummary[1]);
+		$FLOWtotal_time[$s] = ($FLOWivr_time[$s] + $FLOWclose_time[$s]);
+
+		$avgFLOWivr_time[$s] = ($FLOWivr_time[$s] / $FLOWsummary[0]);
+		$avgFLOWivr_time[$s] = round($avgFLOWivr_time[$s], 0);
+		$avgFLOWivr_time[$s] = sprintf("%4s", $avgFLOWivr_time[$s]);
+		$avgFLOWtotal_time[$s] = ($FLOWtotal_time[$s] / $FLOWsummary[0]);
+		$avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0);
+		$avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]);
+
+		$totFLOWtotal_time = ($totFLOWtotal_time + $FLOWtotal_time[$s]);
+		$totFLOWivr_time = ($totFLOWivr_time + $FLOWivr_time[$s]);
+		$totFLOWtotal = ($totFLOWtotal + $FLOWtotal[$s]);
+		$totFLOWdrop = ($totFLOWdrop + $FLOWdrop[$s]);
+
+		echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n";
+
+		$s++;
+		}
+	$TOTALcalls = sprintf("%6s", $TOTALcalls);
+	$totFLOWtotal = sprintf("%6s", $totFLOWtotal);
+	$totFLOWdrop = sprintf("%6s", $totFLOWdrop);
+	if ( ($totFLOWivr_time > 0) and ($TOTALcalls > 0) )
+		{$TavgFLOWivr_time = ($totFLOWivr_time / $TOTALcalls);}
+	$TavgFLOWivr_time = round($TavgFLOWivr_time, 0);
+	$TavgFLOWivr_time = sprintf("%4s", $TavgFLOWivr_time);
+	if ( ($totFLOWtotal_time > 0) and ($TOTALcalls > 0) )
+		{$TavgFLOWtotal_time = ($totFLOWtotal_time / $TOTALcalls);}
+	$TavgFLOWtotal_time = round($TavgFLOWtotal_time, 0);
+	$TavgFLOWtotal_time = sprintf("%4s", $TavgFLOWtotal_time);
+	if ( ($totFLOWtotal < 1) or ($totFLOWdrop < 1) )
+		{$totFLOWdropPCT = '0';}
+	else
+		{
+		$totFLOWdropPCT = (($totFLOWdrop / $totFLOWtotal) * 100);
+		$totFLOWdropPCT = round($totFLOWdropPCT, 0);
+		}
+	$totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT);
+
+	echo "+--------+--------+--------+--------+------+------+------------\n";
+	echo "| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n";
+	echo "+--------+--------+--------+--------+------+------+\n";
+
+
+	##############################
+	#########  TIME STATS
+
+	echo "\n";
+	echo "---------- ESTATÍSTICAS DE TEMPO\n";
+
+	echo "\n";
+
+	$hi_hour_count=0;
+	$last_full_record=0;
+	$i=0;
+	$h=0;
+	while ($i <= 96)
+		{
+		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';";
+		$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;}
+		$i++;
+
+
+		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';";
+		$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;}
+		$i++;
+
+		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';";
+		$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;}
+		$i++;
+
+		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';";
+		$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;}
+		$i++;
+		$h++;
+		}
+
+	if ($hi_hour_count < 1)
+		{$hour_multiplier = 0;}
+	else
+		{
+		$hour_multiplier = (100 / $hi_hour_count);
+		#$hour_multiplier = round($hour_multiplier, 0);
+		}
+
+	echo "\n";
+	echo "GRÁFICO TOTAL DE CHAMADAS A CADA 15 MINUTOS TAKEN INTO THIS IVR\n";
+
+	$k=1;
+	$Mk=0;
+	$call_scale = '0';
+	while ($k <= 102) 
+		{
+		if ($Mk >= 5) 
+			{
+			$Mk=0;
+			if ( ($k < 1) or ($hour_multiplier <= 0) )
+				{$scale_num = 100;}
+			else
+				{
+				$scale_num=($k / $hour_multiplier);
+				$scale_num = round($scale_num, 0);
+				}
+			$LENscale_num = (strlen($scale_num));
+			$k = ($k + $LENscale_num);
+			$call_scale .= "$scale_num";
+			}
+		else
+			{
+			$call_scale .= " ";
+			$k++;   $Mk++;
+			}
+		}
+
+
+	echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n";
+	#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | TOTAL |\n";
+	echo "| HOUR |$call_scale| TOTAL |\n";
+	echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n";
+
+	$ZZ = '00';
+	$i=0;
+	$h=4;
+	$hour= -1;
+	$no_lines_yet=1;
+
+	while ($i <= 96)
+		{
+		$char_counter=0;
+		$time = '      ';
+		if ($h >= 4) 
+			{
+			$hour++;
+			$h=0;
+			if ($hour < 10) {$hour = "0$hour";}
+			$time = "+$hour$ZZ+";
+			}
+		if ($h == 1) {$time = "   15 ";}
+		if ($h == 2) {$time = "   30 ";}
+		if ($h == 3) {$time = "   45 ";}
+		$Ghour_count = $hour_count[$i];
+		if ($Ghour_count < 1) 
+			{
+			if ( ($no_lines_yet) or ($i > $last_full_record) )
+				{
+				$do_nothing=1;
+				}
+			else
+				{
+				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
+				echo "|$time|";
+				$k=0;   while ($k <= 102) {echo " ";   $k++;}
+				echo "| $hour_count[$i] |\n";
+				}
+			}
+		else
+			{
+			$no_lines_yet=0;
+			$Xhour_count = ($Ghour_count * $hour_multiplier);
+			$Yhour_count = (99 - $Xhour_count);
+
+			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
+
+			echo "|$time|";
+			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
+			echo "*X";   $char_counter++;
+			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
+				while ($char_counter <= 101) {echo " ";   $char_counter++;}
+			echo "| $hour_count[$i] |\n";
+			}
+		
+		
+		$i++;
+		$h++;
+		}
+
+
+	echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n\n";
+
+
+	$ENDtime = date("U");
+	$RUNtime = ($ENDtime - $STARTtime);
+	echo "\nRun Time: $RUNtime seconds\n";
+	}
+
+
+
+?>
+
+
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_OUTBOUNDsummary_interval.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_OUTBOUNDsummary_interval.php new file mode 100644 index 00000000..4ce1906b --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_OUTBOUNDsummary_interval.php @@ -0,0 +1,1281 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 091128-0311 - First build +# 091129-0017 - Added Sales-type and DNC-type tallies +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + +if (isset($_GET["time_interval"])) {$time_interval=$_GET["time_interval"];} + elseif (isset($_POST["time_interval"])) {$time_interval=$_POST["time_interval"];} +if (isset($_GET["print_calls"])) {$print_calls=$_GET["print_calls"];} + elseif (isset($_POST["print_calls"])) {$print_calls=$_POST["print_calls"];} +if (isset($_GET["include_rollover"])) {$include_rollover=$_GET["include_rollover"];} + elseif (isset($_POST["include_rollover"])) {$include_rollover=$_POST["include_rollover"];} +if (isset($_GET["bareformat"])) {$bareformat=$_GET["bareformat"];} + elseif (isset($_POST["bareformat"])) {$bareformat=$_POST["bareformat"];} +if (isset($_GET["costformat"])) {$costformat=$_GET["costformat"];} + elseif (isset($_POST["costformat"])) {$costformat=$_POST["costformat"];} +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["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"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +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); + +$MT[0]='0'; +if (strlen($shift)<2) {$shift='ALL';} +if (strlen($include_rollover)<2) {$include_rollover='NO';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$gmt_conf_ct = mysql_num_rows($rslt); +$dst = date("I"); +if ($gmt_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + $epoch_offset = (($local_gmt + $dst) * 3600); + } + +$auth=0; +$stmt="SELECT full_name,user_level,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$records_to_print = mysql_num_rows($rslt); +if ($records_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_level = $row[1]; + $user_group = $row[2]; + $auth++; + } + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ($user_level < 9) + { + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + $records_to_print = mysql_num_rows($rslt); + if ($records_to_print > 0) + { + $row=mysql_fetch_row($rslt); + if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) + { + $rawLOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); + $rawLOGallowed_campaignsSQL = eregi_replace(' ',"','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + } + else + { + echo "Campaigns Permissions Error: |$PHP_AUTH_USER|$user_group|\n"; + exit; + } + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_names[$i] = $row[1]; + if (eregi('--ALL--',$group_string)) + {$group[$i] = $row[0];} + $i++; + } + +if ($DB) {echo "$group_string|$i\n";} + +$rollover_groups_count=0; +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + + $stmt="select campaign_name from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + $campaign_names_to_print = mysql_num_rows($rslt); + if ($campaign_names_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $group_cname[$i] = $row[0]; + } + + if (eregi("YES",$include_rollover)) + { + $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $in_groups_to_print = mysql_num_rows($rslt); + if ($in_groups_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $group_drop_SQL .= "'$row[0]',"; + + $rollover_groups_count++; + } + } + + $i++; + } +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = ""; + $group_drop_SQL = ""; + } +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_drop_SQL = eregi_replace(",$",'',$group_drop_SQL); + $both_group_SQLand = "and ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )"; + $both_group_SQL = "where ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )"; + $group_SQLand = "and campaign_id IN($group_SQL)"; + $group_SQL = "where campaign_id IN($group_SQL)"; + $group_drop_SQLand = "and campaign_id IN($group_drop_SQL)"; + $group_drop_SQL = "where campaign_id IN($group_drop_SQL)"; + } + +$stmt="select vsc_id,vsc_name from vicidial_status_categories;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statcats_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statcats_to_print) + { + $row=mysql_fetch_row($rslt); + $vsc_id[$i] = $row[0]; + $vsc_name[$i] = $row[1]; + $vsc_count[$i] = 0; + $i++; + } + +$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$times_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $times_to_print) + { + $row=mysql_fetch_row($rslt); + $call_times[$i] = $row[0]; + $call_time_names[$i] = $row[1]; + $i++; + } + +$customer_interactive_statuses=''; +$stmt="select status from vicidial_statuses where human_answered='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statha_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statha_to_print) + { + $row=mysql_fetch_row($rslt); + $customer_interactive_statuses .= "'$row[0]',"; + $i++; + } +$stmt="select status from vicidial_campaign_statuses where human_answered='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statha_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statha_to_print) + { + $row=mysql_fetch_row($rslt); + $customer_interactive_statuses .= "'$row[0]',"; + $i++; + } +if (strlen($customer_interactive_statuses)>2) + {$customer_interactive_statuses = substr("$customer_interactive_statuses", 0, -1);} +else + {$customer_interactive_statuses="''";} + +$stmt="select status from vicidial_statuses where sale='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statsale_to_print = mysql_num_rows($rslt); +$i=0; +$sale_ct=0; +while ($i < $statsale_to_print) + { + $row=mysql_fetch_row($rslt); + $sale_statusesLIST[$sale_ct] = $row[0]; + $sale_ct++; + $i++; + } +$stmt="select status from vicidial_campaign_statuses where sale='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statsale_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statsale_to_print) + { + $row=mysql_fetch_row($rslt); + $sale_statusesLIST[$sale_ct] = $row[0]; + $sale_ct++; + $i++; + } + +$stmt="select status from vicidial_statuses where dnc='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statdnc_to_print = mysql_num_rows($rslt); +$i=0; +$dnc_ct=0; +while ($i < $statdnc_to_print) + { + $row=mysql_fetch_row($rslt); + $dnc_statusesLIST[$dnc_ct] = $row[0]; + $dnc_ct++; + $i++; + } +$stmt="select status from vicidial_campaign_statuses where dnc='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statdnc_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statdnc_to_print) + { + $row=mysql_fetch_row($rslt); + $dnc_statusesLIST[$dnc_ct] = $row[0]; + $dnc_ct++; + $i++; + } + +?> + + + + + +\n"; +echo "\n"; + +echo "\n"; +echo "Outbound Summary Interval Report\n"; + +if ($bareformat < 1) + { + $short_header=1; + + require("admin_header.php"); + + echo "
"; + + if ($DB > 0) + { + echo "
\n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "
\n"; + echo "$shift|$query_date|$end_date\n"; + echo "
\n"; + } + + echo "
\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Date Range:
\n"; + echo ""; + + ?> + + "; + + ?> + +
Campaigns:
"; + echo "\n"; + echo "
"; + echo "Include Drop  
Rollover:
"; + echo "
\n"; + echo "Time Interval:
"; + echo "\n"; + echo "
\n"; + echo "         "; + echo "MODIFY | "; + echo "REPORTS"; + echo "

\n"; + echo "
        "; + echo "\n"; + + echo "
\n"; + + echo "Call Time:
\n"; + echo "\n"; + echo "
\n"; + echo "
\n"; + echo "
\n\n"; + + echo "
\n\n";
+	}
+
+if ($group_ct < 1)
+	{
+	echo "\n\n";
+	echo "PLEASE SELECT A CAMPAIGN AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
+	}
+
+else
+	{
+	if ($shift == 'ALL') 
+		{
+		$Gct_default_start = "0";
+		$Gct_default_stop = "2400";
+		}
+	else 
+		{
+		$stmt="SELECT call_time_id,call_time_name,call_time_comments,ct_default_start,ct_default_stop,ct_sunday_start,ct_sunday_stop,ct_monday_start,ct_monday_stop,ct_tuesday_start,ct_tuesday_stop,ct_wednesday_start,ct_wednesday_stop,ct_thursday_start,ct_thursday_stop,ct_friday_start,ct_friday_stop,ct_saturday_start,ct_saturday_stop,ct_state_call_times FROM vicidial_call_times where call_time_id='$shift';";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$calltimes_to_print = mysql_num_rows($rslt);
+		if ($calltimes_to_print > 0)
+			{
+			$row=mysql_fetch_row($rslt);
+			$Gct_default_start =	$row[3];
+			$Gct_default_stop =		$row[4];
+			$Gct_sunday_start =		$row[5];
+			$Gct_sunday_stop =		$row[6];
+			$Gct_monday_start =		$row[7];
+			$Gct_monday_stop =		$row[8];
+			$Gct_tuesday_start =	$row[9];
+			$Gct_tuesday_stop =		$row[10];
+			$Gct_wednesday_start =	$row[11];
+			$Gct_wednesday_stop =	$row[12];
+			$Gct_thursday_start =	$row[13];
+			$Gct_thursday_stop =	$row[14];
+			$Gct_friday_start =		$row[15];
+			$Gct_friday_stop =		$row[16];
+			$Gct_saturday_start =	$row[17];
+			$Gct_saturday_stop =	$row[18];
+			}
+		else
+			{
+			$Gct_default_start = "0";
+			$Gct_default_stop = "2400";
+			}
+		}
+	$h=0;
+	$hh=0;
+	while ($h < $interval_count)
+		{
+		if ($interval_count>=96)
+			{
+			if ($hf < 45)
+				{
+				$hf = ($hf + 15);
+				}
+			else
+				{
+				$hf = "00";
+				if ($h > 0)
+					{$hh++;}
+				}
+			$H_test = "$hh$hf";
+			}
+		if ($interval_count==48)
+			{
+			if ($hf < 30)
+				{
+				$hf = ($hf + 30);
+				}
+			else
+				{
+				$hf = "00";
+				if ($h > 0)
+					{$hh++;}
+				}
+			$H_test = "$hh$hf";
+			}
+		if ($interval_count<=24)
+			{
+			$H_test = $h . "00";
+			}
+		if ( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) )
+			{
+			$Hcalltime[$h]++;
+			$Hcalltime_HHMM[$h] = "$H_test";
+			}
+		if ($DB)
+			{echo "( ($H_test >= $Gct_default_start) and ($H_test <= $Gct_default_stop) ) $hh $hf\n";}
+		$h++;
+		}
+
+	$query_date_BEGIN = "$query_date 00:00:00";   
+	$query_date_END = "$end_date 23:59:59";
+
+
+	$MAIN .= "Outbound Summary Interval Report: $group_string          $NOW_TIME\n";
+
+
+
+
+	##### Loop through each campaign and gether stats
+	if ($group_ct > 0)
+		{
+		$MAIN .= "\n";
+		$MAIN .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
+		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+		$MAIN .= "|                                          |        | SYSTEM | AGENT  |        |        | NO     |        | AGENT      | AGENT      |\n";
+		$MAIN .= "|                                          | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | ANSWER | DROP   | LOGIN      | PAUSE      |\n";
+		$MAIN .= "| CAMPAIGN                                 | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
+		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+
+		$i=0;
+		$TOTcalls_count=0;
+		$TOTsystem_count=0;
+		$TOTagent_count=0;
+		$TOTptp_count=0;
+		$TOTrtp_count=0;
+		$TOTna_count=0;
+		$TOTdrop_count=0;
+		$TOTagent_login_sec=0;
+		$TOTagent_pause_sec=0;
+		$SUBoutput='';
+
+		while($i < $group_ct)
+			{
+			$u=0;
+
+			##### Gather Agent time records
+			$stmt="select event_time,UNIX_TIMESTAMP(event_time),campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id IN('$group_drop[$i]','$group[$i]');";
+			$rslt=mysql_query($stmt, $link);
+			if ($DB) {echo "$stmt\n";}
+			$AGENTtime_to_print = mysql_num_rows($rslt);
+			$s=0;
+			while ($s < $AGENTtime_to_print)
+				{
+				$row=mysql_fetch_row($rslt);
+				$inTOTALsec =		($row[3] + $row[4] + $row[5] + $row[6]);	
+				$ATcall_date[$s] =		$row[0];
+				$ATepoch[$s] =			$row[1];
+				$ATcampaign_id[$s] =	$row[2];
+				$ATpause_sec[$s] =		$row[3];
+				$ATagent_sec[$s] =		$inTOTALsec;
+				$s++;
+				}
+
+			##### Gather outbound calls
+			$stmt = "SELECT status,length_in_sec,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,uniqueid,lead_id from vicidial_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";}
+			$calls_to_parse = mysql_num_rows($rslt);
+			$p=0;
+			while ($p < $calls_to_parse)
+				{
+				$row=mysql_fetch_row($rslt);
+				$CPstatus[$u] =			$row[0];
+				$CPlength_in_sec[$u] =	$row[1];
+				$CPcall_date[$u] =		$row[2];
+				$CPepoch[$u] =			$row[3];
+				$CPphone_number[$u] =	$row[4];
+				$CPcampaign_id[$u] =	$row[5];
+				$CPvicidial_id[$u] =	$row[6];
+				$CPlead_id[$u] =		$row[7];
+				$TESTlead_id[$u] =		$row[7];
+				$TESTuniqueid[$u] =		$row[6];
+				$CPin_out[$u] =			'OUT';
+				$p++;
+				$u++;
+				}
+
+			$group_drop[$i]='';
+			if (eregi("YES",$include_rollover))
+				{
+				##### Gather inbound calls from drop inbound group if selected
+				$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
+				$rslt=mysql_query($stmt, $link);
+				if ($DB) {echo "$stmt\n";}
+				$in_groups_to_print = mysql_num_rows($rslt);
+				if ($in_groups_to_print > 0)
+					{
+					$row=mysql_fetch_row($rslt);
+					$group_drop[$i] = $row[0];
+					$rollover_groups_count++;
+					}
+
+				$length_in_secZ=0;
+				$queue_secondsZ=0;
+				$agent_alert_delayZ=0;
+				$stmt="select status,length_in_sec,queue_seconds,agent_alert_delay,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,closecallid,lead_id,uniqueid from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and campaign_id='$group_drop[$i]';";
+				$rslt=mysql_query($stmt, $link);
+				if ($DB) {echo "$stmt\n";}
+				$INallcalls_to_printZ = mysql_num_rows($rslt);
+				$y=0;
+				while ($y < $INallcalls_to_printZ)
+					{
+					$row=mysql_fetch_row($rslt);
+
+					$k=0;
+					$front_call_found=0;
+					while($k < $p)
+						{
+						if ($TESTuniqueid[$k] == $row[10])
+							{$front_call_found++;}
+						$k++;
+						}
+					if ($front_call_found > 0)
+						{
+						$length_in_secZ = $row[1];
+						$queue_secondsZ = $row[2];
+						$agent_alert_delayZ = $row[3];
+
+						$TOTALdelay =		round($agent_alert_delayZ / 1000);
+						$thiscallsec = (($length_in_secZ - $queue_secondsZ) - $TOTALdelay);
+						if ($thiscallsec < 0)
+							{$thiscallsec = 0;}
+						$inTOTALsec =	($inTOTALsec + $thiscallsec);	
+
+						$CPstatus[$u] =			$row[0];
+						$CPlength_in_sec[$u] =	$inTOTALsec;
+						$CPcall_date[$u] =		$row[4];
+						$CPepoch[$u] =			$row[5];
+						$CPphone_number[$u] =	$row[6];
+						$CPcampaign_id[$u] =	$row[7];
+						$CPvicidial_id[$u] =	$row[8];
+						$CPlead_id[$u] =		$row[9];
+						$CPin_out[$u] =			'IN';
+						$u++;
+						}
+					$y++;
+					}
+				}
+
+
+			$out_of_call_time=0;
+			$length_in_sec[$i]=0;
+			$queue_seconds[$i]=0;
+			$agent_sec[$i]=0;
+			$pause_sec[$i]=0;
+			$talk_sec[$i]=0;
+			$calls_count[$i]=0;
+			$calls_count_IN[$i]=0;
+			$drop_count[$i]=0;
+			$drop_count_OUT[$i]=0;
+			$system_count[$i]=0;
+			$agent_count[$i]=0;
+			$ptp_count[$i]=0;
+			$rtp_count[$i]=0;
+			$na_count[$i]=0;
+			$answer_count[$i]=0;
+			$max_queue_seconds[$i]=0;
+			$Hlength_in_sec=$MT;
+			$Hqueue_seconds=$MT;
+			$Hagent_sec=$MT;
+			$Hpause_sec=$MT;
+			$Htalk_sec=$MT;
+			$Hcalls_count=$MT;
+			$Hcalls_count_IN=$MT;
+			$Hdrop_count=$MT;
+			$Hdrop_count_OUT=$MT;
+			$Hsystem_count=$MT;
+			$Hagent_count=$MT;
+			$Hptp_count=$MT;
+			$Hrtp_count=$MT;
+			$Hna_count=$MT;
+			$Hanswer_count=$MT;
+			$Hmax_queue_seconds=$MT;
+			$hTOTALcalls =	0;
+			$hANSWERcalls =	0;
+			$hSUMagent =	0;
+			$hSUMpause =	0;
+			$hSUMtalk =		0;
+			$hAVGtalk =		0;
+			$hSUMqueue =	0;
+			$hAVGqueue =	0;
+			$hMAXqueue =	0;
+			$hDROPcalls =	0;
+			$hPRINT =		0;
+			$hTOTcalls_count =			0;
+			$hTOTsystem_count =			0;
+			$hTOTagent_count =			0;
+			$hTOTptp_count =			0;
+			$hTOTrtp_count =			0;
+			$hTOTna_count =				0;
+			$hTOTanswer_count =			0;
+			$hTOTagent_sec =			0;
+			$hTOTpause_sec =			0;
+			$hTOTtalk_sec =				0;
+			$hTOTtalk_avg =				0;
+			$hTOTqueue_seconds =		0;
+			$hTOTqueue_avg =			0;
+			$hTOTmax_queue_seconds =	0;
+			$hTOTdrop_count =			0;
+
+			##### Parse through the agent time records to tally the time
+			$p=0;
+			while ($p < $s)
+				{
+				$call_date = explode(" ", $ATcall_date[$p]);
+				$call_time = ereg_replace("[^0-9]","",$call_date[1]);
+				$epoch = $ATepoch[$p];
+				$Cwday = date("w", $epoch);
+
+				$CTstart = $Gct_default_start . "00";
+				$CTstop = $Gct_default_stop . "59";
+
+				if ( ($Cwday == 0) and ( ($Gct_sunday_start > 0) and ($Gct_sunday_stop > 0) ) )
+					{$CTstart = $Gct_sunday_start . "00";   $CTstop = $Gct_sunday_stop . "59";}
+				if ( ($Cwday == 1) and ( ($Gct_monday_start > 0) and ($Gct_monday_stop > 0) ) )
+					{$CTstart = $Gct_monday_start . "00";   $CTstop = $Gct_monday_stop . "59";}
+				if ( ($Cwday == 2) and ( ($Gct_tuesday_start > 0) and ($Gct_tuesday_stop > 0) ) )
+					{$CTstart = $Gct_tuesday_start . "00";   $CTstop = $Gct_tuesday_stop . "59";}
+				if ( ($Cwday == 3) and ( ($Gct_wednesday_start > 0) and ($Gct_wednesday_stop > 0) ) )
+					{$CTstart = $Gct_wednesday_start . "00";   $CTstop = $Gct_wednesday_stop . "59";}
+				if ( ($Cwday == 4) and ( ($Gct_thursday_start > 0) and ($Gct_thursday_stop > 0) ) )
+					{$CTstart = $Gct_thursday_start . "00";   $CTstop = $Gct_thursday_stop . "59";}
+				if ( ($Cwday == 5) and ( ($Gct_friday_start > 0) and ($Gct_friday_stop > 0) ) )
+					{$CTstart = $Gct_friday_start . "00";   $CTstop = $Gct_friday_stop . "59";}
+				if ( ($Cwday == 6) and ( ($Gct_saturday_start > 0) and ($Gct_saturday_stop > 0) ) )
+					{$CTstart = $Gct_saturday_start . "00";   $CTstop = $Gct_saturday_stop . "59";}
+
+				$Chour = date("G", $epoch);
+				$Cmin = date("i", $epoch);
+				if ($interval_count==96)
+					{
+					$ChourX = ($Chour * 4);
+					if ($Cmin < 15) {$Cmin = "00"; $CminX = 0;}
+					if ( ($Cmin >= 15) and ($Cmin < 30) ) {$Cmin = "15"; $CminX = 1;}
+					if ( ($Cmin >= 30) and ($Cmin < 45) ) {$Cmin = "30"; $CminX = 2;}
+					if ($Cmin >= 45) {$Cmin = "45"; $CminX = 3;}
+					$Chour = ($ChourX + $CminX);
+					}
+				if ($interval_count==48)
+					{
+					$ChourX = ($Chour * 2);
+					if ($Cmin < 30) {$Cmin = "00"; $CminX = 0;}
+					if ($Cmin >= 30) {$Cmin = "30"; $CminX = 1;}
+					$Chour = ($ChourX + $CminX);
+					}
+
+				if ( ($call_time > $CTstart) and ($call_time < $CTstop) )
+					{
+					$agent_sec[$i] = ($agent_sec[$i] + $ATagent_sec[$p]);
+					$Hagent_sec[$Chour] = ($Hagent_sec[$Chour] + $ATagent_sec[$p]);
+					$pause_sec[$i] = ($pause_sec[$i] + $ATpause_sec[$p]);
+					$Hpause_sec[$Chour] = ($Hpause_sec[$Chour] + $ATpause_sec[$p]);
+
+					$Hcalltime[$Chour]++;
+
+					if ($print_calls > 0)
+						{
+						echo "$row[5]\t$row[6]\t$TEMPtalk\n";
+						$PCtemptalk = ($PCtemptalk + $TEMPtalk);
+						}
+					$q++;
+					}
+				else
+					{$out_of_call_time++;}
+				if ($DB)
+					{echo "$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";}
+				$p++;
+				}
+
+
+
+
+
+
+			##### Parse through call records to tally the counts
+			$p=0;
+			while ($p < $u)
+				{
+				$call_date = explode(" ", $CPcall_date[$p]);
+				$call_time = ereg_replace("[^0-9]","",$call_date[1]);
+				$epoch = $CPepoch[$p];
+				$Cwday = date("w", $epoch);
+
+				$CTstart = $Gct_default_start . "00";
+				$CTstop = $Gct_default_stop . "59";
+
+				if ( ($Cwday == 0) and ( ($Gct_sunday_start > 0) and ($Gct_sunday_stop > 0) ) )
+					{$CTstart = $Gct_sunday_start . "00";   $CTstop = $Gct_sunday_stop . "59";}
+				if ( ($Cwday == 1) and ( ($Gct_monday_start > 0) and ($Gct_monday_stop > 0) ) )
+					{$CTstart = $Gct_monday_start . "00";   $CTstop = $Gct_monday_stop . "59";}
+				if ( ($Cwday == 2) and ( ($Gct_tuesday_start > 0) and ($Gct_tuesday_stop > 0) ) )
+					{$CTstart = $Gct_tuesday_start . "00";   $CTstop = $Gct_tuesday_stop . "59";}
+				if ( ($Cwday == 3) and ( ($Gct_wednesday_start > 0) and ($Gct_wednesday_stop > 0) ) )
+					{$CTstart = $Gct_wednesday_start . "00";   $CTstop = $Gct_wednesday_stop . "59";}
+				if ( ($Cwday == 4) and ( ($Gct_thursday_start > 0) and ($Gct_thursday_stop > 0) ) )
+					{$CTstart = $Gct_thursday_start . "00";   $CTstop = $Gct_thursday_stop . "59";}
+				if ( ($Cwday == 5) and ( ($Gct_friday_start > 0) and ($Gct_friday_stop > 0) ) )
+					{$CTstart = $Gct_friday_start . "00";   $CTstop = $Gct_friday_stop . "59";}
+				if ( ($Cwday == 6) and ( ($Gct_saturday_start > 0) and ($Gct_saturday_stop > 0) ) )
+					{$CTstart = $Gct_saturday_start . "00";   $CTstop = $Gct_saturday_stop . "59";}
+
+				$Chour = date("G", $epoch);
+				$Cmin = date("i", $epoch);
+				if ($interval_count==96)
+					{
+					$ChourX = ($Chour * 4);
+					if ($Cmin < 15) {$Cmin = "00"; $CminX = 0;}
+					if ( ($Cmin >= 15) and ($Cmin < 30) ) {$Cmin = "15"; $CminX = 1;}
+					if ( ($Cmin >= 30) and ($Cmin < 45) ) {$Cmin = "30"; $CminX = 2;}
+					if ($Cmin >= 45) {$Cmin = "45"; $CminX = 3;}
+					$Chour = ($ChourX + $CminX);
+					}
+				if ($interval_count==48)
+					{
+					$ChourX = ($Chour * 2);
+					if ($Cmin < 30) {$Cmin = "00"; $CminX = 0;}
+					if ($Cmin >= 30) {$Cmin = "30"; $CminX = 1;}
+					$Chour = ($ChourX + $CminX);
+					}
+
+				if ( ($call_time > $CTstart) and ($call_time < $CTstop) )
+					{
+					$calls_count[$i]++;
+					$length_in_sec[$i] =	($length_in_sec[$i] + $CPlength_in_sec[$p]);
+					$Hlength_in_sec[$Chour] =	($Hlength_in_sec[$Chour] + $row[1]);
+					$Hqueue_seconds[$Chour] =	($Hqueue_seconds[$Chour] + $row[2]);
+					$TEMPtalk = $CPlength_in_sec[$p];
+					if ($TEMPtalk < 0) {$TEMPtalk = 0;}
+					$talk_sec[$i] =	($talk_sec[$i] + $TEMPtalk);
+					$Htalk_sec[$Chour] =	($Htalk_sec[$Chour] + $TEMPtalk);
+
+					$Hcalls_count[$Chour]++;
+					if (eregi("DROP",$CPstatus[$p]))
+						{
+						if ($CPin_out[$p] == 'OUT')
+							{
+							$drop_count_OUT[$i]++;
+							$Hdrop_count_OUT[$Chour]++;
+							}
+						$drop_count[$i]++;
+						$Hdrop_count[$Chour]++;
+						}
+					else
+						{
+						$answer_count[$i]++;
+						$Hanswer_count[$Chour]++;
+						}
+					if (eregi("\|$CPstatus[$p]\|",'|NA|NEW|QUEUE|INCALL|DROP|XDROP|AA|AM|AL|AFAX|AB|ADC|DNCL|DNCC|PU|PM|SVYEXT|SVYHU|SVYVM|SVYREC|QVMAIL|'))
+						{
+						$system_count[$i]++;
+						$Hsystem_count[$Chour]++;
+						}
+					else
+						{
+						$agent_count[$i]++;
+						$Hagent_count[$Chour]++;
+						}
+					if ($CPstatus[$p] == 'NA')
+						{
+						$na_count[$i]++;
+						$Hna_count[$Chour]++;
+						}
+					if ($CPin_out[$p] == 'IN')
+						{
+						$calls_count_IN[$i]++;
+						$Hcalls_count_IN[$Chour]++;
+						}
+
+					$k=0;
+					while($k < $sale_ct)
+						{
+						if ($sale_statusesLIST[$k] == $CPstatus[$p])
+							{
+							$ptp_count[$i]++;
+							$Hptp_count[$Chour]++;
+							}
+						$k++;
+						}
+
+					$k=0;
+					while($k < $dnc_ct)
+						{
+						if ($dnc_statusesLIST[$k] == $CPstatus[$p])
+							{
+							$rtp_count[$i]++;
+							$Hrtp_count[$Chour]++;
+							}
+						$k++;
+						}
+
+					$Hcalltime[$Chour]++;
+					
+
+					if ($print_calls > 0)
+						{
+						echo "$row[5]\t$row[6]\t$TEMPtalk\n";
+						$PCtemptalk = ($PCtemptalk + $TEMPtalk);
+						}
+					$q++;
+					}
+				else
+					{$out_of_call_time++;}
+				if ($DB)
+					{echo "$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";}
+				$p++;
+				}
+
+
+			if ( ($answer_count[$i] > 0) and ($talk_sec[$i] > 0) )
+				{$talk_avg[$i] = ($talk_sec[$i] / $answer_count[$i]);}
+			else
+				{$talk_avg[$i] = 0;}
+			if ( ($calls_count[$i] > 0) and ($queue_seconds[$i] > 0) )
+				{$queue_avg[$i] = ($queue_seconds[$i] / $calls_count[$i]);}
+			else
+				{$queue_avg[$i] = 0;}
+
+			if ($print_calls > 0)
+				{
+				$PCtemptalkmin = ($PCtemptalk  / 60);
+				echo "$q\t$PCtemptalk\t$PCtemptalkmin\n";
+				}
+
+			if ( ($calls_count_IN[$i] > 0) and ($drop_count_OUT[$i] > 0) )
+				{
+				$drop_count[$i] = ($drop_count[$i] - $calls_count_IN[$i]);
+				$calls_count[$i] = ($calls_count[$i] - $calls_count_IN[$i]);
+				$system_count[$i] = ($system_count[$i] - $calls_count_IN[$i]);
+				if ($drop_count[$i] < 0)
+					{$drop_count[$i] = 0;}
+				}
+			$TOTcalls_count =			($TOTcalls_count + $calls_count[$i]);
+			$TOTsystem_count =			($TOTsystem_count + $system_count[$i]);
+			$TOTagent_count =			($TOTagent_count + $agent_count[$i]);
+			$TOTptp_count =				($TOTptp_count + $ptp_count[$i]);
+			$TOTrtp_count =				($TOTrtp_count + $rtp_count[$i]);
+			$TOTna_count =				($TOTna_count + $na_count[$i]);
+			$TOTanswer_count =			($TOTanswer_count + $answer_count[$i]);
+			$TOTagent_sec =				($TOTagent_sec + $agent_sec[$i]);
+			$TOTpause_sec =				($TOTpause_sec + $pause_sec[$i]);
+			$TOTtalk_sec =				($TOTtalk_sec + $talk_sec[$i]);
+			$TOTqueue_seconds =			($TOTqueue_seconds + $queue_seconds[$i]);
+			$TOTdrop_count =			($TOTdrop_count + $drop_count[$i]);
+			if ($max_queue_seconds[$i] > $TOTmax_queue_seconds)
+				{$TOTmax_queue_seconds = $max_queue_seconds[$i];}
+
+			$agent_sec[$i] =			sec_convert($agent_sec[$i],'H'); 
+			$pause_sec[$i] =			sec_convert($pause_sec[$i],'H'); 
+			$talk_sec[$i] =				sec_convert($talk_sec[$i],'H'); 
+			$talk_avg[$i] =				sec_convert($talk_avg[$i],'H'); 
+			$queue_seconds[$i] =		sec_convert($queue_seconds[$i],'H'); 
+			$queue_avg[$i] =			sec_convert($queue_avg[$i],'H'); 
+			$max_queue_seconds[$i] =	sec_convert($max_queue_seconds[$i],'H'); 
+
+
+			$groupDISPLAY =	sprintf("%-40s", "$group[$i] - $group_cname[$i]");
+			$gTOTALcalls =	sprintf("%6s", $calls_count[$i]);
+			$gSYSTEMcalls =	sprintf("%6s", $system_count[$i]);
+			$gAGENTcalls =	sprintf("%6s", $agent_count[$i]);
+			$gPTPcalls =	sprintf("%6s", $ptp_count[$i]);
+			$gRTPcalls =	sprintf("%6s", $rtp_count[$i]);
+			if ( ($calls_count[$i] < 1) or ($na_count[$i] < 1) )
+				{$gNApercent=0;}
+			else
+				{$gNApercent = ( ($na_count[$i] / $calls_count[$i]) * 100);}
+			$gNApercent =	sprintf("%6.2f",$gNApercent);
+			$gNAcalls =		sprintf("%6s", $na_count[$i]);
+			$gANSWERcalls =	sprintf("%6s", $answer_count[$i]);
+			$gSUMagent =	sprintf("%10s", $agent_sec[$i]);
+			$gSUMpause =	sprintf("%10s", $pause_sec[$i]);
+			$gSUMtalk =		sprintf("%9s", $talk_sec[$i]);
+			$gAVGtalk =		sprintf("%7s", $talk_avg[$i]);
+			$gSUMqueue =	sprintf("%9s", $queue_seconds[$i]);
+			$gAVGqueue =	sprintf("%7s", $queue_avg[$i]);
+			$gMAXqueue =	sprintf("%7s", $max_queue_seconds[$i]);
+			if ( ($calls_count[$i] < 1) or ($drop_count[$i] < 1) )
+				{$gDROPpercent=0;}
+			else
+				{$gDROPpercent = ( ($drop_count[$i] / $calls_count[$i]) * 100);}
+			$gDROPpercent =		sprintf("%6.2f",$gDROPpercent);
+			$gDROPcalls =	sprintf("%6s", $drop_count[$i]);
+
+			while(strlen($groupDISPLAY)>40) {$groupDISPLAY = substr("$groupDISPLAY", 0, -1);}
+
+			$MAIN .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |";
+			if ($DB) {$MAIN .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";}
+			$MAIN .= "\n";
+
+			### hour by hour sumaries
+			$SUBoutput .= "\n---------- $group[$i] - $group_cname[$i]     INTERVAL BREAKDOWN:\n";
+			$SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+			$SUBoutput .= "|                     |        | SYSTEM | AGENT  |        |        | NO     |        | AGENT      | AGENT      |\n";
+			$SUBoutput .= "|                     | TOTAL  | RELEASE| RELEASE| SALE   | DNC    | ANSWER | DROP   | LOGIN      | PAUSE      |\n";
+			$SUBoutput .= "| INTERVAL            | CALLS  | CALLS  | CALLS  | CALLS  | CALLS  | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
+			$SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+
+			$h=0;
+			while ($h < $interval_count)
+				{
+				if ($Hcalltime[$h] > 0)
+					{
+					if (strlen($Hcalls_count[$h]) < 1)			{$Hcalls_count[$h] = 0;}
+					if (strlen($Hsystem_count[$h]) < 1)			{$Hsystem_count[$h] = 0;}
+					if (strlen($Hagent_count[$h]) < 1)			{$Hagent_count[$h] = 0;}
+					if (strlen($Hptp_count[$h]) < 1)			{$Hptp_count[$h] = 0;}
+					if (strlen($Hrtp_count[$h]) < 1)			{$Hrtp_count[$h] = 0;}
+					if (strlen($Hna_count[$h]) < 1)				{$Hna_count[$h] = 0;}
+					if (strlen($Hanswer_count[$h]) < 1)			{$Hanswer_count[$h] = 0;}
+					if (strlen($Hagent_sec[$h]) < 1)			{$Hagent_sec[$h] = 0;}
+					if (strlen($Hpause_sec[$h]) < 1)			{$Hpause_sec[$h] = 0;}
+					if (strlen($Htalk_sec[$h]) < 1)				{$Htalk_sec[$h] = 0;}
+					if (strlen($Hqueue_seconds[$h]) < 1)		{$Hqueue_seconds[$h] = 0;}
+					if (strlen($Hmax_queue_seconds[$h]) < 1)	{$Hmax_queue_seconds[$h] = 0;}
+					if (strlen($Hdrop_count[$h]) < 1)			{$Hdrop_count[$h] = 0;}
+
+					if ( ($Hcalls_count_IN[$h] > 0) and ($Hdrop_count_OUT[$h] > 0) )
+						{
+						$Hdrop_count[$h] = ($Hdrop_count[$h] - $Hcalls_count_IN[$h]);
+						$Hcalls_count[$h] = ($Hcalls_count[$h] - $Hcalls_count_IN[$h]);
+						$Hsystem_count[$h] = ($Hsystem_count[$h] - $Hcalls_count_IN[$h]);
+						if ($Hdrop_count[$h] < 0)
+							{$Hdrop_count[$h] = 0;}
+						}
+					$hTOTcalls_count =			($hTOTcalls_count + $Hcalls_count[$h]);
+					$hTOTsystem_count =			($hTOTsystem_count + $Hsystem_count[$h]);
+					$hTOTagent_count =			($hTOTagent_count + $Hagent_count[$h]);
+					$hTOTptp_count =			($hTOTptp_count + $Hptp_count[$h]);
+					$hTOTrtp_count =			($hTOTrtp_count + $Hrtp_count[$h]);
+					$hTOTna_count =				($hTOTna_count + $Hna_count[$h]);
+					$hTOTanswer_count =			($hTOTanswer_count + $Hanswer_count[$h]);
+					$hTOTagent_sec =			($hTOTagent_sec + $Hagent_sec[$h]);
+					$hTOTpause_sec =			($hTOTpause_sec + $Hpause_sec[$h]);
+					$hTOTtalk_sec =				($hTOTtalk_sec + $Htalk_sec[$h]);
+					$hTOTqueue_seconds =		($hTOTqueue_seconds + $Hqueue_seconds[$h]);
+					$hTOTdrop_count =			($hTOTdrop_count + $Hdrop_count[$h]);
+					if ($Hmax_queue_seconds[$h] > $hTOTmax_queue_seconds)
+						{$hTOTmax_queue_seconds = $Hmax_queue_seconds[$h];}
+
+					if ( ($Hanswer_count[$h] > 0) and ($Htalk_sec[$h] > 0) )
+						{$Htalk_avg[$h] = ($Htalk_sec[$h] / $Hanswer_count[$h]);}
+					else
+						{$Htalk_avg[$h] = 0;}
+					if ( ($Hcalls_count[$h] > 0) and ($Hqueue_seconds[$h] > 0) )
+						{$Hqueue_avg[$h] = ($Hqueue_seconds[$h] / $Hcalls_count[$h]);}
+					else
+						{$Hqueue_avg[$h] = 0;}
+
+					$Hagent_sec[$h] =			sec_convert($Hagent_sec[$h],'H'); 
+					$Hpause_sec[$h] =			sec_convert($Hpause_sec[$h],'H'); 
+					$Htalk_sec[$h] =			sec_convert($Htalk_sec[$h],'H'); 
+					$Htalk_avg[$h] =			sec_convert($Htalk_avg[$h],'H'); 
+					$Hqueue_seconds[$h] =		sec_convert($Hqueue_seconds[$h],'H'); 
+					$Hqueue_avg[$h] =			sec_convert($Hqueue_avg[$h],'H'); 
+					$Hmax_queue_seconds[$h] =	sec_convert($Hmax_queue_seconds[$h],'H');
+					
+					$hTOTALcalls =	sprintf("%6s", $Hcalls_count[$h]);
+					$hSYSTEMcalls =	sprintf("%6s", $Hsystem_count[$h]);
+					$hAGENTcalls =	sprintf("%6s", $Hagent_count[$h]);
+					$hPTPcalls =	sprintf("%6s", $Hptp_count[$h]);
+					$hRTPcalls =	sprintf("%6s", $Hrtp_count[$h]);
+					if ( ($Hcalls_count[$h] < 1) or ($Hna_count[$h] < 1) )
+						{$hNApercent=0;}
+					else
+						{$hNApercent = ( ($Hna_count[$h] / $Hcalls_count[$h]) * 100);}
+					$hNApercent =		sprintf("%6.2f",$hNApercent);
+					$hNAcalls =		sprintf("%6s", $Hna_count[$h]);
+					$hANSWERcalls =	sprintf("%6s", $Hanswer_count[$h]);
+					$hSUMagent =	sprintf("%10s", $Hagent_sec[$h]);
+					$hSUMpause =	sprintf("%10s", $Hpause_sec[$h]);
+					$hSUMtalk =		sprintf("%9s", $Htalk_sec[$h]);
+					$hAVGtalk =		sprintf("%7s", $Htalk_avg[$h]);
+					$hSUMqueue =	sprintf("%9s", $Hqueue_seconds[$h]);
+					$hAVGqueue =	sprintf("%7s", $Hqueue_avg[$h]);
+					$hMAXqueue =	sprintf("%7s", $Hmax_queue_seconds[$h]);
+					if ( ($Hcalls_count[$h] < 1) or ($Hdrop_count[$h] < 1) )
+						{$hDROPpercent=0;}
+					else
+						{$hDROPpercent = ( ($Hdrop_count[$h] / $Hcalls_count[$h]) * 100);}
+					$hDROPpercent =		sprintf("%6.2f",$hDROPpercent);
+					$hDROPcalls =	sprintf("%6s", $Hdrop_count[$h]);
+					$hPRINT =		sprintf("%19s", $Hcalltime_HHMM[$h]);
+
+					$SUBoutput .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n";
+					if ($DB) {$SUBoutput .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";}
+					}
+
+				$h++;
+				}
+
+			if ( ($hTOTanswer_count > 0) and ($hTOTtalk_sec > 0) )
+				{$hTOTtalk_avg = ($hTOTtalk_sec / $hTOTanswer_count);}
+			else
+				{$hTOTtalk_avg = 0;}
+			if ( ($hTOTcalls_count > 0) and ($hTOTqueue_seconds > 0) )
+				{$hTOTqueue_avg = ($hTOTqueue_seconds / $hTOTcalls_count);}
+			else
+				{$hTOTqueue_avg = 0;}
+
+			$hTOTagent_sec =			sec_convert($hTOTagent_sec,'H'); 
+			$hTOTpause_sec =			sec_convert($hTOTpause_sec,'H'); 
+			$hTOTtalk_sec =				sec_convert($hTOTtalk_sec,'H'); 
+			$hTOTtalk_avg =				sec_convert($hTOTtalk_avg,'H'); 
+			$hTOTqueue_seconds =		sec_convert($hTOTqueue_seconds,'H'); 
+			$hTOTqueue_avg =			sec_convert($hTOTqueue_avg,'H'); 
+			$hTOTmax_queue_seconds =	sec_convert($hTOTmax_queue_seconds,'H'); 
+
+			$hTOTcalls_count =			sprintf("%6s", $hTOTcalls_count);
+			$hTOTsystem_count =			sprintf("%6s", $hTOTsystem_count);
+			$hTOTagent_count =			sprintf("%6s", $hTOTagent_count);
+			$hTOTptp_count =			sprintf("%6s", $hTOTrtp_count);
+			$hTOTrtp_count =			sprintf("%6s", $hTOTptp_count);
+			if ( ($hTOTcalls_count < 1) or ($hTOTna_count < 1) )
+				{$hTOTna_percent=0;}
+			else
+				{$hTOTna_percent = ( ($hTOTna_count / $hTOTcalls_count) * 100);}
+			$hTOTna_percent =			sprintf("%6.2f",$hTOTna_percent);
+			$hTOTna_count =				sprintf("%6s", $hTOTna_count);
+			$hTOTanswer_count =			sprintf("%6s", $hTOTanswer_count);
+			$hTOTagent_sec =			sprintf("%10s", $hTOTagent_sec);
+			$hTOTpause_sec =			sprintf("%10s", $hTOTpause_sec);
+			$hTOTtalk_sec =				sprintf("%9s", $hTOTtalk_sec);
+			$hTOTtalk_avg =				sprintf("%7s", $hTOTtalk_avg);
+			$hTOTqueue_seconds =		sprintf("%9s", $hTOTqueue_seconds);
+			$hTOTqueue_avg =			sprintf("%7s", $hTOTqueue_avg);
+			$hTOTmax_queue_seconds =	sprintf("%7s", $hTOTmax_queue_seconds);
+			if ( ($hTOTcalls_count < 1) or ($hTOTdrop_count < 1) )
+				{$hTOTdrop_percent=0;}
+			else
+				{$hTOTdrop_percent = ( ($hTOTdrop_count / $hTOTcalls_count) * 100);}
+			$hTOTdrop_percent =			sprintf("%6.2f",$hTOTdrop_percent);
+			$hTOTdrop_count =			sprintf("%6s", $hTOTdrop_count);
+
+			$SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+			$SUBoutput .= "| TOTALS              | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n";
+			$SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+
+			$i++;
+			}
+
+		$rawTOTtalk_sec = $TOTtalk_sec;
+		$rawTOTtalk_min = round($rawTOTtalk_sec / 60);
+
+		if ( ($TOTanswer_count > 0) and ($TOTtalk_sec > 0) )
+			{$TOTtalk_avg = ($TOTtalk_sec / $TOTanswer_count);}
+		else
+			{$TOTtalk_avg = 0;}
+		if ( ($TOTcalls_count > 0) and ($TOTqueue_seconds > 0) )
+			{$TOTqueue_avg = ($TOTqueue_seconds / $TOTcalls_count);}
+		else
+			{$TOTqueue_avg = 0;}
+
+		$TOTagent_sec =			sec_convert($TOTagent_sec,'H'); 
+		$TOTpause_sec =			sec_convert($TOTpause_sec,'H'); 
+		$TOTtalk_sec =			sec_convert($TOTtalk_sec,'H'); 
+		$TOTtalk_avg =			sec_convert($TOTtalk_avg,'H'); 
+		$TOTqueue_seconds =		sec_convert($TOTqueue_seconds,'H'); 
+		$TOTqueue_avg =			sec_convert($TOTqueue_avg,'H'); 
+		$TOTmax_queue_seconds =	sec_convert($TOTmax_queue_seconds,'H'); 
+
+		$i =					sprintf("%4s", $i);
+		$TOTcalls_count =		sprintf("%6s", $TOTcalls_count);
+		$TOTsystem_count =		sprintf("%6s", $TOTsystem_count);
+		$TOTagent_count =		sprintf("%6s", $TOTagent_count);
+		$TOTptp_count =			sprintf("%6s", $TOTptp_count);
+		$TOTrtp_count =			sprintf("%6s", $TOTrtp_count);
+		if ( ($TOTcalls_count < 1) or ($TOTna_count < 1) )
+			{$TOTna_percent=0;}
+		else
+			{$TOTna_percent = ( ($TOTna_count / $TOTcalls_count) * 100);}
+		$TOTna_percent =		sprintf("%6.2f",$TOTna_percent);
+		$TOTna_count =			sprintf("%6s", $TOTna_count);
+		$TOTanswer_count =		sprintf("%6s", $TOTanswer_count);
+		$TOTagent_sec =			sprintf("%10s", $TOTagent_sec);
+		$TOTpause_sec =			sprintf("%10s", $TOTpause_sec);
+		$TOTtalk_sec =			sprintf("%9s", $TOTtalk_sec);
+		$TOTtalk_avg =			sprintf("%7s", $TOTtalk_avg);
+		$TOTqueue_seconds =		sprintf("%9s", $TOTqueue_seconds);
+		$TOTqueue_avg =			sprintf("%7s", $TOTqueue_avg);
+		$TOTmax_queue_seconds =	sprintf("%7s", $TOTmax_queue_seconds);
+		if ( ($TOTcalls_count < 1) or ($TOTdrop_count < 1) )
+			{$TOTdrop_percent=0;}
+		else
+			{$TOTdrop_percent = ( ($TOTdrop_count / $TOTcalls_count) * 100);}
+		$TOTdrop_percent =		sprintf("%6.2f",$TOTdrop_percent);
+		$TOTdrop_count =		sprintf("%6s", $TOTdrop_count);
+
+		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+		$MAIN .= "| TOTALS       Campaigns: $i             | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n";
+		$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
+		}
+
+	if ($costformat > 0)
+		{
+		echo "
\n"; + $inbound_cost = ($rawTOTtalk_min * $inbound_rate); + $inbound_cost = sprintf("%8.2f", $inbound_cost); + + echo "INBOUND $query_date to $end_date,   $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n"; + + exit; + } + + + echo "$MAIN"; + echo "$SUBoutput"; + + + + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + echo "\n\nRun Time: $RUNtime seconds\n"; + } + + + + +?> + +
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_VDADstats.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_VDADstats.php new file mode 100644 index 00000000..59814637 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_VDADstats.php @@ -0,0 +1,1458 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# 61215-1139 - Added drop percentage of answered and round-2 decimal +# 71008-1436 - Added shift to be defined in dbconnect.php +# 71218-1155 - Added end_date for multi-day reports +# 80430-1920 - Added Customer hangup cause stats +# 80620-0031 - Fixed human answered calculation for drop perfentage +# 80709-0230 - Added time stats to call statuses +# 80717-2118 - Added calls/hour out of agent login time in status summary +# 80722-2049 - Added Status Category stats +# 81109-2341 - Added Productivity Rating +# 90225-1140 - Changed to multi-campaign capability +# 90310-2034 - Admin header +# 90508-0644 - Changed to PHP long tags +# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion +# 90608-0251 - Added optional carrier codes stats, made graph at bottom optional +# 90806-0001 - Added CI(Customer Interaction/Human Answered) stats, added option to add inbound rollover stats to these +# 90827-1154 - Added List ID breakdown of calls +# 91222-0843 - Fixed ALL-CAMPAIGNS inbound rollover issue(bug #262), and some other bugs +# 100202-1034 - Added statuses to no-answer section +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["print_calls"])) {$print_calls=$_GET["print_calls"];} + elseif (isset($_POST["print_calls"])) {$print_calls=$_POST["print_calls"];} +if (isset($_GET["outbound_rate"])) {$outbound_rate=$_GET["outbound_rate"];} + elseif (isset($_POST["outbound_rate"])) {$outbound_rate=$_POST["outbound_rate"];} +if (isset($_GET["costformat"])) {$costformat=$_GET["costformat"];} + elseif (isset($_POST["costformat"])) {$costformat=$_POST["costformat"];} +if (isset($_GET["include_rollover"])) {$include_rollover=$_GET["include_rollover"];} + elseif (isset($_POST["include_rollover"])) {$include_rollover=$_POST["include_rollover"];} +if (isset($_GET["carrier_stats"])) {$carrier_stats=$_GET["carrier_stats"];} + elseif (isset($_POST["carrier_stats"])) {$carrier_stats=$_POST["carrier_stats"];} +if (isset($_GET["bottom_graph"])) {$bottom_graph=$_GET["bottom_graph"];} + elseif (isset($_POST["bottom_graph"])) {$bottom_graph=$_POST["bottom_graph"];} +if (isset($_GET["agent_hours"])) {$agent_hours=$_GET["agent_hours"];} + elseif (isset($_POST["agent_hours"])) {$agent_hours=$_POST["agent_hours"];} +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["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} +if (strlen($bottom_graph)<2) {$bottom_graph='NO';} +if (strlen($carrier_stats)<2) {$carrier_stats='NO';} +if (strlen($include_rollover)<2) {$include_rollover='NO';} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +##### SERVER CARRIER LOGGING LOOKUP ##### +$stmt = "SELECT count(*) FROM servers where carrier_logging_active='Y' and max_vicidial_trunks > 0;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$srv_conf_ct = mysql_num_rows($rslt); +if ($srv_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $carrier_logging_active = $row[0]; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_names[$i] = $row[1]; + if (ereg("--ALL",$group_string) ) + {$group[$i] = $groups[$i];} + $i++; + } + +$rollover_groups_count=0; +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + + if (eregi("YES",$include_rollover)) + { + $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $in_groups_to_print = mysql_num_rows($rslt); + if ($in_groups_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $group_drop_SQL .= "'$row[0]',"; + + $rollover_groups_count++; + } + } + + $i++; + } +if (strlen($group_drop_SQL) < 2) + {$group_drop_SQL = "''";} +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = ""; + $group_drop_SQL = ""; + } +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_drop_SQL = eregi_replace(",$",'',$group_drop_SQL); + $both_group_SQLand = "and ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )"; + $both_group_SQL = "where ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )"; + $group_SQLand = "and campaign_id IN($group_SQL)"; + $group_SQL = "where campaign_id IN($group_SQL)"; + $group_drop_SQLand = "and campaign_id IN($group_drop_SQL)"; + $group_drop_SQL = "where campaign_id IN($group_drop_SQL)"; + } + +$stmt="select vsc_id,vsc_name from vicidial_status_categories;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statcats_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statcats_to_print) + { + $row=mysql_fetch_row($rslt); + $vsc_id[$i] = $row[0]; + $vsc_name[$i] = $row[1]; + $vsc_count[$i] = 0; + $i++; + } + +$customer_interactive_statuses=''; +$stmt="select status from vicidial_statuses where human_answered='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statha_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statha_to_print) + { + $row=mysql_fetch_row($rslt); + $customer_interactive_statuses .= "'$row[0]',"; + $i++; + } +$stmt="select status from vicidial_campaign_statuses where human_answered='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statha_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statha_to_print) + { + $row=mysql_fetch_row($rslt); + $customer_interactive_statuses .= "'$row[0]',"; + $i++; + } +if (strlen($customer_interactive_statuses)>2) + {$customer_interactive_statuses = substr("$customer_interactive_statuses", 0, -1);} +else + {$customer_interactive_statuses="''";} + +?> + + + + + +\n"; +echo "\n"; + +echo "\n"; +echo "Outbound Stats\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "
Datas:
"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo ""; + +?> + + to
"; + +?> + +
Campanhas:
"; +echo "\n"; +echo "
"; +echo "Include Drop  
Rollover:
"; +echo "\n"; +echo "
Bottom Graph:  
\n"; +echo "
\n"; +if ($carrier_logging_active > 0) + { + echo "
Carrier Stats:  
"; + echo "\n"; + } +echo "
Shift:  
"; +echo "

\n"; +echo "\n"; +echo "
        "; +echo ""; +if (strlen($group[0]) > 1) + { + echo " ALTERAR | \n"; + echo " RELATÓRIOS \n"; + } +else + { + echo " CAMPANHAS | \n"; + echo " RELATÓRIOS \n"; + } +echo "
"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (strlen($group[0]) < 1)
+	{
+	echo "\n\n";
+	echo "POR FAVOR SELECIONE UMA CAMPANHA E UMA DATA ACIMA E CLIQUE EM ENVIAR\n";
+	}
+
+else
+	{
+	if ($shift == 'AM') 
+		{
+		$time_BEGIN=$AM_shift_BEGIN;
+		$time_END=$AM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+		if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+		}
+	if ($shift == 'PM') 
+		{
+		$time_BEGIN=$PM_shift_BEGIN;
+		$time_END=$PM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+		}
+	if ($shift == 'ALL') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+		}
+	$query_date_BEGIN = "$query_date $time_BEGIN";   
+	$query_date_END = "$end_date $time_END";
+
+
+	$OUToutput = '';
+	$OUToutput .= "Outbound Calling Stats                             $NOW_TIME\n";
+
+	$OUToutput .= "\n";
+	$OUToutput .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
+	$OUToutput .= "---------- TOTALS\n";
+
+	$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+
+	$TOTALcallsRAW = $row[0];
+	$TOTALsec =		$row[1];
+	$inTOTALcallsRAW=0;
+	if (eregi("YES",$include_rollover))
+		{
+		$length_in_secZ=0;
+		$queue_secondsZ=0;
+		$agent_alert_delayZ=0;
+		$stmt="select length_in_sec,queue_seconds,agent_alert_delay from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id $group_drop_SQLand;";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$INallcalls_to_printZ = mysql_num_rows($rslt);
+		$y=0;
+		while ($y < $INallcalls_to_printZ)
+			{
+			$row=mysql_fetch_row($rslt);
+
+			$length_in_secZ = $row[0];
+			$queue_secondsZ = $row[1];
+			$agent_alert_delayZ = $row[2];
+
+			$TOTALdelay =		round($agent_alert_delayZ / 1000);
+			$thiscallsec = (($length_in_secZ - $queue_secondsZ) - $TOTALdelay);
+			if ($thiscallsec < 0)
+				{$thiscallsec = 0;}
+			$inTOTALsec =	($inTOTALsec + $thiscallsec);	
+
+			$y++;
+			}
+
+		$inTOTALcallsRAW =	$y;
+		$TOTALsec = ($TOTALsec + $inTOTALsec);
+		$inTOTALcalls =	sprintf("%10s", $inTOTALcallsRAW);
+		}
+
+	$TOTALcalls =	sprintf("%10s", $TOTALcallsRAW);
+	if ( ($row[0] < 1) or ($TOTALsec < 1) )
+		{$average_call_seconds = '         0';}
+	else
+		{
+		$average_call_seconds = ($TOTALsec / $TOTALcallsRAW);
+		$average_call_seconds = round($average_call_seconds, 2);
+		$average_call_seconds =	sprintf("%10s", $average_call_seconds);
+		}
+
+	$OUToutput .= "Total de chamadas desta campanha:             $TOTALcalls\n";
+	$OUToutput .= "Tempo médio das chamadas (seg):               $average_call_seconds\n";
+	if (eregi("YES",$include_rollover))
+		{$OUToutput .= "Calls that went to rollover In-Grupo:         $inTOTALcalls\n";}
+
+
+	$OUToutput .= "\n";
+	$OUToutput .= "---------- RESPOSTA HUMANOAS\n";
+
+	$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN($customer_interactive_statuses) $group_SQLand;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$CIcallsRAW =	$row[0];
+	$CIsec =		$row[1];
+
+	if (eregi("YES",$include_rollover))
+		{
+		$length_in_secZ=0;
+		$queue_secondsZ=0;
+		$agent_alert_delayZ=0;
+		$stmt="select length_in_sec,queue_seconds,agent_alert_delay from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and vicidial_closer_log.status IN($customer_interactive_statuses) $group_drop_SQLand;";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$INallcalls_to_printZ = mysql_num_rows($rslt);
+		$y=0;
+		while ($y < $INallcalls_to_printZ)
+			{
+			$row=mysql_fetch_row($rslt);
+
+			$length_in_secZ = $row[0];
+			$queue_secondsZ = $row[1];
+			$agent_alert_delayZ = $row[2];
+
+			$CIdelay =		round($agent_alert_delayZ / 1000);
+			$thiscallsec = (($length_in_secZ - $queue_secondsZ) - $CIdelay);
+			if ($thiscallsec < 0)
+				{$thiscallsec = 0;}
+			$inCIsec =	($inCIsec + $thiscallsec);	
+
+			$y++;
+			}
+
+		$inCIcallsRAW =	$y;
+		$CIsec = ($CIsec + $inCIsec);
+		$CIcallsRAW = ($CIcallsRAW + $inCIcallsRAW);
+		}
+
+	$CIcalls =	sprintf("%10s", $CIcallsRAW);
+	if ( ($CIcallsRAW < 1) or ($CIsec < 1) )
+		{$average_ci_seconds = '         0';}
+	else
+		{
+		$average_ci_seconds = ($CIsec / $CIcallsRAW);
+		$average_ci_seconds = round($average_ci_seconds, 2);
+		$average_ci_seconds =	sprintf("%10s", $average_ci_seconds);
+		}
+	$CIsec =		sec_convert($CIsec,'H'); 
+
+
+	$OUToutput .= "Total Resposta Humanaed calls for this Campanha: $CIcalls\n";
+	$OUToutput .= "Average Call Length for all HA in seconds:    $average_ci_seconds     Total Time: $CIsec\n";
+
+
+	$OUToutput .= "\n";
+	$OUToutput .= "---------- DERRUBADAS\n";
+
+	$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and status='DROP' and (length_in_sec <= 6000 or length_in_sec is null);";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$DROPcalls =	sprintf("%10s", $row[0]);
+	$DROPcallsRAW =	$row[0];
+	$DROPseconds =	$row[1];
+
+
+	# GET LIST OF ALL STATUS and create SQL from human_answered statuses
+	$q=0;
+	$stmt = "SELECT status,status_name,human_answered,category from vicidial_statuses;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$statuses_to_print = mysql_num_rows($rslt);
+	$p=0;
+	while ($p < $statuses_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$status[$q] =			$row[0];
+		$status_name[$q] =		$row[1];
+		$human_answered[$q] =	$row[2];
+		$category[$q] =			$row[3];
+		$statname_list["$status[$q]"] = "$status_name[$q]";
+		$statcat_list["$status[$q]"] = "$category[$q]";
+		if ($human_answered[$q]=='Y')
+			{$camp_ANS_STAT_SQL .=	 "'$row[0]',";}
+		$q++;
+		$p++;
+		}
+
+	$stmt = "SELECT distinct status,status_name,human_answered,category from vicidial_campaign_statuses $group_SQL;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$statuses_to_print = mysql_num_rows($rslt);
+	$p=0;
+	while ($p < $statuses_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$status[$q] =			$row[0];
+		$status_name[$q] =		$row[1];
+		$human_answered[$q] =	$row[2];
+		$category[$q] =			$row[3];
+		$statname_list["$status[$q]"] = "$status_name[$q]";
+		$statcat_list["$status[$q]"] = "$category[$q]";
+		if ($human_answered[$q]=='Y')
+			{$camp_ANS_STAT_SQL .=	 "'$row[0]',";}
+		$q++;
+		$p++;
+		}
+	$camp_ANS_STAT_SQL = eregi_replace(",$",'',$camp_ANS_STAT_SQL);
+
+
+	$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and status IN($camp_ANS_STAT_SQL);";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$RESPOSTAcalls =	$row[0];
+
+	if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
+		{$DROPpercent = '0';}
+	else
+		{
+		$DROPpercent = (($DROPcallsRAW / $TOTALcalls) * 100);
+		$DROPpercent = round($DROPpercent, 2);
+		}
+
+	if ( ($DROPcalls < 1) or ($RESPOSTAcalls < 1) )
+		{$DROPRESPOSTApercent = '0';}
+	else
+		{
+		$DROPRESPOSTApercent = (($DROPcallsRAW / $RESPOSTAcalls) * 100);
+		$DROPRESPOSTApercent = round($DROPRESPOSTApercent, 2);
+		}
+
+	if ( ($DROPseconds < 1) or ($DROPcallsRAW < 1) )
+		{$average_hold_seconds = '         0';}
+	else
+		{
+		$average_hold_seconds = ($DROPseconds / $DROPcallsRAW);
+		$average_hold_seconds = round($average_hold_seconds, 2);
+		$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
+		}
+
+	$OUToutput .= "Total Outbound DROP Calls:                    $DROPcalls  $DROPpercent%\n";
+	$OUToutput .= "Percent of DROP Calls taken out of Answers:   $DROPcalls / $RESPOSTAcalls  $DROPRESPOSTApercent%\n";
+
+	if (eregi("YES",$include_rollover))
+		{
+		if ( ($DROPcalls < 1) or ($CIcallsRAW < 1) )
+			{$inDROPRESPOSTApercent = '0';}
+		else
+			{
+			$inDROPRESPOSTApercent = (($DROPcallsRAW / $CIcallsRAW) * 100);
+			$inDROPRESPOSTApercent = round($inDROPRESPOSTApercent, 2);
+			}
+
+		$OUToutput .= "Percent of DROP/Answer Calls with Rollover:   $DROPcalls / $CIcallsRAW  $inDROPRESPOSTApercent%\n";
+		}
+
+	$OUToutput .= "Tempo médio das chamadas derrubadas:          $average_hold_seconds\n";
+
+	$stmt = "select closer_campaigns from vicidial_campaigns $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 = eregi_replace(",$",'',$closer_campaignsSQL);
+
+	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($closer_campaignsSQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE');";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$TOTALanswers = ($row[0] + $RESPOSTAcalls);
+
+
+	$stmt = "SELECT sum(wait_sec + talk_sec + dispo_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' $group_SQLand;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$agent_non_pause_sec = $row[0];
+
+	if ($agent_non_pause_sec > 0)
+		{
+		$AVG_RESPOSTAagent_non_pause_sec = (($TOTALanswers / $agent_non_pause_sec) * 60);
+		$AVG_RESPOSTAagent_non_pause_sec = round($AVG_RESPOSTAagent_non_pause_sec, 2);
+		}
+	else
+		{$AVG_RESPOSTAagent_non_pause_sec=0;}
+	$AVG_RESPOSTAagent_non_pause_sec = sprintf("%10s", $AVG_RESPOSTAagent_non_pause_sec);
+
+	$OUToutput .= "Productivity Rating:                          $AVG_RESPOSTAagent_non_pause_sec\n";
+
+
+
+
+	$OUToutput .= "\n";
+	$OUToutput .= "---------- NO RESPOSTAS\n";
+
+	$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and status IN('NA','ADC','AB','CPDB','CPDUK','CPDATB','CPDNA','CPDREJ','CPDINV','CPDSUA','CPDSI','CPDSNC','CPDSR','CPDSUK','CPDSV','CPDERR') and (length_in_sec <= 60 or length_in_sec is null);";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$autoNAcalls =	sprintf("%10s", $row[0]);
+
+	$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and status IN('B','DC','N') and (length_in_sec <= 60 or length_in_sec is null);";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$manualNAcalls =	sprintf("%10s", $row[0]);
+
+	$totalNAcalls = ($autoNAcalls + $manualNAcalls);
+	$totalNAcalls =	sprintf("%10s", $totalNAcalls);
+
+	if ( ($totalNAcalls < 1) or ($TOTALcalls < 1) )
+		{$NApercent = '0';}
+	else
+		{
+		$NApercent = (($totalNAcalls / $TOTALcalls) * 100);
+		$NApercent = round($NApercent, 2);
+		}
+
+	if ( ($row[0] < 1) or ($row[1] < 1) )
+		{$average_na_seconds = '         0';}
+	else
+		{
+		$average_na_seconds = ($row[1] / $row[0]);
+		$average_na_seconds = round($average_na_seconds, 2);
+		$average_na_seconds =	sprintf("%10s", $average_na_seconds);
+		}
+
+	$OUToutput .= "Total NA calls -Busy,Disconnect,RingNoAnswer: $totalNAcalls  $NApercent%\n";
+	$OUToutput .= "Total auto NA calls -system-set:              $autoNAcalls\n";
+	$OUToutput .= "Total manual NA calls -agent-set:             $manualNAcalls\n";
+	$OUToutput .= "Tempo médio das chamadas sem contato:         $average_na_seconds\n";
+
+
+	##############################
+	#########  ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO
+
+	$TOTALcalls = 0;
+
+	$OUToutput .= "\n";
+	$OUToutput .= "---------- ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO\n";
+	$OUToutput .= "+----------------------+------------+\n";
+	$OUToutput .= "| HANGUP REASON        | CALLS      |\n";
+	$OUToutput .= "+----------------------+------------+\n";
+
+	$stmt="select count(*),term_reason from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand group by term_reason;";
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$reasons_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $reasons_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+
+		$TOTALcalls = ($TOTALcalls + $row[0]);
+
+		$REASONcount =	sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);}
+		$reason =	sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);}
+		if (ereg("NONE",$reason))	{$reason = 'NO RESPOSTA           ';}
+		if (ereg("CALLER",$reason)) {$reason = 'CUSTOMER            ';}
+
+		$OUToutput .= "| $reason | $REASONcount |\n";
+
+		$i++;
+		}
+
+	$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+
+	$OUToutput .= "+----------------------+------------+\n";
+	$OUToutput .= "| TOTAL:               | $TOTALcalls |\n";
+	$OUToutput .= "+----------------------+------------+\n";
+
+
+
+
+
+	##############################
+	#########  CALL STATUS STATS
+
+	$TOTALcalls = 0;
+
+	$OUToutput .= "\n";
+	$OUToutput .= "---------- CALL STATUS STATS\n";
+	$OUToutput .= "+--------+----------------------+----------------------+------------+----------------------------------+----------+\n";
+	$OUToutput .= "|        |                      |                      |            |      CALL TIME                   |AGENTE TIME|\n";
+	$OUToutput .= "| STATUS | DESCRIPTION          | CATEGORIA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|CALLS/HOUR|\n";
+	$OUToutput .= "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
+
+	$campaignSQL = "$group_SQLand";
+	if (eregi("YES",$include_rollover))
+		{$campaignSQL = "$both_group_SQLand";}
+	## Pull the count of agent seconds for the total tally
+	$stmt="SELECT sum(pause_sec + wait_sec + talk_sec + dispo_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' $campaignSQL and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000;";
+	$rslt=mysql_query($stmt, $link);
+	$Ctally_to_print = mysql_num_rows($rslt);
+	if ($Ctally_to_print > 0) 
+		{
+		$rowx=mysql_fetch_row($rslt);
+		$AGENTsec = "$rowx[0]";
+		}
+	if ($DB) {$OUToutput .= "$AGENTsec|$Ctally_to_print|$stmt\n";}
+
+
+	## get counts and time totals for all statuses in this campaign
+	$rollover_exclude_dropSQL='';
+	if (eregi("YES",$include_rollover))
+		{$rollover_exclude_dropSQL = "and status NOT IN('DROP')";}
+	$stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $rollover_exclude_dropSQL $group_SQLand group by status;";
+
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$statuses_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $statuses_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$STATUScountARY[$i] =	$row[0];
+		$RAWstatusARY[$i] =		$row[1];
+		$RAWhoursARY[$i] =		$row[2];
+		$statusSQL .=			"'$row[1]',";
+		$i++;
+		}
+	if (eregi("YES",$include_rollover))
+		{
+		if (strlen($statusSQL) < 2)
+			{$statusSQL = "''";}
+		else
+			{
+			$statusSQL = eregi_replace(",$",'',$statusSQL);
+			}
+		$stmt="select distinct status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN($statusSQL) $group_drop_SQLand;";
+		$rslt=mysql_query($stmt, $link);
+		$inS_statuses_to_print = mysql_num_rows($rslt);
+		$n=0;
+		while ($inS_statuses_to_print > $n) 
+			{
+			$rowx=mysql_fetch_row($rslt);
+			$STATUScountARY[$i] =	0;
+			$RAWstatusARY[$i] =		$rowx[0];
+			$RAWhoursARY[$i] =		0;
+			$i++;
+			$n++;
+			$statuses_to_print++;
+			}
+		}
+
+
+	$i=0;
+	while ($i < $statuses_to_print)
+		{
+		$STATUScount = $STATUScountARY[$i];
+		$RAWstatus = $RAWstatusARY[$i];
+		$RAWhours = $RAWhoursARY[$i];
+
+		if (eregi("YES",$include_rollover))
+			{
+			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status='$RAWstatus' $group_drop_SQLand;";
+			$rslt=mysql_query($stmt, $link);
+			$in_statuses_to_print = mysql_num_rows($rslt);
+			if ($in_statuses_to_print > 0) 
+				{
+				$rowx=mysql_fetch_row($rslt);
+				$inSTATUScount =	$rowx[0];
+				$inRAWhours =		$rowx[1];
+
+				$STATUScount = ($STATUScount + $inSTATUScount);
+				$RAWhours = ($RAWhours + $inRAWhours);
+				}
+			}
+
+		$r=0;
+		while ($r < $statcats_to_print)
+			{
+			if ($statcat_list[$RAWstatus] == "$vsc_id[$r]")
+				{
+				$vsc_count[$r] = ($vsc_count[$r] + $STATUScount);
+				}
+			$r++;
+			}
+		if ($AGENTsec < 1) {$AGENTsec=1;}
+		$TOTALcalls =	($TOTALcalls + $STATUScount);
+		$TOTALtimeS =	($TOTALtimeS + $RAWhours);
+		$STATUSrate =	($STATUScount / ($TOTALsec / 3600) );
+			$STATUSrate =	sprintf("%.2f", $STATUSrate);
+		$AGENTrate =	($STATUScount / ($AGENTsec / 3600) );
+			$AGENTrate =	sprintf("%.2f", $AGENTrate);
+
+		$STATUShours =		sec_convert($RAWhours,'H'); 
+		$STATUSavg_sec =	($RAWhours / $STATUScount); 
+		$STATUSavg =		sec_convert($STATUSavg_sec,'H'); 
+
+		$STATUScount =	sprintf("%10s", $STATUScount);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
+		$status =	sprintf("%-6s", $RAWstatus);while(strlen($status)>6) {$status = substr("$status", 0, -1);}
+		$STATUShours =	sprintf("%10s", $STATUShours);while(strlen($STATUShours)>10) {$STATUShours = substr("$STATUShours", 0, -1);}
+		$STATUSavg =	sprintf("%8s", $STATUSavg);while(strlen($STATUSavg)>8) {$STATUSavg = substr("$STATUSavg", 0, -1);}
+		$STATUSrate =	sprintf("%8s", $STATUSrate);while(strlen($STATUSrate)>8) {$STATUSrate = substr("$STATUSrate", 0, -1);}
+		$AGENTrate =	sprintf("%8s", $AGENTrate);while(strlen($AGENTrate)>8) {$AGENTrate = substr("$AGENTrate", 0, -1);}
+
+		if ($non_latin < 1)
+			{
+			$status_name =	sprintf("%-20s", $statname_list[$RAWstatus]); 
+			while(strlen($status_name)>20) {$status_name = substr("$status_name", 0, -1);}	
+			$statcat =	sprintf("%-20s", $statcat_list[$RAWstatus]); 
+			while(strlen($statcat)>20) {$statcat = substr("$statcat", 0, -1);}	
+			}
+		else
+			{
+			$status_name =	sprintf("%-60s", $statname_list[$RAWstatus]); 
+			while(mb_strlen($status_name,'utf-8')>20) {$status_name = mb_substr("$status_name", 0, -1,'utf-8');}	
+			$statcat =	sprintf("%-60s", $statcat_list[$RAWstatus]); 
+			while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');}	
+			}
+
+		$OUToutput .= "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate | $AGENTrate |\n";
+
+		$i++;
+		}
+
+	if ($TOTALcalls < 1)
+		{
+		$TOTALhours =	'0:00:00';
+		$TOTALavg =		'0:00:00';
+		$TOTALrate =	'0.00';
+		}
+	else
+		{
+		$TOTALrate =	($TOTALcalls / ($TOTALsec / 3600) );
+			$TOTALrate =	sprintf("%.2f", $TOTALrate);
+		$aTOTALrate =	($TOTALcalls / ($AGENTsec / 3600) );
+			$aTOTALrate =	sprintf("%.2f", $aTOTALrate);
+
+		$aTOTALhours =		sec_convert($AGENTsec,'H'); 
+		$TOTALhours =		sec_convert($TOTALtimeS,'H'); 
+		$TOTALavg_sec =		($TOTALtimeS / $TOTALcalls);
+		$TOTALavg =			sec_convert($TOTALavg_sec,'H'); 
+		}
+	$TOTALcalls =	sprintf("%10s", $TOTALcalls);
+	$TOTALhours =	sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTALhours = substr("$TOTALhours", 0, -1);}
+	$aTOTALhours =	sprintf("%10s", $aTOTALhours);while(strlen($aTOTALhours)>10) {$aTOTALhours = substr("$aTOTALhours", 0, -1);}
+	$TOTALavg =	sprintf("%8s", $TOTALavg);while(strlen($TOTALavg)>8) {$TOTALavg = substr("$TOTALavg", 0, -1);}
+	$TOTALrate =	sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);}
+	$aTOTALrate =	sprintf("%8s", $aTOTALrate);while(strlen($aTOTALrate)>8) {$aTOTALrate = substr("$aTOTALrate", 0, -1);}
+
+	$OUToutput .= "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
+	$OUToutput .= "| TOTAL:                                               | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |          |\n";
+#	$OUToutput .= "|   AGENT TIME                                                      | $aTOTALhours |                     | $aTOTALrate |\n";
+	$OUToutput .= "+------------------------------------------------------+------------+------------+---------------------+----------+\n";
+
+
+
+
+
+	##############################
+	#########  ID DA LISTA BREAKDOWN STATS
+
+	$TOTALcalls = 0;
+
+	$OUToutput .= "\n";
+	$OUToutput .= "---------- ID DA LISTA STATS\n";
+	$OUToutput .= "+------------------------------------------+------------+\n";
+	$OUToutput .= "| LIST                                     | CALLS      |\n";
+	$OUToutput .= "+------------------------------------------+------------+\n";
+
+	$stmt="select count(*),list_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand group by list_id;";
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$listids_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $listids_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$LISTIDcalls[$i] =	$row[0];
+		$LISTIDlists[$i] =	$row[1];
+		$i++;
+		}
+
+	$i=0;
+	while ($i < $listids_to_print)
+		{
+		$stmt="select list_name from vicidial_lists where list_id='$LISTIDlists[$i]';";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {$OUToutput .= "$stmt\n";}
+		$list_name_to_print = mysql_num_rows($rslt);
+		if ($list_name_to_print > 0)
+			{
+			$row=mysql_fetch_row($rslt);
+			$LISTIDlist_names[$i] =	$row[0];
+			}
+
+		$TOTALcalls = ($TOTALcalls + $LISTIDcalls[$i]);
+
+		$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);}
+
+		$OUToutput .= "| $LISTIDname | $LISTIDcount |\n";
+
+		$i++;
+		}
+
+	$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+
+	$OUToutput .= "+------------------------------------------+------------+\n";
+	$OUToutput .= "| TOTAL:                                   | $TOTALcalls |\n";
+	$OUToutput .= "+------------------------------------------+------------+\n";
+
+
+
+
+
+	if ( ($carrier_logging_active > 0) and ($carrier_stats == 'YES') )
+		{
+		##############################
+		#########  STATUS CATEGORIA STATS
+
+		$OUToutput .= "\n";
+		$OUToutput .= "---------- CARRIER CALL STATUS\n";
+		$OUToutput .= "+----------------------+------------+\n";
+		$OUToutput .= "| STATUS               | CALLS      |\n";
+		$OUToutput .= "+----------------------+------------+\n";
+
+		## get counts and time totals for all statuses in this campaign
+		$stmt="select dialstatus,count(*) from vicidial_carrier_log vcl,vicidial_log vl where vcl.uniqueid=vl.uniqueid and vcl.call_date > \"$query_date_BEGIN\" and vcl.call_date < \"$query_date_END\" and vl.call_date > \"$query_date_BEGIN\" and vl.call_date < \"$query_date_END\" $group_SQLand group by dialstatus order by dialstatus;";
+		if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {$OUToutput .= "$stmt\n";}
+		$carrierstatuses_to_print = mysql_num_rows($rslt);
+		$i=0;
+		while ($i < $carrierstatuses_to_print)
+			{
+			$row=mysql_fetch_row($rslt);
+			$TOTCARcalls = ($TOTCARcalls + $row[1]);
+			$CARstatus =	sprintf("%-20s", $row[0]); while(strlen($CARstatus)>20) {$CARstatus = substr("$CARstatus", 0, -1);}
+			$CARcount =		sprintf("%10s", $row[1]); while(strlen($CARcount)>10) {$CARcount = substr("$CARcount", 0, -1);}
+
+			$OUToutput .= "| $CARstatus | $CARcount |\n";
+
+			$i++;
+			}
+
+		$TOTCARcalls =	sprintf("%10s", $TOTCARcalls); while(strlen($TOTCARcalls)>10) {$TOTCARcalls = substr("$TOTCARcalls", 0, -1);}
+
+		$OUToutput .= "+----------------------+------------+\n";
+		$OUToutput .= "| TOTAL                | $TOTCARcalls |\n";
+		$OUToutput .= "+----------------------+------------+\n";
+		}
+
+
+	##############################
+	#########  STATUS CATEGORIA STATS
+
+	$OUToutput .= "\n";
+	$OUToutput .= "---------- CUSTOM STATUS CATEGORIA STATS\n";
+	$OUToutput .= "+----------------------+------------+--------------------------------+\n";
+	$OUToutput .= "| CATEGORIA             | CALLS      | DESCRIPTION                    |\n";
+	$OUToutput .= "+----------------------+------------+--------------------------------+\n";
+
+
+	$TOTCATcalls=0;
+	$r=0;
+	while ($r < $statcats_to_print)
+		{
+		if ($vsc_id[$r] != 'UNDEFINED')
+			{
+			$TOTCATcalls = ($TOTCATcalls + $vsc_count[$r]);
+			$category =	sprintf("%-20s", $vsc_id[$r]); while(strlen($category)>20) {$category = substr("$category", 0, -1);}
+			$CATcount =	sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);}
+			$CATname =	sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);}
+
+			$OUToutput .= "| $category | $CATcount | $CATname |\n";
+			}
+		$r++;
+		}
+
+	$TOTCATcalls =	sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);}
+
+	$OUToutput .= "+----------------------+------------+--------------------------------+\n";
+	$OUToutput .= "| TOTAL                | $TOTCATcalls |\n";
+	$OUToutput .= "+----------------------+------------+\n";
+
+
+
+	##############################
+	#########  USER STATS
+
+	$TOTagents=0;
+	$TOTcalls=0;
+	$TOTtime=0;
+	$TOTavg=0;
+
+	$OUToutput .= "\n";
+	$OUToutput .= "---------- AGENTE STATS\n";
+	$OUToutput .= "+--------------------------+------------+------------+--------+\n";
+	$OUToutput .= "| AGENTE                    | CALLS      | TIME H:M:S |AVERAGE |\n";
+	$OUToutput .= "+--------------------------+------------+------------+--------+\n";
+
+	$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$users_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $users_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+
+		$RAWuser[$i] =			$row[0];
+		$RAWfull_name[$i] =		$row[1];
+		$RAWuser_calls[$i] =	$row[2];
+		$RAWuser_talk[$i] =		$row[3];
+		$RAWuser_average[$i] =	$row[4];
+
+		$TOTcalls = ($TOTcalls + $row[2]);
+		$TOTtime = ($TOTtime + $row[3]);
+
+		$i++;
+		}
+
+	$i=0;
+	while ($i < $users_to_print)
+		{
+		$user =	sprintf("%-6s", $RAWuser[$i]);while(strlen($user)>6) {$user = substr("$user", 0, -1);}
+		if ($non_latin < 1)
+			{
+			$full_name =	sprintf("%-15s", $RAWfull_name[$i]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}	
+			}
+		else
+			{
+			$full_name =	sprintf("%-45s", $RAWfull_name[$i]); while(mb_strlen($full_name,'utf-8')>15) {$full_name = mb_substr("$full_name", 0, -1,'utf-8');}	
+			}
+		if (eregi("YES",$include_rollover))
+			{
+			$length_in_secZ=0;
+			$queue_secondsZ=0;
+			$agent_alert_delayZ=0;
+			$stmt="select length_in_sec,queue_seconds,agent_alert_delay from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and user='$RAWuser[$i]' $group_drop_SQLand;";
+			$rslt=mysql_query($stmt, $link);
+			if ($DB) {echo "$stmt\n";}
+			$INallcalls_to_printZ = mysql_num_rows($rslt);
+			$y=0;
+			while ($y < $INallcalls_to_printZ)
+				{
+				$row=mysql_fetch_row($rslt);
+
+				$length_in_secZ = $row[0];
+				$queue_secondsZ = $row[1];
+				$agent_alert_delayZ = $row[2];
+
+				$CIdelay =		round($agent_alert_delayZ / 1000);
+				$thiscallsec = (($length_in_secZ - $queue_secondsZ) - $CIdelay);
+				if ($thiscallsec < 0)
+					{$thiscallsec = 0;}
+				$inCIsec =	($inCIsec + $thiscallsec);	
+
+				$y++;
+				}
+
+			$inCIcallsRAW =	$y;
+			$RAWuser_talk[$i] = ($RAWuser_talk[$i] + $inCIsec);
+			$RAWuser_calls[$i] = ($RAWuser_calls[$i] + $inCIcallsRAW);
+
+			$TOTcalls = ($TOTcalls + $inCIcallsRAW);
+			$TOTtime = ($TOTtime + $inCIsec);
+			}
+
+		$USERcalls =	sprintf("%10s", $RAWuser_calls[$i]);
+		$USERtotTALK =	$RAWuser_talk[$i];
+		$USERavgTALK =	round($RAWuser_talk[$i] / $RAWuser_calls[$i]);
+
+		$USERtotTALK_MS =	sec_convert($USERtotTALK,'H'); 
+		$USERavgTALK_MS =	sec_convert($USERavgTALK,'H'); 
+
+		$USERtotTALK_MS =	sprintf("%9s", $USERtotTALK_MS);
+		$USERavgTALK_MS =	sprintf("%6s", $USERavgTALK_MS);
+
+		$OUToutput .= "| $user - $full_name | $USERcalls |  $USERtotTALK_MS | $USERavgTALK_MS |\n";
+
+		$i++;
+		}
+
+	$rawTOTtime = $TOTtime;
+
+	if (!$TOTcalls) {$TOTcalls = 1;}
+	$TOTavg = ($TOTtime / $TOTcalls);
+
+	$TOTavg_MS =	sec_convert($TOTavg,'H'); 
+	$TOTtime_MS =	sec_convert($TOTtime,'H'); 
+
+	$TOTavg =		sprintf("%6s", $TOTavg_MS);
+	$TOTtime =		sprintf("%10s", $TOTtime_MS);
+
+	$TOTagents =		sprintf("%10s", $i);
+	$TOTcalls =			sprintf("%10s", $TOTcalls);
+	$TOTtime =			sprintf("%8s", $TOTtime);
+	$TOTavg =			sprintf("%6s", $TOTavg);
+
+	$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' $group_SQLand;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+
+	$AVGwait = $row[0];
+	$AVGwait_MS =	sec_convert($AVGwait,'H'); 
+	$AVGwait =		sprintf("%6s", $AVGwait_MS);
+
+	$OUToutput .= "+--------------------------+------------+------------+--------+\n";
+	$OUToutput .= "| TOTAL Agentes: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
+	$OUToutput .= "+--------------------------+------------+------------+--------+\n";
+	$OUToutput .= "| Average Wait time between calls                      $AVGwait |\n";
+	$OUToutput .= "+-------------------------------------------------------------+\n";
+
+
+
+	if ($costformat > 0)
+		{
+		$stmt="select campaign_id,phone_number,length_in_sec from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and vicidial_log.user=vicidial_users.user;";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$allcalls_to_print = mysql_num_rows($rslt);
+		$w=0;
+		while ($w < $allcalls_to_print)
+			{
+			$row=mysql_fetch_row($rslt);
+
+			if ($print_calls > 0)
+				{echo "$row[0]\t$row[1]\t$row[2]\n";}
+			$tempTALK = ($tempTALK + $row[2]);
+			$w++;
+			}
+		if (eregi("YES",$include_rollover))
+			{
+			$stmt="select campaign_id,phone_number,length_in_sec,queue_seconds,agent_alert_delay from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id $group_drop_SQLand;";
+			$rslt=mysql_query($stmt, $link);
+			if ($DB) {echo "$stmt\n";}
+			$INallcalls_to_print = mysql_num_rows($rslt);
+			$w=0;
+			while ($w < $INallcalls_to_print)
+				{
+				$row=mysql_fetch_row($rslt);
+
+				if ($print_calls > 0)
+				{	echo "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\n";}
+				$newTALK = ($row[2] - $row[3] - ($row[4] / 1000) );
+				if ($newTALK < 0) {$newTALK = 0;}
+				$tempTALK = ($tempTALK + $newTALK);
+				$w++;
+				}
+			}
+		$tempTALKmin = ($tempTALK  / 60);
+		if ($print_calls > 0)
+			{echo "$w\t$tempTALK\t$tempTALKmin\n";}
+
+		echo "
\n"; + $rawTOTtalk_min = round($tempTALK / 60); + $outbound_cost = ($rawTOTtalk_min * $outbound_rate); + $outbound_cost = sprintf("%8.2f", $outbound_cost); + + echo "SAINTE $query_date to $end_date,   $rawTOTtalk_min minutes at \$$outbound_rate = \$$outbound_cost\n"; + + exit; + } + + + echo "$OUToutput"; + + + + + if ($bottom_graph == 'YES') + { + ############################## + ######### TIME STATS + + echo "\n"; + echo "---------- ESTATÍSTICAS DE TEMPO\n"; + + echo "\n"; + + $hi_hour_count=0; + $last_full_record=0; + $i=0; + $h=0; + while ($i <= 96) + { + $stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' $group_SQLand;"; + $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_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' $group_SQLand and status='DROP';"; + $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_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' $group_SQLand;"; + $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_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' $group_SQLand and status='DROP';"; + $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_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' $group_SQLand;"; + $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_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' $group_SQLand and status='DROP';"; + $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_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' $group_SQLand;"; + $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_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' $group_SQLand and status='DROP';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $drop_count[$i] = $row[0]; + $i++; + $h++; + } + + if ($hi_hour_count < 1) + {$hour_multiplier = 0;} + else + { + $hour_multiplier = (100 / $hi_hour_count); + #$hour_multiplier = round($hour_multiplier, 0); + } + + echo "\n"; + echo "GRÁFICO DO TOTAL DE CHAMADAS FEITAS POR ESSA CAMPANHA A CADA 15 MINUTOS\n"; + + $k=1; + $Mk=0; + $call_scale = '0'; + while ($k <= 102) + { + if ($Mk >= 5) + { + $Mk=0; + if ( ($k < 1) or ($hour_multiplier <= 0) ) + {$scale_num = 100;} + else + { + $scale_num=($k / $hour_multiplier); + $scale_num = round($scale_num, 0); + } + $LENscale_num = (strlen($scale_num)); + $k = ($k + $LENscale_num); + $call_scale .= "$scale_num"; + } + else + { + $call_scale .= " "; + $k++; $Mk++; + } + } + + + echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; + #echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n"; + echo "| HOUR |$call_scale| DROPS | TOTAL |\n"; + echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; + + $ZZ = '00'; + $i=0; + $h=4; + $hour= -1; + $no_lines_yet=1; + + while ($i <= 96) + { + $char_counter=0; + $time = ' '; + if ($h >= 4) + { + $hour++; + $h=0; + if ($hour < 10) {$hour = "0$hour";} + $time = "+$hour$ZZ+"; + } + if ($h == 1) {$time = " 15 ";} + if ($h == 2) {$time = " 30 ";} + if ($h == 3) {$time = " 45 ";} + $Ghour_count = $hour_count[$i]; + if ($Ghour_count < 1) + { + if ( ($no_lines_yet) or ($i > $last_full_record) ) + { + $do_nothing=1; + } + else + { + $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); + echo "|$time|"; + $k=0; while ($k <= 102) {echo " "; $k++;} + echo "| $hour_count[$i] |\n"; + } + } + else + { + $no_lines_yet=0; + $Xhour_count = ($Ghour_count * $hour_multiplier); + $Yhour_count = (99 - $Xhour_count); + + $Gdrop_count = $drop_count[$i]; + if ($Gdrop_count < 1) + { + $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); + + echo "|$time|"; + $k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;} + echo "*X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} + while ($char_counter <= 101) {echo " "; $char_counter++;} + echo "| 0 | $hour_count[$i] |\n"; + + } + else + { + $Xdrop_count = ($Gdrop_count * $hour_multiplier); + + # if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);} + + $XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 ); + + $hour_count[$i] = sprintf("%-5s", $hour_count[$i]); + $drop_count[$i] = sprintf("%-5s", $drop_count[$i]); + + echo "|$time|"; + $k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;} + echo "D"; $char_counter++; + $k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;} + echo "X"; $char_counter++; + $k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;} + while ($char_counter <= 102) {echo " "; $char_counter++;} + echo "| $drop_count[$i] | $hour_count[$i] |\n"; + } + } + + + $i++; + $h++; + } + + + echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n"; + + ### END bottom graph + } + + + + + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $STARTtime); + echo "\nRun Time: $RUNtime seconds\n"; + } + + + +?> + +
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_VICIDIAL_hopperlist.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_VICIDIAL_hopperlist.php new file mode 100644 index 00000000..19a94de6 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_VICIDIAL_hopperlist.php @@ -0,0 +1,167 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 60619-1654 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# 70115-1614 - Added ALT field for vicidial_hopper alt_dial column +# 71029-0852 - Added list_id to the output +# 71030-2118 - Added priority to display +# 90508-0644 - Changed to PHP long tags +# 91023-1540 - Changed to only show hopper status of READY +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($server_ip)) {$server_ip = '10.10.10.15';} + +$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $campaign_id[$i] =$row[0]; + $campaign_name[$i] =$row[1]; + $i++; + } +?> + + + + + +\n"; +echo "Lista De Hopper Report\n"; +echo "
\n"; +#echo "\n"; +#echo "\n"; +echo "\n"; +echo "\n"; +echo "           ALTERAR \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+	{
+	echo "\n\n";
+	echo "POR FAVOR SELECIONE UMA CAMPANHA ACIMA E CLIQUE EM ENVIAR\n";
+	}
+
+else
+	{
+	echo "Lista Online do Hopper                      $NOW_TIME\n";
+
+	echo "\n";
+	echo "---------- TOTALS\n";
+
+	$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+
+	$TOTALcalls =	sprintf("%10s", $row[0]);
+
+	echo "Total de registros no hopper agora:       $TOTALcalls\n";
+
+
+	##############################
+	#########  LEAD STATS
+
+	echo "\n";
+	echo "---------- LEADS IN HOPPER\n";
+	echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
+	echo "|ORDER |PRIORIDADE| LEAD ID   | ID DA LISTA    | PHONE NUM  | STATE | STATUS | COUNT | GMT    | ALT   |\n";
+	echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
+
+	$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.status='READY' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 5000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$users_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $users_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+
+		$FMT_i =		sprintf("%-4s", $i);
+		$lead_id =		sprintf("%-9s", $row[0]);
+		$phone_number =	sprintf("%-10s", $row[1]);
+		$state =		sprintf("%-5s", $row[2]);
+		$status =		sprintf("%-6s", $row[3]);
+		$count =		sprintf("%-5s", $row[4]);
+		$gmt =			sprintf("%-6s", $row[5]);
+		$hopper_id =	sprintf("%-6s", $row[6]);
+		$alt_dial =		sprintf("%-5s", $row[7]);
+		$list_id =		sprintf("%-10s", $row[8]);
+		$priority =		sprintf("%-6s", $row[9]);
+
+		if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";}
+		else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";}
+
+		$i++;
+		}
+
+	echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
+
+	}
+
+
+?>
+
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_days_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_days_detail.php new file mode 100644 index 00000000..dddf0a58 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_days_detail.php @@ -0,0 +1,633 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90206-2202 - First build +# 90225-1051 - Added CSV download option +# 90310-0752 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +if (strlen($shift)<2) {$shift='ALL';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$MT[0]=''; +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select campaign_id from vicidial_campaigns;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + $i++; + } +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$customer_interactive_statuses=''; +$stmt="select status from vicidial_statuses where human_answered='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statha_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statha_to_print) + { + $row=mysql_fetch_row($rslt); + $customer_interactive_statuses .= "|$row[0]"; + $i++; + } +$stmt="select status from vicidial_campaign_statuses where human_answered='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statha_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statha_to_print) + { + $row=mysql_fetch_row($rslt); + $customer_interactive_statuses .= "|$row[0]"; + $i++; + } +if (strlen($customer_interactive_statuses)>0) + {$customer_interactive_statuses .= '|';} + +#$customer_interactive_statuses = '|NI|DNC|CALLBK|AP|SALE|COMP|HAP1|HAP2|HBED|DIED|'; +#$customer_interactive_statuses = '|NI|DNC|CALLBK|XFER|C2|B7|B8|C1|'; + +$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date&shift=$shift&DB=$DB&user=$user$groupQS"; + +if ($file_download < 1) + { + ?> + + + + + + \n"; + echo "\n"; + + echo "\n"; + echo "Agent Status Diário Report\n"; + echo ""; + + $short_header=1; + + require("admin_header.php"); + + echo "\n"; + echo "\n"; + echo "
\n";
+	}
+
+if (strlen($group[0]) < 1)
+	{
+	echo "\n";
+	echo "POR FAVOR SELECIONE UM USUÁRIO E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+	echo " NOTE: stats taken from shift specified\n";
+	}
+
+else
+	{
+	if ($shift == 'AM') 
+		{
+		$time_BEGIN=$AM_shift_BEGIN;
+		$time_END=$AM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+		if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+		}
+	if ($shift == 'PM') 
+		{
+		$time_BEGIN=$PM_shift_BEGIN;
+		$time_END=$PM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+		}
+	if ($shift == 'ALL') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+		}
+	$query_date_BEGIN = "$query_date $time_BEGIN";   
+	$query_date_END = "$end_date $time_END";
+
+	if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
+	else {$ugSQL='';}
+
+	if ($file_download < 1)
+		{
+		echo "Agent Status Diário Report: $user                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- AGENTE Detalhess -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "Agent Status Diário Report: $user                     $NOW_TIME\n";
+		$file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		}
+
+	$statuses='-';
+	$statusesTXT='';
+	$statusesHEAD='';
+	$statusesHTML='';
+	$statusesFILE='';
+	$statusesARY[0]='';
+	$j=0;
+	$dates='-';
+	$datesARY[0]='';
+	$date_namesARY[0]='';
+	$k=0;
+
+	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls,status 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 vicidial_agent_log.user='$user' $group_SQL $user_group_SQL group by date,status order by date,status desc limit 500000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$rows_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $rows_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+
+		if ( ($row[1] > 0) and (strlen($row[2]) > 0) )
+			{
+			$date[$i] =			$row[0];
+			$calls[$i] =		$row[1];
+			$status[$i] =		$row[2];
+			if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) )
+				{
+				$statusesTXT = sprintf("%8s", $status[$i]);
+				$statusesHEAD .= "----------+";
+				$statusesHTML .= " $statusesTXT |";
+				$statusesFILE .= "$statusesTXT,";
+				$statuses .= "$status[$i]-";
+				$statusesARY[$j] = $status[$i];
+				$j++;
+				}
+			if (!eregi("-$date[$i]-", $dates))
+				{
+				$dates .= "$date[$i]-";
+				$datesARY[$k] = $date[$i];
+				$k++;
+				}
+			}
+		$i++;
+		}
+
+	if ($file_download < 1)
+		{
+		echo "LEAD STATS BREAKDOWN:\n";
+		echo "+------------+--------+--------+--------+$statusesHEAD\n";
+		echo "| DATE       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
+		echo "+------------+--------+--------+--------+$statusesHEAD\n";
+		}
+	else
+		{
+		$file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n";
+		}
+
+	### BEGIN loop through each user ###
+	$m=0;
+	$CIScountTOT=0;
+	$DNCcountTOT=0;
+	while ($m < $k)
+		{
+		$Sdate=$datesARY[$m];
+		$Scalls=$calls[$m];
+		$SstatusesHTML='';
+		$SstatusesFILE='';
+		$CIScount=0;
+		$DNCcount=0;
+
+		### BEGIN loop through each status ###
+		$n=0;
+		while ($n < $j)
+			{
+			$Sstatus=$statusesARY[$n];
+			$SstatusTXT='';
+			### BEGIN loop through each stat line ###
+			$i=0; $status_found=0;
+			while ($i < $rows_to_print)
+				{
+	#			if ( (eregi("$date[$i]", $Sdate)) and ($Sstatus=="$status[$i]") )
+				if ( ($Sdate=="$date[$i]") and ($Sstatus=="$status[$i]") )
+					{
+					$Scalls =		($Scalls + $calls[$i]);
+					if (eregi("\|$status[$i]\|",$customer_interactive_statuses))
+						{
+						$CIScount =	($CIScount + $calls[$i]);
+						$CIScountTOT =	($CIScountTOT + $calls[$i]);
+						}
+					if (eregi("DNC", $status[$i]))
+						{
+						$DNCcount =	($DNCcount + $calls[$i]);
+						$DNCcountTOT =	($DNCcountTOT + $calls[$i]);
+						}
+					$SstatusTXT = sprintf("%8s", $calls[$i]);
+					$SstatusesHTML .= " $SstatusTXT |";
+					$SstatusesFILE .= "$SstatusTXT,";
+					$status_found++;
+					}
+				$i++;
+				}
+			if ($status_found < 1)
+				{
+				$SstatusesHTML .= "        0 |";
+				}
+			### END loop through each stat line ###
+			$n++;
+			}
+		### END loop through each status ###
+		$TOTcalls=($TOTcalls + $Scalls);
+
+		$RAWdate = $Sdate;
+		$RAWcalls = $Scalls;
+		$RAWcis = $CIScount;
+		$Scalls =	sprintf("%6s", $Scalls);
+		$CIScount =	sprintf("%6s", $CIScount);
+
+		$Sdate =		sprintf("%-10s", $Sdate);
+			while(strlen($Suser)>10) {$Suser = substr("$Sdate", 0, -1);}
+
+		if ( ($DNCcount < 1) or ($CIScount < 1) )
+			{$DNCcountPCTs=0;}
+		else
+			{
+			$DNCcountPCTs = ( ($DNCcount / $CIScount) * 100);
+			}
+		$RAWdncPCT = $DNCcountPCTs;
+	#	$DNCcountPCTs = round($DNCcountPCTs,2);
+		$DNCcountPCTs = round($DNCcountPCTs);
+		$rawDNCcountPCTs = $DNCcountPCTs;
+	#	$DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs);
+		$DNCcountPCTs = sprintf("%6s", $DNCcountPCTs);
+
+		if ($file_download < 1)
+			{
+			$Toutput = "| $Sdate | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n";
+			}
+		else
+			{
+			$fileToutput = "$RAWdate,$RAWcalls,$RAWcis,$rawDNCcountPCTs%,$SstatusesFILE\n";
+			}
+
+		$TOPsorted_output[$m] = $Toutput;
+		$TOPsorted_outputFILE[$m] = $fileToutput;
+
+		if ($stage == 'ID')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $RAWdate) . '-----' . $m . '-----' . sprintf("%020s", $RAWdate);
+			$TOPsortTALLY[$m]=$RAWcalls;
+			}
+		if ($stage == 'LEADS')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWdate);
+			$TOPsortTALLY[$m]=$RAWcalls;
+			}
+		if ($stage == 'TIME')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWdate);
+			$TOPsortTALLY[$m]=$Stime;
+			}
+		if ($stage == 'CI')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $RAWcis) . '-----' . $m . '-----' . sprintf("%020s", $RAWdate);
+			$TOPsortTALLY[$m]=$RAWcis;
+			}
+		if ($stage == 'DNCCI')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $RAWdncPCT) . '-----' . $m . '-----' . sprintf("%020s", $RAWdate);
+			$TOPsortTALLY[$m]=$RAWdncPCT;
+			}
+		if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage))
+			{
+			if ($file_download < 1)
+				{echo "$Toutput";}
+			else
+				{$file_output .= "$fileToutput";}
+			}
+
+		if ($TOPsortMAX < $TOPsortTALLY[$m]) {$TOPsortMAX = $TOPsortTALLY[$m];}
+
+		$m++;
+		}
+	### END loop through each user ###
+
+	$TOT_AGENTS = sprintf("%4s", $m);
+
+
+	### BEGIN sort through output to display properly ###
+	if (ereg("ID|TIME|LEADS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|LEADS|CI|DNCCI",$stage))
+			{rsort($TOPsort, SORT_NUMERIC);}
+
+		$m=0;
+		while ($m < $k)
+			{
+			$sort_split = explode("-----",$TOPsort[$m]);
+			$i = $sort_split[1];
+			$sort_order[$m] = "$i";
+			if ($file_download < 1)
+				{echo "$TOPsorted_output[$i]";}
+			else
+				{$file_output .= "$TOPsorted_outputFILE[$i]";}
+			$m++;
+			}
+		}
+	### END sort through output to display properly ###
+
+
+
+	###### LAST LINE FORMATTING ##########
+	### BEGIN loop through each status ###
+	$SUMstatusesHTML='';
+	$n=0;
+	while ($n < $j)
+		{
+		$Scalls=0;
+		$Sstatus=$statusesARY[$n];
+		$SUMstatusTXT='';
+		### BEGIN loop through each stat line ###
+		$i=0; $status_found=0;
+		while ($i < $rows_to_print)
+			{
+			if ($Sstatus=="$status[$i]")
+				{
+				$Scalls =		($Scalls + $calls[$i]);
+				$status_found++;
+				}
+			$i++;
+			}
+		### END loop through each stat line ###
+		if ($status_found < 1)
+			{
+			$SUMstatusesHTML .= "        0 |";
+			}
+		else
+			{
+			$SUMstatusTXT = sprintf("%8s", $Scalls);
+			$SUMstatusesHTML .= " $SUMstatusTXT |";
+			$SUMstatusesFILE .= "$SUMstatusTXT,";
+			}
+		$n++;
+		}
+	### END loop through each status ###
+
+	$TOTcalls = sprintf("%7s", $TOTcalls);
+	$CIScountTOT = sprintf("%7s", $CIScountTOT);
+	if ( ($DNCcountTOT < 1) or ($CIScountTOT < 1) )
+		{$DNCcountPCT=0;}
+	else
+		{
+		$DNCcountPCT = ( ($DNCcountTOT / $CIScountTOT) * 100);
+		}
+	#$DNCcountPCT = round($DNCcountPCT,2);
+	$DNCcountPCT = round($DNCcountPCT);
+	#$DNCcountPCT = sprintf("%3.2f", $DNCcountPCT);
+	$DNCcountPCT = sprintf("%6s", $DNCcountPCT);
+
+
+	if ($file_download < 1)
+		{
+		echo "+------------+--------+--------+--------+$statusesHEAD\n";
+		echo "| TOTALS     | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n";
+		echo "+------------+--------+--------+--------+$statusesHEAD\n";
+
+		echo "\n\n
"; + } + else + { + $file_output .= "TOTALS,$TOTcalls,$CIScountTOT,$DNCcountPCT%,$SUMstatusesFILE\n"; + } + } + + +if ($file_download > 0) + { + $US='_'; + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AGENT_DAYS_$user$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$CSVfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + echo "$file_output"; + + exit; + } + + + + +echo "
\n"; +echo "
Datas:
"; +echo "\n"; +echo ""; + +?> + + to
"; + +?> + +
Campanhas:
"; +echo "\n"; +echo "
Usuário:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; +echo ""; +if (strlen($user) > 1) + { + echo " DOWNLOAD | \n"; + echo " USER | \n"; + echo " USER STATS | \n"; + } +else + {echo " USUÁRIOS | \n";} +echo "RELATÓRIOS \n"; +echo "
"; + +echo "
\n\n"; + +echo "
\n"; +echo "\n"; +echo "
\n\n\n\n\n\n\n\n\n\n";
+
+$m=0;
+while ($m < $k)
+	{
+	$sort_split = explode("-----",$TOPsort[$m]);
+	$i = $sort_split[1];
+	$sort_order[$m] = "$i";
+
+	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
+		{echo "              \n";}
+	else
+		{
+		echo "              ";
+		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
+		$h=0;
+		while ($h <= $TOPsortPLOT)
+			{
+			echo " ";
+			$h++;
+			}
+		echo "\n";
+		}
+	$m++;
+	}
+
+echo "\n";
+
+?>
+
+
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_performance.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_performance.php
new file mode 100644
index 00000000..7b42b355
--- /dev/null
+++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_performance.php
@@ -0,0 +1,258 @@
+    LICENSE: AGPLv2
+#
+# CHANGES
+#
+# 60619-1711 - Added variable filtering to eliminate SQL injection attack threat
+#            - Added required user/pass to gain access to this page
+# 70201-1203 - Added non_latin UTF8 output code, widened USER ID to 8 chars
+# 90508-0644 - Changed to PHP long tags
+#
+
+require("dbconnect.php");
+
+$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
+$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
+$PHP_SELF=$_SERVER['PHP_SELF'];
+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["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"];}
+if (isset($_GET["ENVIAR"]))				{$ENVIAR=$_GET["ENVIAR"];}
+	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["ENVIAR"];}
+
+$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
+$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
+
+	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
+	if ($DB) {echo "|$stmt|\n";}
+	if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
+	$rslt=mysql_query($stmt, $link);
+	$row=mysql_fetch_row($rslt);
+	$auth=$row[0];
+
+  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
+	{
+    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
+    Header("HTTP/1.0 401 Unauthorized");
+    echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    exit;
+	}
+
+$NOW_DATE = date("Y-m-d");
+$NOW_TIME = date("Y-m-d H:i:s");
+$STARTtime = date("U");
+if (!isset($group)) {$group = '';}
+if (!isset($query_date)) {$query_date = $NOW_DATE;}
+
+$stmt="select campaign_id from vicidial_campaigns;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$campaigns_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $campaigns_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$groups[$i] =$row[0];
+	$i++;
+	}
+?>
+
+
+
+
+
+\n";
+echo "VICIDIAL: Agent Performance\n";
+echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           ALTERAR | RELATÓRIOS \n"; +echo "
\n\n"; + +echo "
\n";
+
+
+if (!$group)
+{
+echo "\n";
+echo "PLEASE SELECT A SERVIDOR AND DATE-TIME ABOVE AND CLICK ENVIAR\n";
+echo " NOTE: stats taken from 6 hour shift specified\n";
+}
+
+else
+{
+if ($shift == 'AM') 
+	{
+	$query_date_BEGIN = "$query_date 08:45:00";   
+	$query_date_END = "$query_date 15:33:00";
+	$time_BEGIN = "08:45:00";   
+	$time_END = "15:33:00";
+	}
+if ($shift == 'PM') 
+	{
+	$query_date_BEGIN = "$query_date 15:33:00";   
+	$query_date_END = "$query_date 23:15:00";
+	$time_BEGIN = "15:33:00";   
+	$time_END = "23:15:00";
+	}
+
+echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
+
+echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+echo "---------- AGENTS Detalhess -------------\n\n";
+
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "| USER NAME       | ID       | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+
+$stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$rows_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $rows_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$TOTcalls=($TOTcalls + $row[0]);
+	$TOTtotTALK=($TOTtotTALK + $row[1]);
+	$calls[$i] =	sprintf("%-6s", $row[0]);
+
+	if ($non_latin < 1)
+	{
+   	 $full_name[$i]=	sprintf("%-15s", $row[2]); 
+	 while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
+
+	 $user[$i] =		sprintf("%-6s", $row[3]);
+        while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
+       }
+	else
+	{	
+        $full_name[$i]=	sprintf("%-45s", $row[2]); 
+	 while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}
+
+ 	 $user[$i] =		sprintf("%-18s", $row[3]);
+	 while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');}
+	}
+
+	$user[$i] =		sprintf("%-8s", $row[3]);
+	$USERtotTALK =	$row[1];
+	$USERavgTALK =	$row[4];
+
+	$USERtotTALK_M = ($USERtotTALK / 60);
+	$USERtotTALK_M = round($USERtotTALK_M, 2);
+	$USERtotTALK_M_int = intval("$USERtotTALK_M");
+	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
+	$USERtotTALK_S = ($USERtotTALK_S * 60);
+	$USERtotTALK_S = round($USERtotTALK_S, 0);
+	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
+	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
+	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
+
+	$USERavgTALK_M = ($USERavgTALK / 60);
+	$USERavgTALK_M = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M");
+	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
+	$USERavgTALK_S = ($USERavgTALK_S * 60);
+	$USERavgTALK_S = round($USERavgTALK_S, 0);
+	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
+	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
+	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
+	$i++;
+	}
+
+$k=0;
+while($k < $i)
+	{
+	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
+	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+	if ($non_latin > 0)
+	{
+	$rslt=mysql_query("SET NAMES 'UTF8'");
+	}
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$rows_to_print = mysql_num_rows($rslt);
+	$m=0;
+	while ($m < $rows_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
+		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
+		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
+		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
+		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
+		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
+		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
+		$m++;
+		}
+	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctSALE[$k] |\n";
+
+
+
+	$k++;
+	}
+
+	$TOTcalls =	sprintf("%-7s", $TOTcalls);
+
+	$TOTtotTALK_M = ($TOTtotTALK / 60);
+	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
+	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
+	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
+	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
+	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
+	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
+	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
+	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
+		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
+
+	$TOT_A = sprintf("%-5s", $TOT_A);
+	$TOT_B = sprintf("%-5s", $TOT_B);
+	$TOT_DC = sprintf("%-5s", $TOT_DC);
+	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
+	$TOT_N = sprintf("%-5s", $TOT_N);
+	$TOT_NI = sprintf("%-5s", $TOT_NI);
+	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
+
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "|  TOTALS                    | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+
+echo "\n";
+
+}
+
+
+
+?>
+
+
\ No newline at end of file
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_performance_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_performance_detail.php
new file mode 100644
index 00000000..243b9b4d
--- /dev/null
+++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_performance_detail.php
@@ -0,0 +1,875 @@
+    LICENSE: AGPLv2
+#
+# CHANGES
+#
+# 71119-2359 - First build
+# 71121-0144 - Replace existing AST_agent_performance_detail.php script with this one
+#            - Fixed zero division bug
+# 71218-1155 - added end_date for multi-day reports
+# 80428-0144 - UTF8 cleanup
+# 80712-1007 - tally bug fixes and time display change
+# 81030-0346 - Added pause code stats
+# 81030-1924 - Added total non-pause and total logged-in time to pause code section
+# 81108-0716 - fixed user same-name bug
+# 81110-0056 - fixed pause code display bug
+# 90310-2039 - Admin header
+# 90508-0644 - Changed to PHP long tags
+# 90523-0935 - Rewrite of seconds to minutes and hours conversion
+# 90717-1500 - Changed to be multi-campaign, multi-user-group select
+# 90908-1058 - Added DEAD time statistics
+# 100203-1131 - Added CUSTOMER time statistics
+# 100214-1421 - Sort menu alphabetically
+# 100216-0042 - Added popup date selector
+#
+
+require("dbconnect.php");
+require("functions.php");
+
+$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
+$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
+$PHP_SELF=$_SERVER['PHP_SELF'];
+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["group"]))					{$group=$_GET["group"];}
+	elseif (isset($_POST["group"]))			{$group=$_POST["group"];}
+if (isset($_GET["user_group"]))				{$user_group=$_GET["user_group"];}
+	elseif (isset($_POST["user_group"]))	{$user_group=$_POST["user_group"];}
+if (isset($_GET["shift"]))					{$shift=$_GET["shift"];}
+	elseif (isset($_POST["shift"]))			{$shift=$_POST["shift"];}
+if (isset($_GET["stage"]))					{$stage=$_GET["stage"];}
+	elseif (isset($_POST["stage"]))			{$stage=$_POST["stage"];}
+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["ENVIAR"]))					{$ENVIAR=$_GET["ENVIAR"];}
+	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["ENVIAR"];}
+
+
+if (strlen($shift)<2) {$shift='ALL';}
+
+$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date&group=$group&user_group=$user_group&shift=$shift&DB=$DB";
+
+#############################################
+##### START SYSTEM_SETTINGS LOOKUP #####
+$stmt = "SELECT use_non_latin FROM system_settings;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$qm_conf_ct = mysql_num_rows($rslt);
+if ($qm_conf_ct > 0)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	}
+##### END SETTINGS LOOKUP #####
+###########################################
+
+$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
+$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
+
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
+if ($DB) {echo "|$stmt|\n";}
+if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$auth=$row[0];
+
+if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
+	{
+    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
+    Header("HTTP/1.0 401 Unauthorized");
+    echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    exit;
+	}
+
+$MT[0]='';
+$NOW_DATE = date("Y-m-d");
+$NOW_TIME = date("Y-m-d H:i:s");
+$STARTtime = date("U");
+if (!isset($group)) {$group = '';}
+if (!isset($query_date)) {$query_date = $NOW_DATE;}
+if (!isset($end_date)) {$end_date = $NOW_DATE;}
+
+$stmt="select campaign_id from vicidial_campaigns order by campaign_id;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$campaigns_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $campaigns_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$groups[$i] =$row[0];
+	$i++;
+	}
+$stmt="select user_group from vicidial_user_groups order by user_group;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$user_groups_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $user_groups_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$user_groups[$i] =$row[0];
+	$i++;
+	}
+
+$i=0;
+$group_string='|';
+$group_ct = count($group);
+while($i < $group_ct)
+	{
+	$group_string .= "$group[$i]|";
+	$group_SQL .= "'$group[$i]',";
+	$groupQS .= "&group[]=$group[$i]";
+	$i++;
+	}
+if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
+	{$group_SQL = "";}
+else
+	{
+	$group_SQL = eregi_replace(",$",'',$group_SQL);
+	$group_SQL = "and campaign_id IN($group_SQL)";
+	}
+
+$i=0;
+$user_group_string='|';
+$user_group_ct = count($user_group);
+while($i < $user_group_ct)
+	{
+	$user_group_string .= "$user_group[$i]|";
+	$user_group_SQL .= "'$user_group[$i]',";
+	$user_groupQS .= "&user_group[]=$user_group[$i]";
+	$i++;
+	}
+if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) )
+	{$user_group_SQL = "";}
+else
+	{
+	$user_group_SQL = eregi_replace(",$",'',$user_group_SQL);
+	$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
+	}
+
+if ($DB) {echo "$user_group_string|$user_group_ct|$user_groupQS|$i
";} +?> + + + + + +\n"; +echo "\n"; + +echo "\n"; +echo "Agent Performance Detalhes\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "
Datas:
"; +echo "\n"; +echo ""; + +?> + + to
"; + +?> + +
Campanhas:
"; +echo "\n"; +echo "
Grupos de Usuário:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; + +echo "          \n"; +echo " RELATÓRIOS \n"; +echo "\n"; +echo "
"; + +echo "
\n\n"; + + +echo "
\n";
+
+
+if (!$group)
+{
+echo "\n";
+echo "POR FAVOR SELECIONE UMA CAMPANHA E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+echo " NOTE: stats taken from shift specified\n";
+}
+
+else
+{
+if ($shift == 'AM') 
+	{
+	$time_BEGIN=$AM_shift_BEGIN;
+	$time_END=$AM_shift_END;
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+	}
+if ($shift == 'PM') 
+	{
+	$time_BEGIN=$PM_shift_BEGIN;
+	$time_END=$PM_shift_END;
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+	}
+if ($shift == 'ALL') 
+	{
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+	}
+$query_date_BEGIN = "$query_date $time_BEGIN";   
+$query_date_END = "$end_date $time_END";
+
+if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
+else {$ugSQL='';}
+
+echo "Agent Performance Detalhes                        $NOW_TIME\n";
+
+echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+echo "---------- AGENTS Detalhess -------------\n\n";
+
+
+
+
+
+$statuses='-';
+$statusesTXT='';
+$statusesHEAD='';
+$statusesHTML='';
+$statusesARY[0]='';
+$j=0;
+$users='-';
+$usersARY[0]='';
+$user_namesARY[0]='';
+$k=0;
+
+$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_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<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000  $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$rows_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $rows_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+#	$row[0] = ($row[0] - 1);	# subtract 1 for login/logout event compensation
+	
+	$calls[$i] =		$row[0];
+	$talk_sec[$i] =		$row[1];
+	$full_name[$i] =	$row[2];
+	$user[$i] =			$row[3];
+	$pause_sec[$i] =	$row[4];
+	$wait_sec[$i] =		$row[5];
+	$dispo_sec[$i] =	$row[6];
+	$status[$i] =		$row[7];
+	$dead_sec[$i] =		$row[8];
+	$customer_sec[$i] =	($talk_sec[$i] - $dead_sec[$i]);
+	if ($customer_sec[$i] < 1)
+		{$customer_sec[$i]=0;}
+	if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) )
+		{
+		$statusesTXT = sprintf("%8s", $status[$i]);
+		$statusesHEAD .= "----------+";
+		$statusesHTML .= " $statusesTXT |";
+		$statuses .= "$status[$i]-";
+		$statusesARY[$j] = $status[$i];
+		$j++;
+		}
+	if (!eregi("-$user[$i]-", $users))
+		{
+		$users .= "$user[$i]-";
+		$usersARY[$k] = $user[$i];
+		$user_namesARY[$k] = $full_name[$i];
+		$k++;
+		}
+
+	$i++;
+	}
+
+echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n";
+echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
+echo "| USER NAME       | ID       | CALLS  | TIME      | PAUSE    |PAUSAVG | WAIT     |WAITAVG | TALK     |TALKAVG | DISPO    |DISPAVG | DEAD     |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n";
+echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
+
+
+### BEGIN loop through each user ###
+$m=0;
+while ($m < $k)
+	{
+	$Suser=$usersARY[$m];
+	$Sfull_name=$user_namesARY[$m];
+	$Stime=0;
+	$Scalls=0;
+	$Stalk_sec=0;
+	$Spause_sec=0;
+	$Swait_sec=0;
+	$Sdispo_sec=0;
+	$Sdead_sec=0;
+	$Scustomer_sec=0;
+	$SstatusesHTML='';
+
+	### BEGIN loop through each status ###
+	$n=0;
+	while ($n < $j)
+		{
+		$Sstatus=$statusesARY[$n];
+		$SstatusTXT='';
+		### BEGIN loop through each stat line ###
+		$i=0; $status_found=0;
+		while ($i < $rows_to_print)
+			{
+			if ( ($Suser=="$user[$i]") and ($Sstatus=="$status[$i]") )
+				{
+				$Scalls =		($Scalls + $calls[$i]);
+				$Stalk_sec =	($Stalk_sec + $talk_sec[$i]);
+				$Spause_sec =	($Spause_sec + $pause_sec[$i]);
+				$Swait_sec =	($Swait_sec + $wait_sec[$i]);
+				$Sdispo_sec =	($Sdispo_sec + $dispo_sec[$i]);
+				$Sdead_sec =	($Sdead_sec + $dead_sec[$i]);
+				$Scustomer_sec =	($Scustomer_sec + $customer_sec[$i]);
+				$SstatusTXT = sprintf("%8s", $calls[$i]);
+				$SstatusesHTML .= " $SstatusTXT |";
+				$status_found++;
+				}
+			$i++;
+			}
+		if ($status_found < 1)
+			{
+			$SstatusesHTML .= "        0 |";
+			}
+		### END loop through each stat line ###
+		$n++;
+		}
+	### END loop through each status ###
+	$Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec);
+	$TOTcalls=($TOTcalls + $Scalls);
+	$TOTtime=($TOTtime + $Stime);
+	$TOTtotTALK=($TOTtotTALK + $Stalk_sec);
+	$TOTtotWAIT=($TOTtotWAIT + $Swait_sec);
+	$TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec);
+	$TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec);
+	$TOTtotDEAD=($TOTtotDEAD + $Sdead_sec);
+	$TOTtotCUSTOMER=($TOTtotCUSTOMER + $Scustomer_sec);
+	$Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec);
+	if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);}
+		else {$Stalk_avg=0;}
+	if ( ($Scalls > 0) and ($Spause_sec > 0) ) {$Spause_avg = ($Spause_sec/$Scalls);}
+		else {$Spause_avg=0;}
+	if ( ($Scalls > 0) and ($Swait_sec > 0) ) {$Swait_avg = ($Swait_sec/$Scalls);}
+		else {$Swait_avg=0;}
+	if ( ($Scalls > 0) and ($Sdispo_sec > 0) ) {$Sdispo_avg = ($Sdispo_sec/$Scalls);}
+		else {$Sdispo_avg=0;}
+	if ( ($Scalls > 0) and ($Sdead_sec > 0) ) {$Sdead_avg = ($Sdead_sec/$Scalls);}
+		else {$Sdead_avg=0;}
+	if ( ($Scalls > 0) and ($Scustomer_sec > 0) ) {$Scustomer_avg = ($Scustomer_sec/$Scalls);}
+		else {$Scustomer_avg=0;}
+
+	$RAWuser = $Suser;
+	$RAWcalls = $Scalls;
+	$Scalls =	sprintf("%6s", $Scalls);
+
+	if ($non_latin < 1)
+		{
+		$Sfull_name=	sprintf("%-15s", $Sfull_name); 
+		while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
+		$Suser =		sprintf("%-8s", $Suser);
+		while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);}
+		}
+	else
+		{	
+		$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 =	sprintf("%-24s", $Suser);
+		while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
+		}
+
+	$pfUSERtime_MS =		sec_convert($Stime,'H'); 
+	$pfUSERtotTALK_MS =		sec_convert($Stalk_sec,'H'); 
+	$pfUSERavgTALK_MS =		sec_convert($Stalk_avg,'M'); 
+	$USERtotPAUSE_MS =		sec_convert($Spause_sec,'H'); 
+	$USERavgPAUSE_MS =		sec_convert($Spause_avg,'M'); 
+	$USERtotWAIT_MS =		sec_convert($Swait_sec,'H'); 
+	$USERavgWAIT_MS =		sec_convert($Swait_avg,'M'); 
+	$USERtotDISPO_MS =		sec_convert($Sdispo_sec,'H'); 
+	$USERavgDISPO_MS =		sec_convert($Sdispo_avg,'M'); 
+	$USERtotDEAD_MS =		sec_convert($Sdead_sec,'H'); 
+	$USERavgDEAD_MS =		sec_convert($Sdead_avg,'M'); 
+	$USERtotCUSTOMER_MS =	sec_convert($Scustomer_sec,'H'); 
+	$USERavgCUSTOMER_MS =	sec_convert($Scustomer_avg,'M'); 
+
+	$pfUSERtime_MS =		sprintf("%9s", $pfUSERtime_MS);
+	$pfUSERtotTALK_MS =		sprintf("%8s", $pfUSERtotTALK_MS);
+	$pfUSERavgTALK_MS =		sprintf("%6s", $pfUSERavgTALK_MS);
+	$pfUSERtotPAUSE_MS =	sprintf("%8s", $USERtotPAUSE_MS);
+	$pfUSERavgPAUSE_MS =	sprintf("%6s", $USERavgPAUSE_MS);
+	$pfUSERtotWAIT_MS =		sprintf("%8s", $USERtotWAIT_MS);
+	$pfUSERavgWAIT_MS =		sprintf("%6s", $USERavgWAIT_MS);
+	$pfUSERtotDISPO_MS =	sprintf("%8s", $USERtotDISPO_MS);
+	$pfUSERavgDISPO_MS =	sprintf("%6s", $USERavgDISPO_MS);
+	$pfUSERtotDEAD_MS =		sprintf("%8s", $USERtotDEAD_MS);
+	$pfUSERavgDEAD_MS =		sprintf("%6s", $USERavgDEAD_MS);
+	$pfUSERtotCUSTOMER_MS =	sprintf("%8s", $USERtotCUSTOMER_MS);
+	$pfUSERavgCUSTOMER_MS =	sprintf("%6s", $USERavgCUSTOMER_MS);
+	$PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
+
+	$Toutput = "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n";
+
+	$TOPsorted_output[$m] = $Toutput;
+
+	if ($stage == 'ID')
+		{$TOPsort[$m] =	'' . sprintf("%08s", $RAWuser) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);}
+	if ($stage == 'LEADS')
+		{$TOPsort[$m] =	'' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);}
+	if ($stage == 'TIME')
+		{$TOPsort[$m] =	'' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);}
+	if (!ereg("ID|TIME|LEADS",$stage))
+		{echo "$Toutput";}
+
+	$m++;
+	}
+### END loop through each user ###
+
+
+
+### BEGIN sort through output to display properly ###
+if (ereg("ID|TIME|LEADS",$stage))
+	{
+	if (ereg("ID",$stage))
+		{sort($TOPsort, SORT_NUMERIC);}
+	if (ereg("TIME|LEADS",$stage))
+		{rsort($TOPsort, SORT_NUMERIC);}
+
+	$m=0;
+	while ($m < $k)
+		{
+		$sort_split = explode("-----",$TOPsort[$m]);
+		$i = $sort_split[1];
+		$sort_order[$m] = "$i";
+		echo "$TOPsorted_output[$i]";
+		$m++;
+		}
+	}
+### END sort through output to display properly ###
+
+
+
+###### LAST LINE FORMATTING ##########
+### BEGIN loop through each status ###
+$SUMstatusesHTML='';
+$n=0;
+while ($n < $j)
+	{
+	$Scalls=0;
+	$Sstatus=$statusesARY[$n];
+	$SUMstatusTXT='';
+	### BEGIN loop through each stat line ###
+	$i=0; $status_found=0;
+	while ($i < $rows_to_print)
+		{
+		if ($Sstatus=="$status[$i]")
+			{
+			$Scalls =		($Scalls + $calls[$i]);
+			$status_found++;
+			}
+		$i++;
+		}
+	### END loop through each stat line ###
+	if ($status_found < 1)
+		{
+		$SUMstatusesHTML .= "        0 |";
+		}
+	else
+		{
+		$SUMstatusTXT = sprintf("%8s", $Scalls);
+		$SUMstatusesHTML .= " $SUMstatusTXT |";
+		}
+	$n++;
+	}
+### END loop through each status ###
+
+$TOTcalls =	sprintf("%7s", $TOTcalls);
+$TOT_AGENTS = sprintf("%-4s", $m);
+
+if ($TOTtotTALK < 1) {$TOTavgTALK = '0';}
+else {$TOTavgTALK = ($TOTtotTALK / $TOTcalls);}
+if ($TOTtotDISPO < 1) {$TOTavgDISPO = '0';}
+else {$TOTavgDISPO = ($TOTtotDISPO / $TOTcalls);}
+if ($TOTtotDEAD < 1) {$TOTavgDEAD = '0';}
+else {$TOTavgDEAD = ($TOTtotDEAD / $TOTcalls);}
+if ($TOTtotPAUSE < 1) {$TOTavgPAUSE = '0';}
+else {$TOTavgPAUSE = ($TOTtotPAUSE / $TOTcalls);}
+if ($TOTtotWAIT < 1) {$TOTavgWAIT = '0';}
+else {$TOTavgWAIT = ($TOTtotWAIT / $TOTcalls);}
+if ($TOTtotCUSTOMER < 1) {$TOTavgCUSTOMER = '0';}
+else {$TOTavgCUSTOMER = ($TOTtotCUSTOMER / $TOTcalls);}
+
+$TOTtime_MS =		sec_convert($TOTtime,'H'); 
+$TOTtotTALK_MS =	sec_convert($TOTtotTALK,'H'); 
+$TOTtotDISPO_MS =	sec_convert($TOTtotDISPO,'H'); 
+$TOTtotDEAD_MS =	sec_convert($TOTtotDEAD,'H'); 
+$TOTtotPAUSE_MS =	sec_convert($TOTtotPAUSE,'H'); 
+$TOTtotWAIT_MS =	sec_convert($TOTtotWAIT,'H'); 
+$TOTtotCUSTOMER_MS =	sec_convert($TOTtotCUSTOMER,'H'); 
+$TOTavgTALK_MS =	sec_convert($TOTavgTALK,'M'); 
+$TOTavgDISPO_MS =	sec_convert($TOTavgDISPO,'H'); 
+$TOTavgDEAD_MS =	sec_convert($TOTavgDEAD,'H'); 
+$TOTavgPAUSE_MS =	sec_convert($TOTavgPAUSE,'H'); 
+$TOTavgWAIT_MS =	sec_convert($TOTavgWAIT,'H'); 
+$TOTavgCUSTOMER_MS =	sec_convert($TOTavgCUSTOMER,'H'); 
+
+$TOTtime_MS =		sprintf("%10s", $TOTtime_MS);
+$TOTtotTALK_MS =	sprintf("%10s", $TOTtotTALK_MS);
+$TOTtotDISPO_MS =	sprintf("%10s", $TOTtotDISPO_MS);
+$TOTtotDEAD_MS =	sprintf("%10s", $TOTtotDEAD_MS);
+$TOTtotPAUSE_MS =	sprintf("%10s", $TOTtotPAUSE_MS);
+$TOTtotWAIT_MS =	sprintf("%10s", $TOTtotWAIT_MS);
+$TOTtotCUSTOMER_MS =	sprintf("%10s", $TOTtotCUSTOMER_MS);
+$TOTavgTALK_MS =	sprintf("%6s", $TOTavgTALK_MS);
+$TOTavgDISPO_MS =	sprintf("%6s", $TOTavgDISPO_MS);
+$TOTavgDEAD_MS =	sprintf("%6s", $TOTavgDEAD_MS);
+$TOTavgPAUSE_MS =	sprintf("%6s", $TOTavgPAUSE_MS);
+$TOTavgWAIT_MS =	sprintf("%6s", $TOTavgWAIT_MS);
+$TOTavgCUSTOMER_MS =	sprintf("%6s", $TOTavgCUSTOMER_MS);
+
+while(strlen($TOTtime_MS)>10) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
+while(strlen($TOTtotTALK_MS)>10) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
+while(strlen($TOTtotDISPO_MS)>10) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
+while(strlen($TOTtotDEAD_MS)>10) {$TOTtotDEAD_MS = substr("$TOTtotDEAD_MS", 0, -1);}
+while(strlen($TOTtotPAUSE_MS)>10) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
+while(strlen($TOTtotWAIT_MS)>10) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
+while(strlen($TOTtotCUSTOMER_MS)>10) {$TOTtotCUSTOMER_MS = substr("$TOTtotCUSTOMER_MS", 0, -1);}
+while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
+while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
+while(strlen($TOTavgDEAD_MS)>6) {$TOTavgDEAD_MS = substr("$TOTavgDEAD_MS", 0, -1);}
+while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
+while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
+while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);}
+
+
+echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
+echo "|  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 |$SUMstatusesHTML\n";
+echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
+
+echo "\n\n";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+$sub_statuses='-';
+$sub_statusesTXT='';
+$sub_statusesHEAD='';
+$sub_statusesHTML='';
+$sub_statusesARY=$MT;
+$j=0;
+$PCusers='-';
+$PCusersARY=$MT;
+$PCuser_namesARY=$MT;
+$k=0;
+$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<36000  $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$subs_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $subs_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$PCfull_name[$i] =	$row[0];
+	$PCuser[$i] =		$row[1];
+	$PCpause_sec[$i] =	$row[2];
+	$sub_status[$i] =	$row[3];
+	$PCnon_pause_sec[$i] =	$row[4];
+
+#	echo "$sub_status[$i]|$PCpause_sec[$i]\n";
+#	if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) )
+	if (!eregi("-$sub_status[$i]-", $sub_statuses))
+		{
+		$sub_statusesTXT = sprintf("%8s", $sub_status[$i]);
+		$sub_statusesHEAD .= "----------+";
+		$sub_statusesHTML .= " $sub_statusesTXT |";
+		$sub_statuses .= "$sub_status[$i]-";
+		$sub_statusesARY[$j] = $sub_status[$i];
+		$j++;
+		}
+	if (!eregi("-$PCuser[$i]-", $PCusers))
+		{
+		$PCusers .= "$PCuser[$i]-";
+		$PCusersARY[$k] = $PCuser[$i];
+		$PCuser_namesARY[$k] = $PCfull_name[$i];
+		$k++;
+		}
+
+	$i++;
+	}
+
+echo "PAUSE CODE BREAKDOWN:\n";
+echo "+-----------------+----------+----------+----------+----------+  +$sub_statusesHEAD\n";
+echo "| USER NAME       | ID       | TOTAL    | NONPAUSE | PAUSE    |  |$sub_statusesHTML\n";
+echo "+-----------------+----------+----------+----------+----------+  +$sub_statusesHEAD\n";
+
+
+### BEGIN loop through each user ###
+$m=0;
+$Suser_ct = count($usersARY);
+$TOTtotNONPAUSE = 0;
+$TOTtotTOTAL = 0;
+
+while ($m < $k)
+	{
+	$d=0;
+	while ($d < $Suser_ct)
+		{
+		if ($usersARY[$d] === "$PCusersARY[$m]")
+			{$pcPAUSEtotal = $PAUSEtotal[$d];}
+		$d++;
+		}
+	$Suser=$PCusersARY[$m];
+	$Sfull_name=$PCuser_namesARY[$m];
+	$Spause_sec=0;
+	$Snon_pause_sec=0;
+	$Stotal_sec=0;
+	$SstatusesHTML='';
+
+	### BEGIN loop through each status ###
+	$n=0;
+	while ($n < $j)
+		{
+		$Sstatus=$sub_statusesARY[$n];
+		$SstatusTXT='';
+		### BEGIN loop through each stat line ###
+		$i=0; $status_found=0;
+		while ($i < $subs_to_print)
+			{
+			if ( ($Suser=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") )
+				{
+				$Spause_sec =	($Spause_sec + $PCpause_sec[$i]);
+				$Snon_pause_sec =	($Snon_pause_sec + $PCnon_pause_sec[$i]);
+				$Stotal_sec =	($Stotal_sec + $PCnon_pause_sec[$i] + $PCpause_sec[$i]);
+
+				$USERcodePAUSE_MS =		sec_convert($PCpause_sec[$i],'H'); 
+				$pfUSERcodePAUSE_MS =	sprintf("%6s", $USERcodePAUSE_MS);
+
+				$SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS);
+				$SstatusesHTML .= " $SstatusTXT |";
+				$status_found++;
+				}
+			$i++;
+			}
+		if ($status_found < 1)
+			{
+			$SstatusesHTML .= "        0 |";
+			}
+		### END loop through each stat line ###
+		$n++;
+		}
+	### END loop through each status ###
+	$TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec);
+
+	if ($non_latin < 1)
+		{
+		$Sfull_name=	sprintf("%-15s", $Sfull_name); 
+		while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
+		$Suser =		sprintf("%-8s", $Suser);
+		while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);}
+		}
+	else
+		{
+		$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 =	sprintf("%-24s", $Suser);
+		while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
+		}
+
+	$TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec);
+	$TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec);
+
+	$USERtotPAUSE_MS =		sec_convert($Spause_sec,'H'); 
+	$USERtotNONPAUSE_MS =	sec_convert($Snon_pause_sec,'H'); 
+	$USERtotTOTAL_MS =		sec_convert($Stotal_sec,'H'); 
+
+	$pfUSERtotPAUSE_MS =		sprintf("%8s", $USERtotPAUSE_MS);
+	$pfUSERtotNONPAUSE_MS =		sprintf("%8s", $USERtotNONPAUSE_MS);
+	$pfUSERtotTOTAL_MS =		sprintf("%8s", $USERtotTOTAL_MS);
+
+	$BOTTOMoutput = "| $Sfull_name | $Suser | $pfUSERtotTOTAL_MS | $pfUSERtotNONPAUSE_MS | $pfUSERtotPAUSE_MS |  |$SstatusesHTML\n";
+
+	$BOTTOMsorted_output[$m] = $BOTTOMoutput;
+
+	echo "$BOTTOMoutput";
+
+	$m++;
+	}
+### END loop through each user ###
+
+
+
+### BEGIN sort through output to display properly ###
+#if (ereg("ID|TIME|LEADS",$stage))
+#	{
+#	$n=0;
+#	while ($n <= $m)
+#		{
+#		$i = $sort_order[$m];
+#		echo "$BOTTOMsorted_output[$i]";
+#		$m--;
+#		}
+#	}
+### END sort through output to display properly ###
+
+
+
+###### LAST LINE FORMATTING ##########
+### BEGIN loop through each status ###
+$SUMstatusesHTML='';
+$TOTtotPAUSE=0;
+$n=0;
+while ($n < $j)
+	{
+	$Scalls=0;
+	$Sstatus=$sub_statusesARY[$n];
+	$SUMstatusTXT='';
+	### BEGIN loop through each stat line ###
+	$i=0; $status_found=0;
+	while ($i < $subs_to_print)
+		{
+		if ($Sstatus=="$sub_status[$i]")
+			{
+			$Scalls =		($Scalls + $PCpause_sec[$i]);
+			$status_found++;
+			}
+		$i++;
+		}
+	### END loop through each stat line ###
+	if ($status_found < 1)
+		{
+		$SUMstatusesHTML .= "        0 |";
+		}
+	else
+		{
+		$TOTtotPAUSE = ($TOTtotPAUSE + $Scalls);
+
+		$USERsumstatPAUSE_MS =		sec_convert($Scalls,'H'); 
+		$pfUSERsumstatPAUSE_MS =	sprintf("%8s", $USERsumstatPAUSE_MS);
+
+		$SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS);
+		$SUMstatusesHTML .= " $SUMstatusTXT |";
+		}
+	$n++;
+	}
+### END loop through each status ###
+
+	$TOT_AGENTS = sprintf("%-4s", $m);
+
+	$TOTtotPAUSE_MS =		sec_convert($TOTtotPAUSE,'H'); 
+	$TOTtotNONPAUSE_MS =	sec_convert($TOTtotNONPAUSE,'H'); 
+	$TOTtotTOTAL_MS =		sec_convert($TOTtotTOTAL,'H'); 
+
+	$TOTtotPAUSE_MS =		sprintf("%10s", $TOTtotPAUSE_MS);
+	$TOTtotNONPAUSE_MS =	sprintf("%10s", $TOTtotNONPAUSE_MS);
+	$TOTtotTOTAL_MS =		sprintf("%10s", $TOTtotTOTAL_MS);
+
+	while(strlen($TOTtotPAUSE_MS)>10) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
+	while(strlen($TOTtotNONPAUSE_MS)>10) {$TOTtotNONPAUSE_MS = substr("$TOTtotNONPAUSE_MS", 0, -1);}
+	while(strlen($TOTtotTOTAL_MS)>10) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);}
+
+
+echo "+-----------------+----------+----------+----------+----------+  +$sub_statusesHEAD\n";
+echo "|  TOTALS        AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS|  |$SUMstatusesHTML\n";
+echo "+----------------------------+----------+----------+----------+  +$sub_statusesHEAD\n";
+
+echo "\n\n";
+
+}
+
+
+?>
+
+
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_status_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_status_detail.php new file mode 100644 index 00000000..796cea31 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_status_detail.php @@ -0,0 +1,700 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90206-1554 - First build +# 90225-2252 - Added CSV download option +# 90310-2030 - Admin header +# 90508-0644 - Changed to PHP long tags +# 100119-0935 - Fixed bug 291 +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +if (strlen($shift)<2) {$shift='ALL';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$MT[0]=''; +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$campaigns_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + $i++; + } +$stmt="select user_group from vicidial_user_groups order by user_group;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$user_groups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $user_groups[$i] =$row[0]; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + $i++; + } +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and campaign_id IN($group_SQL)"; + } + +$i=0; +$user_group_string='|'; +$user_group_ct = count($user_group); +while($i < $user_group_ct) + { + $user_group_string .= "$user_group[$i]|"; + $user_group_SQL .= "'$user_group[$i]',"; + $user_groupQS .= "&user_group[]=$user_group[$i]"; + $i++; + } +if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) + {$user_group_SQL = "";} +else + { + $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; + } + +if ($DB) {echo "$user_group_string|$user_group_ct|$user_groupQS|$i
";} + +$stmt="select vsc_id,vsc_name from vicidial_status_categories;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statcats_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statcats_to_print) + { + $row=mysql_fetch_row($rslt); + $vsc_id[$i] = $row[0]; + $vsc_name[$i] = $row[1]; + $vsc_count[$i] = 0; + $i++; + } + +$customer_interactive_statuses=''; +$stmt="select status from vicidial_statuses where human_answered='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statha_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statha_to_print) + { + $row=mysql_fetch_row($rslt); + $customer_interactive_statuses .= "|$row[0]"; + $i++; + } +$stmt="select status from vicidial_campaign_statuses where human_answered='Y';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statha_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statha_to_print) + { + $row=mysql_fetch_row($rslt); + $customer_interactive_statuses .= "|$row[0]"; + $i++; + } +if (strlen($customer_interactive_statuses)>0) + {$customer_interactive_statuses .= '|';} + +#$customer_interactive_statuses = '|NI|DNC|CALLBK|AP|SALE|COMP|HAP1|HAP2|HBED|DIED|'; +#$customer_interactive_statuses = '|NI|DNC|CALLBK|XFER|C2|B7|B8|C1|'; + +$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date$groupQS$user_groupQS&shift=$shift&DB=$DB"; + +if ($file_download < 1) + { + ?> + + + + + + \n"; + echo "\n"; + + echo "\n"; + echo "Agent Status Detalhes Report\n"; + echo ""; + + $short_header=1; + + require("admin_header.php"); + + echo "\n"; + echo "\n"; + echo "
\n";
+	}
+
+if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
+	{
+	echo "\n";
+	echo "POR FAVOR SELECIONE UMA CAMPANHA OU GRUPO DE USUÁRIO E PERÍODO ACIMA E CLIQUE ENVIAR\n";
+	echo " NOTE: stats taken from shift specified\n";
+	}
+
+else
+	{
+	if ($shift == 'AM') 
+		{
+		$time_BEGIN=$AM_shift_BEGIN;
+		$time_END=$AM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+		if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+		}
+	if ($shift == 'PM') 
+		{
+		$time_BEGIN=$PM_shift_BEGIN;
+		$time_END=$PM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+		}
+	if ($shift == 'ALL') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+		}
+	$query_date_BEGIN = "$query_date $time_BEGIN";   
+	$query_date_END = "$end_date $time_END";
+
+	if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
+	else {$ugSQL='';}
+
+	if ($file_download < 1)
+		{
+		echo "Agent Status Detalhes Report                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- AGENTE Detalhess -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "Agent Status Detalhes Report                     $NOW_TIME\n";
+		$file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		}
+
+	$statuses='-';
+	$statusesTXT='';
+	$statusesHEAD='';
+	$statusesHTML='';
+	$statusesFILE='';
+	$statusesARY[0]='';
+	$j=0;
+	$users='-';
+	$usersARY[0]='';
+	$user_namesARY[0]='';
+	$k=0;
+
+	$stmt="select count(*) as calls,full_name,vicidial_users.user,status 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 $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$rows_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $rows_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+
+		if ( ($row[0] > 0) and (strlen($row[3]) > 0) and (!eregi("NULL",$row[3])))
+			{
+			$calls[$i] =		$row[0];
+			$full_name[$i] =	$row[1];
+			$user[$i] =			$row[2];
+			$status[$i] =		$row[3];
+			if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) )
+				{
+				$statusesTXT = sprintf("%8s", $status[$i]);
+				$statusesHEAD .= "----------+";
+				$statusesHTML .= " $statusesTXT |";
+				$statusesFILE .= "$statusesTXT,";
+				$statuses .= "$status[$i]-";
+				$statusesARY[$j] = $status[$i];
+				$j++;
+				}
+			if (!eregi("-$user[$i]-", $users))
+				{
+				$users .= "$user[$i]-";
+				$usersARY[$k] = $user[$i];
+				$user_namesARY[$k] = $full_name[$i];
+				$k++;
+				}
+			}
+		$i++;
+		}
+
+	if ($file_download < 1)
+		{
+		echo "CALLS STATS BREAKDOWN:\n";
+		echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
+		echo "| USER NAME       | ID       | CALLS  | CIcalls| DNC/CI%|$statusesHTML\n";
+		echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
+		}
+	else
+		{
+		$file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n";
+		}
+
+
+	### BEGIN loop through each user ###
+	$m=0;
+	$CIScountTOT=0;
+	$DNCcountTOT=0;
+	while ($m < $k)
+		{
+		$Suser=$usersARY[$m];
+		$Sfull_name=$user_namesARY[$m];
+		$Scalls=0;
+		$SstatusesHTML='';
+		$SstatusesFILE='';
+		$CIScount=0;
+		$DNCcount=0;
+
+		### BEGIN loop through each status ###
+		$n=0;
+		while ($n < $j)
+			{
+			$Sstatus=$statusesARY[$n];
+			$SstatusTXT='';
+			### BEGIN loop through each stat line ###
+			$i=0; $status_found=0;
+			while ($i < $rows_to_print)
+				{
+				if ( ($Suser=="$user[$i]") and ($Sstatus=="$status[$i]") )
+					{
+					$Scalls =		($Scalls + $calls[$i]);
+					if (eregi("\|$status[$i]\|",$customer_interactive_statuses))
+						{
+						$CIScount =	($CIScount + $calls[$i]);
+						$CIScountTOT =	($CIScountTOT + $calls[$i]);
+						}
+					if (eregi("DNC", $status[$i]))
+						{
+						$DNCcount =	($DNCcount + $calls[$i]);
+						$DNCcountTOT =	($DNCcountTOT + $calls[$i]);
+						}
+					$SstatusTXT = sprintf("%8s", $calls[$i]);
+					$SstatusesHTML .= " $SstatusTXT |";
+					$SstatusesFILE .= "$SstatusTXT,";
+					$status_found++;
+					}
+				$i++;
+				}
+			if ($status_found < 1)
+				{
+				$SstatusesHTML .= "        0 |";
+				$SstatusesFILE .= "0,";
+				}
+			### END loop through each stat line ###
+			$n++;
+			}
+		### END loop through each status ###
+		$TOTcalls=($TOTcalls + $Scalls);
+
+		$RAWuser = $Suser;
+		$RAWcalls = $Scalls;
+		$RAWcis = $CIScount;
+		$Scalls =	sprintf("%6s", $Scalls);
+		$CIScount =	sprintf("%6s", $CIScount);
+
+		if ($non_latin < 1)
+			{
+			 $Sfull_name=	sprintf("%-15s", $Sfull_name); 
+				while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
+			 $Suser =		sprintf("%-8s", $Suser);
+				while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);}
+			}
+		else
+			{	
+				$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 =	sprintf("%-24s", $Suser);
+			 while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
+			}
+
+		if ( ($DNCcount < 1) or ($CIScount < 1) )
+			{$DNCcountPCTs=0;}
+		else
+			{
+			$DNCcountPCTs = ( ($DNCcount / $CIScount) * 100);
+			}
+		$RAWdncPCT = $DNCcountPCTs;
+	#	$DNCcountPCTs = round($DNCcountPCTs,2);
+		$DNCcountPCTs = round($DNCcountPCTs);
+		$rawDNCcountPCTs = $DNCcountPCTs;
+	#	$DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs);
+		$DNCcountPCTs = sprintf("%6s", $DNCcountPCTs);
+
+		if ($file_download < 1)
+			{
+			$Toutput = "| $Sfull_name | $Suser | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n";
+			}
+		else
+			{
+			$fileToutput = "$Sfull_name,$RAWuser,$RAWcalls,$RAWcis,$rawDNCcountPCTs%,$SstatusesFILE\n";
+			}
+
+		$TOPsorted_output[$m] = $Toutput;
+		$TOPsorted_outputFILE[$m] = $fileToutput;
+
+		if ($stage == 'ID')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $RAWuser) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
+			$TOPsortTALLY[$m]=$RAWcalls;
+			}
+		if ($stage == 'LEADS')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
+			$TOPsortTALLY[$m]=$RAWcalls;
+			}
+		if ($stage == 'TIME')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
+			$TOPsortTALLY[$m]=$Stime;
+			}
+		if ($stage == 'CI')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $RAWcis) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
+			$TOPsortTALLY[$m]=$RAWcis;
+			}
+		if ($stage == 'DNCCI')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $RAWdncPCT) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
+			$TOPsortTALLY[$m]=$RAWdncPCT;
+			}
+		if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage))
+			if ($file_download < 1)
+				{echo "$Toutput";}
+			else
+				{$file_output .= "$fileToutput";}
+
+		if ($TOPsortMAX < $TOPsortTALLY[$m]) {$TOPsortMAX = $TOPsortTALLY[$m];}
+
+		$m++;
+		}
+	### END loop through each user ###
+
+	$TOT_AGENTS = sprintf("%4s", $m);
+
+
+	### BEGIN sort through output to display properly ###
+	if (ereg("ID|TIME|LEADS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|LEADS|CI|DNCCI",$stage))
+			{rsort($TOPsort, SORT_NUMERIC);}
+
+		$m=0;
+		while ($m < $k)
+			{
+			$sort_split = explode("-----",$TOPsort[$m]);
+			$i = $sort_split[1];
+			$sort_order[$m] = "$i";
+			if ($file_download < 1)
+				{echo "$TOPsorted_output[$i]";}
+			else
+				{$file_output .= "$TOPsorted_outputFILE[$i]";}
+			$m++;
+			}
+		}
+	### END sort through output to display properly ###
+
+
+
+	###### LAST LINE FORMATTING ##########
+	### BEGIN loop through each status ###
+	$SUMstatusesHTML='';
+	$n=0;
+	while ($n < $j)
+		{
+		$Scalls=0;
+		$Sstatus=$statusesARY[$n];
+		$SUMstatusTXT='';
+		### BEGIN loop through each stat line ###
+		$i=0; $status_found=0;
+		while ($i < $rows_to_print)
+			{
+			if ($Sstatus=="$status[$i]")
+				{
+				$Scalls =		($Scalls + $calls[$i]);
+				$status_found++;
+				}
+			$i++;
+			}
+		### END loop through each stat line ###
+		if ($status_found < 1)
+			{
+			$SUMstatusesHTML .= "        0 |";
+			}
+		else
+			{
+			$SUMstatusTXT = sprintf("%8s", $Scalls);
+			$SUMstatusesHTML .= " $SUMstatusTXT |";
+			$SUMstatusesFILE .= "$SUMstatusTXT,";
+			}
+		$n++;
+		}
+	### END loop through each status ###
+
+	$TOTcalls = sprintf("%7s", $TOTcalls);
+	$CIScountTOT = sprintf("%7s", $CIScountTOT);
+	$DNCcountPCT = ( ($DNCcountTOT / $CIScountTOT) * 100);
+	$DNCcountPCT = round($DNCcountPCT,2);
+	$DNCcountPCT = sprintf("%3.2f", $DNCcountPCT);
+	if ( ($DNCcountTOT < 1) or ($CIScountTOT < 1) )
+		{$DNCcountPCT=0;}
+	else
+		{
+		$DNCcountPCT = ( ($DNCcountTOT / $CIScountTOT) * 100);
+		}
+	#$DNCcountPCT = round($DNCcountPCT,2);
+	$DNCcountPCT = round($DNCcountPCT);
+	#$DNCcountPCT = sprintf("%3.2f", $DNCcountPCT);
+	$DNCcountPCT = sprintf("%6s", $DNCcountPCT);
+
+	if ($file_download < 1)
+		{
+		echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
+		echo "|  TOTALS        AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n";
+		echo "+----------------------------+--------+--------+--------+$statusesHEAD\n";
+
+		echo "\n\n
"; + } + else + { + $file_output .= "TOTALS,$TOT_AGENTS,$TOTcalls,$CIScountTOT,$DNCcountPCT%,$SUMstatusesFILE\n"; + } + } + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AGENT_STATUS$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$CSVfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + echo "$file_output"; + + exit; + } + + +echo "
\n"; +echo "
Datas:
"; +echo "\n"; +echo ""; + +?> + + to
"; + +?> + +
Campanhas:
"; +echo "\n"; +echo "
Grupos de Usuário:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; + +echo "          \n"; +echo " DOWNLOAD | \n"; +echo " RELATÓRIOS \n"; +echo "\n"; +echo "
"; + +echo "
\n\n"; + +echo "
\n"; +echo "\n"; +echo "
\n\n\n\n\n\n\n\n\n\n";
+
+$m=0;
+while ($m < $k)
+	{
+	$sort_split = explode("-----",$TOPsort[$m]);
+	$i = $sort_split[1];
+	$sort_order[$m] = "$i";
+
+	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
+		{echo "                              \n";}
+	else
+		{
+		echo "                              ";
+		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
+		$h=0;
+		while ($h <= $TOPsortPLOT)
+			{
+			echo " ";
+			$h++;
+			}
+		echo "\n";
+		}
+	$m++;
+	}
+
+echo "\n";
+
+?>
+
+
\ No newline at end of file
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_time_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_time_detail.php
new file mode 100644
index 00000000..bc97301f
--- /dev/null
+++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_time_detail.php
@@ -0,0 +1,910 @@
+    LICENSE: AGPLv2
+#
+# CHANGES
+# 90522-0723 - First build
+# 90908-1103 - Added DEAD time stats
+# 100203-1147 - Added CUSTOMER time statistics
+# 100214-1421 - Sort menu alphabetically
+# 100216-0042 - Added popup date selector
+#
+
+require("dbconnect.php");
+require("functions.php");
+
+$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
+$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
+$PHP_SELF=$_SERVER['PHP_SELF'];
+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["group"]))					{$group=$_GET["group"];}
+	elseif (isset($_POST["group"]))			{$group=$_POST["group"];}
+if (isset($_GET["user_group"]))				{$user_group=$_GET["user_group"];}
+	elseif (isset($_POST["user_group"]))	{$user_group=$_POST["user_group"];}
+if (isset($_GET["shift"]))					{$shift=$_GET["shift"];}
+	elseif (isset($_POST["shift"]))			{$shift=$_POST["shift"];}
+if (isset($_GET["stage"]))					{$stage=$_GET["stage"];}
+	elseif (isset($_POST["stage"]))			{$stage=$_POST["stage"];}
+if (isset($_GET["file_download"]))			{$file_download=$_GET["file_download"];}
+	elseif (isset($_POST["file_download"]))	{$file_download=$_POST["file_download"];}
+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 (strlen($shift)<2) {$shift='ALL';}
+if (strlen($stage)<2) {$stage='NAME';}
+
+#############################################
+##### START SYSTEM_SETTINGS LOOKUP #####
+$stmt = "SELECT use_non_latin FROM system_settings;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$qm_conf_ct = mysql_num_rows($rslt);
+if ($qm_conf_ct > 0)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	}
+##### END SETTINGS LOOKUP #####
+###########################################
+
+$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
+$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
+
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
+if ($DB) {echo "|$stmt|\n";}
+if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$auth=$row[0];
+
+if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
+	{
+    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
+    Header("HTTP/1.0 401 Unauthorized");
+    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    exit;
+	}
+
+$MT[0]='';
+$NOW_DATE = date("Y-m-d");
+$NOW_TIME = date("Y-m-d H:i:s");
+$STARTtime = date("U");
+if (!isset($group)) {$group = '';}
+if (!isset($query_date)) {$query_date = $NOW_DATE;}
+if (!isset($end_date)) {$end_date = $NOW_DATE;}
+
+$stmt="select campaign_id from vicidial_campaigns order by campaign_id;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$campaigns_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $campaigns_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$groups[$i] =$row[0];
+	$i++;
+	}
+$stmt="select user_group from vicidial_user_groups order by user_group;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$user_groups_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $user_groups_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$user_groups[$i] =$row[0];
+	$i++;
+	}
+
+$i=0;
+$group_string='|';
+$group_ct = count($group);
+while($i < $group_ct)
+	{
+	$group_string .= "$group[$i]|";
+	$group_SQL .= "'$group[$i]',";
+	$groupQS .= "&group[]=$group[$i]";
+	$i++;
+	}
+if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
+	{$group_SQL = "";}
+else
+	{
+	$group_SQL = eregi_replace(",$",'',$group_SQL);
+	$group_SQL = "and campaign_id IN($group_SQL)";
+	}
+
+$i=0;
+$user_group_string='|';
+$user_group_ct = count($user_group);
+while($i < $user_group_ct)
+	{
+	$user_group_string .= "$user_group[$i]|";
+	$user_group_SQL .= "'$user_group[$i]',";
+	$user_groupQS .= "&user_group[]=$user_group[$i]";
+	$i++;
+	}
+if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) )
+	{$user_group_SQL = "";}
+else
+	{
+	$user_group_SQL = eregi_replace(",$",'',$user_group_SQL);
+	$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
+	$TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL);
+	$TCuser_group_SQL = "and user_group IN($TCuser_group_SQL)";
+	}
+
+if ($DB) {echo "$user_group_string|$user_group_ct|$user_groupQS|$i
";} + +$stmt="select distinct pause_code,pause_code_name from vicidial_pause_codes;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statha_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statha_to_print) + { + $row=mysql_fetch_row($rslt); + $pause_code[$i] = "$row[0]"; + $pause_code_name[$i] = "$row[1]"; + $i++; + } + +$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date$groupQS$user_groupQS&shift=$shift&DB=$DB"; + +if ($file_download < 1) + { + ?> + + + + + + \n"; + echo "\n"; + + echo "\n"; + echo "Agent Time Detail\n"; + echo ""; + + $short_header=1; + + require("admin_header.php"); + + echo "\n"; + echo "\n"; + echo "
\n";
+	}
+
+if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
+	{
+	echo "\n";
+	echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
+	echo " NOTE: stats taken from shift specified\n";
+	}
+
+else
+	{
+	if ($shift == 'TEST') 
+		{
+		$time_BEGIN = "09:45:00";  
+		$time_END = "10:00:00";
+		}
+	if ($shift == 'AM') 
+		{
+		$time_BEGIN=$AM_shift_BEGIN;
+		$time_END=$AM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+		if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+		}
+	if ($shift == 'PM') 
+		{
+		$time_BEGIN=$PM_shift_BEGIN;
+		$time_END=$PM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+		}
+	if ($shift == 'ALL') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+		}
+	$query_date_BEGIN = "$query_date $time_BEGIN";   
+	$query_date_END = "$end_date $time_END";
+
+	if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
+	else {$ugSQL='';}
+
+	if ($file_download < 1)
+		{
+		echo "Agent Time Detail                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		}
+	else
+		{
+		$file_output .= "Agent Time Detail                     $NOW_TIME\n";
+		$file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		}
+
+
+
+	############################################################################
+	##### BEGIN gathering information from the database section
+	############################################################################
+
+	### BEGIN gather user IDs and names for matching up later
+	$stmt="select full_name,user from vicidial_users order by user limit 100000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$users_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $users_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$ULname[$i] =	$row[0];
+		$ULuser[$i] =	$row[1];
+		$i++;
+		}
+	### END gather user IDs and names for matching up later
+
+
+	### BEGIN gather timeclock records per agent
+	$stmt="select user,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$punches_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $punches_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$TCuser[$i] =	$row[0];
+		$TCtime[$i] =	$row[1];
+		$i++;
+		}
+	### END gather timeclock records per agent
+
+
+	### BEGIN gather pause code information by user IDs
+	$sub_statuses='-';
+	$sub_statusesTXT='';
+	$sub_statusesHEAD='';
+	$sub_statusesHTML='';
+	$sub_statusesFILE='';
+	$sub_statusesARY=$MT;
+	$sub_status_count=0;
+	$PCusers='-';
+	$PCusersARY=$MT;
+	$PCuser_namesARY=$MT;
+	$user_count=0;
+	$stmt="select user,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 30000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$subs_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $subs_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$PCuser[$i] =		$row[0];
+		$PCpause_sec[$i] =	$row[1];
+		$sub_status[$i] =	$row[2];
+
+		if (!eregi("-$sub_status[$i]-", $sub_statuses))
+			{
+			$sub_statusesTXT = sprintf("%10s", $sub_status[$i]);
+			$sub_statusesHEAD .= "------------+";
+			$sub_statusesHTML .= " $sub_statusesTXT |";
+			$sub_statusesFILE .= ",$sub_status[$i]";
+			$sub_statuses .= "$sub_status[$i]-";
+			$sub_statusesARY[$sub_status_count] = $sub_status[$i];
+			$sub_status_count++;
+			}
+		if (!eregi("-$PCuser[$i]-", $PCusers))
+			{
+			$PCusers .= "$PCuser[$i]-";
+			$PCusersARY[$user_count] = $PCuser[$i];
+			$user_count++;
+			}
+
+		$i++;
+		}
+	### END gather pause code information by user IDs
+
+
+	##### BEGIN Gather all agent time records and parse through them in PHP to save on DB load
+	$stmt="select user,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$rows_to_print = mysql_num_rows($rslt);
+	$i=0;
+	$j=0;
+	$k=0;
+	$uc=0;
+	while ($i < $rows_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$user =			$row[0];
+		$wait =			$row[1];
+		$talk =			$row[2];
+		$dispo =		$row[3];
+		$pause =		$row[4];
+		$lead =			$row[5];
+		$status =		$row[6];
+		$dead =			$row[7];
+		if ($wait > 30000) {$wait=0;}
+		if ($talk > 30000) {$talk=0;}
+		if ($dispo > 30000) {$dispo=0;}
+		if ($pause > 30000) {$pause=0;}
+		if ($dead > 30000) {$dead=0;}
+		$customer =		($talk - $dead);
+		if ($customer < 1)
+			{$customer=0;}
+		$TOTwait =	($TOTwait + $wait);
+		$TOTtalk =	($TOTtalk + $talk);
+		$TOTdispo =	($TOTdispo + $dispo);
+		$TOTpause =	($TOTpause + $pause);
+		$TOTdead =	($TOTdead + $dead);
+		$TOTcustomer =	($TOTcustomer + $customer);
+		$TOTALtime = ($TOTALtime + $pause + $dispo + $talk + $wait);
+		if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$TOTcalls++;}
+		
+		$user_found=0;
+		if ($uc < 1) 
+			{
+			$Suser[$uc] = $user;
+			$uc++;
+			}
+		$m=0;
+		while ( ($m < $uc) and ($m < 50000) )
+			{
+			if ($user == "$Suser[$m]")
+				{
+				$user_found++;
+
+				$Swait[$m] =	($Swait[$m] + $wait);
+				$Stalk[$m] =	($Stalk[$m] + $talk);
+				$Sdispo[$m] =	($Sdispo[$m] + $dispo);
+				$Spause[$m] =	($Spause[$m] + $pause);
+				$Sdead[$m] =	($Sdead[$m] + $dead);
+				$Scustomer[$m] =	($Scustomer[$m] + $customer);
+				if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$Scalls[$m]++;}
+				}
+			$m++;
+			}
+		if ($user_found < 1)
+			{
+			$Scalls[$uc] =	0;
+			$Suser[$uc] =	$user;
+			$Swait[$uc] =	$wait;
+			$Stalk[$uc] =	$talk;
+			$Sdispo[$uc] =	$dispo;
+			$Spause[$uc] =	$pause;
+			$Sdead[$uc] =	$dead;
+			$Scustomer[$uc] =	$customer;
+			if ($lead > 0) {$Scalls[$uc]++;}
+			$uc++;
+			}
+
+		$i++;
+		}
+	if ($DB) {echo "Done gathering $i records, analyzing...
\n";} + ##### END Gather all agent time records and parse through them in PHP to save on DB load + + ############################################################################ + ##### END gathering information from the database section + ############################################################################ + + + + + ##### BEGIN print the output to screen or put into file output variable + if ($file_download < 1) + { + echo "AGENT TIME BREAKDOWN:\n"; + echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + } + else + { + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + } + ##### END print the output to screen or put into file output variable + + + + + + ############################################################################ + ##### BEGIN formatting data for output section + ############################################################################ + + ##### BEGIN loop through each user formatting data for output + $AUTOLOGOUTflag=0; + $m=0; + while ( ($m < $uc) and ($m < 50000) ) + { + $SstatusesHTML=''; + $SstatusesFILE=''; + $Stime[$m] = ($Swait[$m] + $Stalk[$m] + $Sdispo[$m] + $Spause[$m]); + $RAWuser = $Suser[$m]; + $RAWcalls = $Scalls[$m]; + $RAWtimeSEC = $Stime[$m]; + + $Swait[$m]= sec_convert($Swait[$m],'H'); + $Stalk[$m]= sec_convert($Stalk[$m],'H'); + $Sdispo[$m]= sec_convert($Sdispo[$m],'H'); + $Spause[$m]= sec_convert($Spause[$m],'H'); + $Sdead[$m]= sec_convert($Sdead[$m],'H'); + $Scustomer[$m]= sec_convert($Scustomer[$m],'H'); + $Stime[$m]= sec_convert($Stime[$m],'H'); + + $RAWtime = $Stime[$m]; + $RAWwait = $Swait[$m]; + $RAWtalk = $Stalk[$m]; + $RAWdispo = $Sdispo[$m]; + $RAWpause = $Spause[$m]; + $RAWdead = $Sdead[$m]; + $RAWcustomer = $Scustomer[$m]; + + $n=0; + $user_name_found=0; + while ($n < $users_to_print) + { + if ($Suser[$m] == "$ULuser[$n]") + { + $user_name_found++; + $RAWname = $ULname[$n]; + $Sname[$m] = $ULname[$n]; + } + $n++; + } + if ($user_name_found < 1) + { + $RAWname = "NOT IN SYSTEM"; + $Sname[$m] = $RAWname; + } + + $n=0; + $punches_found=0; + while ($n < $punches_to_print) + { + if ($Suser[$m] == "$TCuser[$n]") + { + $punches_found++; + $RAWtimeTCsec = $TCtime[$n]; + $TOTtimeTC = ($TOTtimeTC + $TCtime[$n]); + $StimeTC[$m]= sec_convert($TCtime[$n],'H'); + $RAWtimeTC = $StimeTC[$m]; + $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); + } + $n++; + } + if ($punches_found < 1) + { + $RAWtimeTCsec = "0"; + $StimeTC[$m]= "0:00"; + $RAWtimeTC = $StimeTC[$m]; + $StimeTC[$m] = sprintf("%10s", $StimeTC[$m]); + } + + ### Check if the user had an AUTOLOGOUT timeclock event during the time period + $TCuserAUTOLOGOUT = ' '; + $stmt="select count(*) from vicidial_timeclock_log where event='AUTOLOGOUT' and user='$Suser[$m]' and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $autologout_results = mysql_num_rows($rslt); + if ($autologout_results > 0) + { + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $TCuserAUTOLOGOUT = '*'; + $AUTOLOGOUTflag++; + } + } + + ### BEGIN loop through each status ### + $n=0; + while ($n < $sub_status_count) + { + $Sstatus=$sub_statusesARY[$n]; + $SstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ( ($i < $subs_to_print) and ($status_found < 1) ) + { + if ( ($Suser[$m]=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") ) + { + $USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],'H'); + $pfUSERcodePAUSE_MS = sprintf("%10s", $USERcodePAUSE_MS); + + $SstatusTXT = sprintf("%10s", $pfUSERcodePAUSE_MS); + $SstatusesHTML .= " $SstatusTXT |"; + $SstatusesFILE .= ",$pfUSERcodePAUSE_MS"; + $status_found++; + } + $i++; + } + if ($status_found < 1) + { + $SstatusesHTML .= " 0:00 |"; + } + ### END loop through each stat line ### + $n++; + } + ### END loop through each status ### + + $Swait[$m]= sprintf("%10s", $Swait[$m]); + $Stalk[$m]= sprintf("%10s", $Stalk[$m]); + $Sdispo[$m]= sprintf("%10s", $Sdispo[$m]); + $Spause[$m]= sprintf("%10s", $Spause[$m]); + $Sdead[$m]= sprintf("%10s", $Sdead[$m]); + $Scustomer[$m]= sprintf("%10s", $Scustomer[$m]); + $Scalls[$m]= sprintf("%8s", $Scalls[$m]); + $Stime[$m]= sprintf("%10s", $Stime[$m]); + + if ($non_latin < 1) + { + $Sname[$m]= sprintf("%-15s", $Sname[$m]); + while(strlen($Sname[$m])>15) {$Sname[$m] = substr("$Sname[$m]", 0, -1);} + $Suser[$m] = sprintf("%-8s", $Suser[$m]); + while(strlen($Suser[$m])>8) {$Suser[$m] = substr("$Suser[$m]", 0, -1);} + } + else + { + $Sname[$m]= sprintf("%-45s", $Sname[$m]); + while(mb_strlen($Sname[$m],'utf-8')>15) {$Sname[$m] = mb_substr("$Sname[$m]", 0, -1,'utf-8');} + $Suser[$m] = sprintf("%-24s", $Suser[$m]); + while(mb_strlen($Suser[$m],'utf-8')>8) {$Suser[$m] = mb_substr("$Suser[$m]", 0, -1,'utf-8');} + } + + + if ($file_download < 1) + { + $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | $Scustomer[$m] | |$SstatusesHTML\n"; + } + else + { + $fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead,$RAWcustomer$SstatusesFILE\n"; + } + + $TOPsorted_output[$m] = $Toutput; + $TOPsorted_outputFILE[$m] = $fileToutput; + + if ($stage == 'NAME') + { + $TOPsort[$m] = '' . sprintf("%020s", $RAWname) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser); + $TOPsortTALLY[$m]=$RAWcalls; + } + if ($stage == 'ID') + { + $TOPsort[$m] = '' . sprintf("%08s", $RAWuser) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser); + $TOPsortTALLY[$m]=$RAWcalls; + } + if ($stage == 'LEADS') + { + $TOPsort[$m] = '' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser); + $TOPsortTALLY[$m]=$RAWcalls; + } + if ($stage == 'TIME') + { + $TOPsort[$m] = '' . sprintf("%010s", $RAWtimeSEC) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser); + $TOPsortTALLY[$m]=$RAWtimeSEC; + } + if ($stage == 'TCLOCK') + { + $TOPsort[$m] = '' . sprintf("%010s", $RAWtimeTCsec) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser); + $TOPsortTALLY[$m]=$RAWtimeTCsec; + } + if (!ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) + if ($file_download < 1) + {echo "$Toutput";} + else + {$file_output .= "$fileToutput";} + + if ($TOPsortMAX < $TOPsortTALLY[$m]) {$TOPsortMAX = $TOPsortTALLY[$m];} + +# echo "$Suser[$m]|$Sname[$m]|$Swait[$m]|$Stalk[$m]|$Sdispo[$m]|$Spause[$m]|$Scalls[$m]\n"; + $m++; + } + ##### END loop through each user formatting data for output + + + $TOT_AGENTS = sprintf("%4s", $m); + $k=$m; + + if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTALtime|$TOTcalls|$uc|
\n";} + + + ### BEGIN sort through output to display properly ### + if (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) + { + if (ereg("ID",$stage)) + {sort($TOPsort, SORT_NUMERIC);} + if (ereg("TIME|LEADS|TCLOCK",$stage)) + {rsort($TOPsort, SORT_NUMERIC);} + if (ereg("NAME",$stage)) + {rsort($TOPsort, SORT_STRING);} + + $m=0; + while ($m < $k) + { + $sort_split = explode("-----",$TOPsort[$m]); + $i = $sort_split[1]; + $sort_order[$m] = "$i"; + if ($file_download < 1) + {echo "$TOPsorted_output[$i]";} + else + {$file_output .= "$TOPsorted_outputFILE[$i]";} + $m++; + } + } + ### END sort through output to display properly ### + + ############################################################################ + ##### END formatting data for output section + ############################################################################ + + + + + ############################################################################ + ##### BEGIN last line totals output section + ############################################################################ + $SUMstatusesHTML=''; + $SUMstatusesFILE=''; + $TOTtotPAUSE=0; + $n=0; + while ($n < $sub_status_count) + { + $Scalls=0; + $Sstatus=$sub_statusesARY[$n]; + $SUMstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $subs_to_print) + { + if ($Sstatus=="$sub_status[$i]") + { + $Scalls = ($Scalls + $PCpause_sec[$i]); + $status_found++; + } + $i++; + } + ### END loop through each stat line ### + if ($status_found < 1) + { + $SUMstatusesHTML .= " 0 |"; + } + else + { + $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); + + $USERsumstatPAUSE_MS = sec_convert($Scalls,'H'); + $pfUSERsumstatPAUSE_MS = sprintf("%11s", $USERsumstatPAUSE_MS); + + $SUMstatusTXT = sprintf("%10s", $pfUSERsumstatPAUSE_MS); + $SUMstatusesHTML .= "$SUMstatusTXT |"; + $SUMstatusesFILE .= ",$pfUSERsumstatPAUSE_MS"; + } + $n++; + } + ### END loop through each status ### + + ### call function to calculate and print dialable leads + $TOTwait = sec_convert($TOTwait,'H'); + $TOTtalk = sec_convert($TOTtalk,'H'); + $TOTdispo = sec_convert($TOTdispo,'H'); + $TOTpause = sec_convert($TOTpause,'H'); + $TOTdead = sec_convert($TOTdead,'H'); + $TOTcustomer = sec_convert($TOTcustomer,'H'); + $TOTALtime = sec_convert($TOTALtime,'H'); + $TOTtimeTC = sec_convert($TOTtimeTC,'H'); + + $TOTcalls = sprintf("%8s", $TOTcalls); + $TOTwait = sprintf("%11s", $TOTwait); + $TOTtalk = sprintf("%11s", $TOTtalk); + $TOTdispo = sprintf("%11s", $TOTdispo); + $TOTpause = sprintf("%11s", $TOTpause); + $TOTdead = sprintf("%11s", $TOTdead); + $TOTcustomer = sprintf("%11s", $TOTcustomer); + $TOTALtime = sprintf("%11s", $TOTALtime); + $TOTtimeTC = sprintf("%11s", $TOTtimeTC); + ###### END LAST LINE TOTALS FORMATTING ########## + + + + if ($file_download < 1) + { + echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead |$TOTcustomer | |$SUMstatusesHTML\n"; + echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + if ($AUTOLOGOUTflag > 0) + {echo " * denotes AUTOLOGOUT from timeclock\n";} + echo "\n\n
"; + } + else + { + $file_output .= "TOTALS,$TOT_AGENTS,$TOTcalls,$TOTtimeTC,$TOTALtime,$TOTwait,$TOTtalk,$TOTdispo,$TOTpause,$TOTdead,$TOTcustomer$SUMstatusesFILE\n"; + } + } + + ############################################################################ + ##### END formatting data for output section + ############################################################################ + + + + + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AGENT_TIME$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$CSVfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + echo "$file_output"; + + exit; + } + + +############################################################################ +##### BEGIN HTML form section +############################################################################ +echo "
\n"; +echo "
Dates:
"; +echo "\n"; +echo ""; + +?> + + to
"; + +?> + +
Campaigns:
"; +echo "\n"; +echo "
User Groups:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; + +echo "          \n"; +echo " DOWNLOAD | \n"; +echo " REPORTS \n"; +echo "\n"; +echo "
"; + +echo "
\n\n"; +############################################################################ +##### END HTML form section +############################################################################ + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "$RUNtime\n"; + + +##### BEGIN horizontal yellow transparent bar graph overlay on top of agent stats +echo "
\n"; +echo "\n"; +echo "
\n\n\n\n\n\n\n\n";
+
+if ($stage == 'NAME') {$k=0;}
+$m=0;
+while ($m < $k)
+	{
+	$sort_split = explode("-----",$TOPsort[$m]);
+	$i = $sort_split[1];
+	$sort_order[$m] = "$i";
+
+	if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
+		{echo "                              \n";}
+	else
+		{
+		echo "                              ";
+		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
+		$h=0;
+		while ($h <= $TOPsortPLOT)
+			{
+			echo " ";
+			$h++;
+			}
+		echo "\n";
+		}
+	$m++;
+	}
+
+echo "\n";
+##### END horizontal yellow transparent bar graph overlay on top of agent stats
+
+?>
+
+
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_time_sheet.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_time_sheet.php
new file mode 100644
index 00000000..b5c0e6fb
--- /dev/null
+++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_time_sheet.php
@@ -0,0 +1,311 @@
+    LICENSE: AGPLv2
+#
+# CHANGES
+#
+# 60619-1729 - Added variable filtering to eliminate SQL injection attack threat
+#            - Added required user/pass to gain access to this page
+# 80624-0132 - Added vicidial_timeclock entries
+# 90310-0745 - Added admin header
+# 90508-0644 - Changed to PHP long tags
+# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion
+#
+
+require("dbconnect.php");
+require("functions.php");
+
+#############################################
+##### START SYSTEM_SETTINGS LOOKUP #####
+$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$ss_conf_ct = mysql_num_rows($rslt);
+if ($ss_conf_ct > 0)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =						$row[0];
+	$SSoutbound_autodial_active =		$row[1];
+	$user_territories_active =			$row[2];
+	}
+##### END SETTINGS LOOKUP #####
+###########################################
+
+$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
+$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
+$PHP_SELF=$_SERVER['PHP_SELF'];
+if (isset($_GET["agent"]))				{$agent=$_GET["agent"];}
+	elseif (isset($_POST["agent"]))		{$agent=$_POST["agent"];}
+if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
+	elseif (isset($_POST["query_date"]))	{$query_date=$_POST["query_date"];}
+if (isset($_GET["calls_summary"]))			{$calls_summary=$_GET["calls_summary"];}
+	elseif (isset($_POST["calls_summary"]))	{$calls_summary=$_POST["calls_summary"];}
+if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
+	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
+if (isset($_GET["ENVIAR"]))				{$ENVIAR=$_GET["ENVIAR"];}
+	elseif (isset($_POST["ENVIAR"]))	{$ENVIAR=$_POST["ENVIAR"];}
+
+$user=$agent;
+
+$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
+$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
+
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
+if ($DB) {echo "|$stmt|\n";}
+if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$auth=$row[0];
+
+  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
+	{
+    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
+    Header("HTTP/1.0 401 Unauthorized");
+    echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    exit;
+	}
+
+$NOW_DATE = date("Y-m-d");
+$NOW_TIME = date("Y-m-d H:i:s");
+$STARTtime = date("U");
+if (!isset($query_date)) {$query_date = $NOW_DATE;}
+
+?>
+
+
+
+
+
+\n";
+echo "Agent Planilha de Tempo";
+
+
+##### BEGIN Set variables to make header show properly #####
+$ADD =					'3';
+$hh =					'users';
+$LOGast_admin_access =	'1';
+$ADMIN =				'admin.php';
+$page_width='770';
+$section_width='750';
+$header_font_size='3';
+$subheader_font_size='2';
+$subcamp_font_size='2';
+$header_selected_bold='<b>';
+$header_nonselected_bold='';
+$users_color =		'#FFFF99';
+$users_font =		'BLACK';
+$users_color =		'#E6E6E6';
+$subcamp_color =	'#C6C6C6';
+##### END Set variables to make header show properly #####
+
+require("admin_header.php");
+
+echo "<TABLE WIDTH=$page_width BGCOLOR=\"#F0F5FE\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#F0F5FE\"><TD>\n";
+
+echo "AgentPlanilha de Horáriofor: $user\n";
+echo "<BR>\n";
+echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>   \n";
+echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n";
+echo "Usuário ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n";
+echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n";
+echo "</FORM>\n\n";
+
+echo "<PRE><FONT SIZE=3>\n";
+
+
+if (!$agent)
+{
+echo "\n";
+echo "PLEASE SELECT AN AGENTE ID AND DATE-TIME ABOVE AND CLICK ENVIAR\n";
+echo " NOTE: stats taken from available agent log data\n";
+}
+
+else
+{
+$query_date_BEGIN = "$query_date 00:00:00";   
+$query_date_END = "$query_date 23:59:59";
+$time_BEGIN = "00:00:00";   
+$time_END = "23:59:59";
+
+$stmt="select full_name from vicidial_users where user='$agent';";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$full_name = $row[0];
+
+echo "AgentPlanilha de Horário                            $NOW_TIME\n";
+
+echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+echo "---------- AGENTE TIME SHEET: $agent - $full_name -------------\n\n";
+
+if ($calls_summary)
+	{
+	$stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+
+	$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
+
+	$TOTAL_TIME_HMS =		sec_convert($TOTAL_TIME,'H'); 
+	$TALK_TIME_HMS =		sec_convert($row[1],'H'); 
+	$PAUSE_TIME_HMS =		sec_convert($row[3],'H'); 
+	$WAIT_TIME_HMS =		sec_convert($row[5],'H'); 
+	$WRAPUP_TIME_HMS =		sec_convert($row[7],'H'); 
+	$TALK_AVG_MS =			sec_convert($row[2],'H'); 
+	$PAUSE_AVG_MS =			sec_convert($row[4],'H'); 
+	$WAIT_AVG_MS =			sec_convert($row[6],'H'); 
+	$WRAPUP_AVG_MS =		sec_convert($row[8],'H'); 
+
+	$pfTOTAL_TIME_HMS =		sprintf("%8s", $TOTAL_TIME_HMS);
+	$pfTALK_TIME_HMS =		sprintf("%8s", $TALK_TIME_HMS);
+	$pfPAUSE_TIME_HMS =		sprintf("%8s", $PAUSE_TIME_HMS);
+	$pfWAIT_TIME_HMS =		sprintf("%8s", $WAIT_TIME_HMS);
+	$pfWRAPUP_TIME_HMS =	sprintf("%8s", $WRAPUP_TIME_HMS);
+	$pfTALK_AVG_MS =		sprintf("%6s", $TALK_AVG_MS);
+	$pfPAUSE_AVG_MS =		sprintf("%6s", $PAUSE_AVG_MS);
+	$pfWAIT_AVG_MS =		sprintf("%6s", $WAIT_AVG_MS);
+	$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
+
+	echo "TOTAL DE CHAMADAS TAKEN: $row[0]\n";
+	echo "TALK TIME:               $pfTALK_TIME_HMS     AVERAGE: $pfTALK_AVG_MS\n";
+	echo "PAUSE TIME:              $pfPAUSE_TIME_HMS     AVERAGE: $pfPAUSE_AVG_MS\n";
+	echo "WAIT TIME:               $pfWAIT_TIME_HMS     AVERAGE: $pfWAIT_AVG_MS\n";
+	echo "WRAPUP TIME:             $pfWRAPUP_TIME_HMS     AVERAGE: $pfWRAPUP_AVG_MS\n";
+	echo "----------------------------------------------------------------\n";
+	echo "TOTAL ACTIVE AGENTE TIME: $pfTOTAL_TIME_HMS\n";
+
+	echo "\n";
+	}
+else
+	{
+	echo "<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n";
+
+	}
+
+$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+echo "FIRST LOGIN:          $row[0]\n";
+$start = $row[1];
+
+$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+echo "LAST LOG ACTIVITY:    $row[0]\n";
+$end = $row[1];
+
+$login_time = ($end - $start);
+$LOGIN_TIME_HMS =		sec_convert($login_time,'H'); 
+$pfLOGIN_TIME_HMS =		sprintf("%8s", $LOGIN_TIME_HMS);
+
+echo "-----------------------------------------\n";
+echo "TOTAL LOGGED-IN TIME:            $pfLOGIN_TIME_HMS\n";
+
+
+### timeclock records
+
+
+##### vicidial_timeclock log records for user #####
+
+$total_login_time=0;
+$SQday_ARY =	explode('-',$query_date_BEGIN);
+$EQday_ARY =	explode('-',$query_date_END);
+$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
+$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
+
+echo "\n";
+
+echo "<B>TIMECLOCK HORÁRIO DE LOGIN/LOGOUT:</B>\n";
+echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
+echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n";
+
+	$stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='$agent' and event_epoch >= '$SQepoch'  and event_epoch <= '$EQepoch';";
+	if ($DB>0) {echo "|$stmt|";}
+	$rslt=mysql_query($stmt, $link);
+	$events_to_print = mysql_num_rows($rslt);
+
+	$total_logs=0;
+	$o=0;
+	while ($events_to_print > $o) {
+		$row=mysql_fetch_row($rslt);
+		if ( ($row[0]=='START') or ($row[0]=='LOGIN') )
+			{$bgcolor='bgcolor="#B9CBFD"';} 
+		else
+			{$bgcolor='bgcolor="#9BB9FB"';}
+
+		$TC_log_date = date("Y-m-d H:i:s", $row[1]);
+
+		$manager_edit='';
+		if (strlen($row[6])>0) {$manager_edit = ' * ';}
+
+		if (ereg("LOGIN", $row[0]))
+			{
+			$login_sec='';
+			echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
+			echo "<td align=right><font size=2>$manager_edit</td>";
+			echo "<td align=right><font size=2>$row[0]</td>";
+			echo "<td align=right><font size=2> $TC_log_date</td>\n";
+			echo "<td align=right><font size=2> $row[4]</td>\n";
+			echo "<td align=right><font size=2> $row[2]</td>\n";
+			echo "<td align=right><font size=2> </td></tr>\n";
+			}
+		if (ereg("LOGOUT", $row[0]))
+			{
+			$login_sec = $row[3];
+			$total_login_time = ($total_login_time + $login_sec);
+			$event_hours_minutes =		sec_convert($login_sec,'H'); 
+
+			echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
+			echo "<td align=right><font size=2>$manager_edit</td>";
+			echo "<td align=right><font size=2>$row[0]</td>";
+			echo "<td align=right><font size=2> $TC_log_date</td>\n";
+			echo "<td align=right><font size=2> $row[4]</td>\n";
+			echo "<td align=right><font size=2> $row[2]</td>\n";
+			echo "<td align=right><font size=2> $event_hours_minutes";
+			if ($DB) {echo " - $total_login_time - $login_sec";}
+			echo "</td></tr>\n";
+			}
+		$o++;
+	}
+if (strlen($login_sec)<1)
+	{
+	$login_sec = ($STARTtime - $row[1]);
+	$total_login_time = ($total_login_time + $login_sec);
+		if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";}
+	}
+$total_login_hours_minutes =		sec_convert($total_login_time,'H'); 
+
+	if ($DB) {echo " - $total_login_time - $login_sec";}
+
+echo "<tr><td align=right><font size=2> </td>";
+echo "<td align=right><font size=2> </td>\n";
+echo "<td align=right><font size=2> </td>\n";
+echo "<td align=right><font size=2> </td>\n";
+echo "<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n";
+echo "<td align=right><font size=2> $total_login_hours_minutes  </td></tr>\n";
+
+echo "</TABLE>\n";
+
+
+
+}
+
+
+
+?>
+
+</BODY></HTML>
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_timeclock_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_timeclock_detail.php
new file mode 100644
index 00000000..e3d7b036
--- /dev/null
+++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_agent_timeclock_detail.php
@@ -0,0 +1,692 @@
+<?php 
+# AST_agent_timeclock_detail.php
+# 
+# Pulls all timeclock records for an agent
+#
+# Copyright (C) 2010  Matt Florell <vicidial@gmail.com>    LICENSE: AGPLv2
+#
+# CHANGES
+# 90602-2244 - First build
+# 100301-1401 - Added popup date selector
+#
+
+
+require("dbconnect.php");
+require("functions.php");
+
+$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
+$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
+$PHP_SELF=$_SERVER['PHP_SELF'];
+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["group"]))					{$group=$_GET["group"];}
+	elseif (isset($_POST["group"]))			{$group=$_POST["group"];}
+if (isset($_GET["user_group"]))				{$user_group=$_GET["user_group"];}
+	elseif (isset($_POST["user_group"]))	{$user_group=$_POST["user_group"];}
+if (isset($_GET["shift"]))					{$shift=$_GET["shift"];}
+	elseif (isset($_POST["shift"]))			{$shift=$_POST["shift"];}
+if (isset($_GET["stage"]))					{$stage=$_GET["stage"];}
+	elseif (isset($_POST["stage"]))			{$stage=$_POST["stage"];}
+if (isset($_GET["file_download"]))			{$file_download=$_GET["file_download"];}
+	elseif (isset($_POST["file_download"]))	{$file_download=$_POST["file_download"];}
+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 (strlen($shift)<2) {$shift='ALL';}
+if (strlen($stage)<2) {$stage='ID';}
+
+#############################################
+##### START SYSTEM_SETTINGS LOOKUP #####
+$stmt = "SELECT use_non_latin FROM system_settings;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$qm_conf_ct = mysql_num_rows($rslt);
+if ($qm_conf_ct > 0)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	}
+##### END SETTINGS LOOKUP #####
+###########################################
+
+$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
+$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
+
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
+if ($DB) {echo "|$stmt|\n";}
+if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$auth=$row[0];
+
+if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
+	{
+    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
+    Header("HTTP/1.0 401 Unauthorized");
+    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    exit;
+	}
+
+$MT[0]='';
+$NOW_DATE = date("Y-m-d");
+$NOW_TIME = date("Y-m-d H:i:s");
+$STARTtime = date("U");
+if (!isset($group)) {$group = '';}
+if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";}
+if (!isset($end_date)) {$end_date = "$NOW_DATE 23:59:59";}
+$query_dateURL = ereg_replace(' ','+',$query_date);
+$end_dateURL = ereg_replace(' ','+',$end_date);
+
+$query_dateARRAY = explode(" ",$query_date);
+$query_date_D = $query_dateARRAY[0];
+$query_date_T = $query_dateARRAY[1];
+$end_dateARRAY = explode(" ",$end_date);
+$end_date_D = $end_dateARRAY[0];
+$end_date_T = $end_dateARRAY[1];
+
+$stmt="select campaign_id from vicidial_campaigns;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$campaigns_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $campaigns_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$groups[$i] =$row[0];
+	$i++;
+	}
+$stmt="select user_group from vicidial_user_groups;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$user_groups_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $user_groups_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$user_groups[$i] =$row[0];
+	$i++;
+	}
+
+$i=0;
+$group_string='|';
+$group_ct = count($group);
+while($i < $group_ct)
+	{
+	$group_string .= "$group[$i]|";
+	$group_SQL .= "'$group[$i]',";
+	$groupQS .= "&group[]=$group[$i]";
+	$i++;
+	}
+if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
+	{$group_SQL = "";}
+else
+	{
+	$group_SQL = eregi_replace(",$",'',$group_SQL);
+	$group_SQL = "and campaign_id IN($group_SQL)";
+	}
+
+$i=0;
+$user_group_string='|';
+$user_group_ct = count($user_group);
+while($i < $user_group_ct)
+	{
+	$user_group_string .= "$user_group[$i]|";
+	$user_group_SQL .= "'$user_group[$i]',";
+	$user_groupQS .= "&user_group[]=$user_group[$i]";
+	$i++;
+	}
+if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) )
+	{$user_group_SQL = "";}
+else
+	{
+	$TCuser_group_SQL = $user_group_SQL;
+	$user_group_SQL = eregi_replace(",$",'',$user_group_SQL);
+	$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
+	$TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL);
+	$TCuser_group_SQL = "and user_group IN($TCuser_group_SQL)";
+	}
+
+if ($DB) {echo "$user_group_string|$user_group_ct|$user_groupQS|$i<BR>";}
+
+$stmt="select distinct pause_code,pause_code_name from vicidial_pause_codes;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$statha_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $statha_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	$pause_code[$i] =		"$row[0]";
+	$pause_code_name[$i] =	"$row[1]";
+	$i++;
+	}
+
+$LINKbase = "$PHP_SELF?query_date=$query_dateURL&end_date=$end_dateURL$groupQS$user_groupQS&shift=$shift&DB=$DB";
+
+if ($file_download < 1)
+	{
+	?>
+
+	<HTML>
+	<HEAD>
+	<STYLE type="text/css">
+	<!--
+	   .yellow {color: white; background-color: yellow}
+	   .red {color: white; background-color: red}
+	   .blue {color: white; background-color: blue}
+	   .purple {color: white; background-color: purple}
+	-->
+	 </STYLE>
+
+	<script language="JavaScript" src="calendar_db.js"></script>
+	<link rel="stylesheet" href="calendar.css">
+
+	<?php
+	echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
+	echo "<TITLE>User Time-Clock Detail\n";
+	echo "";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+	echo "\n";
+	echo "\n";
+	echo "
\n";
+	}
+
+if (strlen($user_group[0]) < 1)
+	{
+	echo "\n";
+	echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
+	echo " NOTE: stats taken from shift specified\n";
+	}
+
+else
+	{
+	if ($shift == 'TEST') 
+		{
+		$time_BEGIN = "09:45:00";  
+		$time_END = "10:00:00";
+		}
+	if ($shift == 'AM') 
+		{
+		$time_BEGIN=$AM_shift_BEGIN;
+		$time_END=$AM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+		if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+		}
+	if ($shift == 'PM') 
+		{
+		$time_BEGIN=$PM_shift_BEGIN;
+		$time_END=$PM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+		}
+	if ($shift == 'ALL') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+		}
+	$query_date_BEGIN = "$query_date";   
+	$query_date_END = "$end_date";
+
+	if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
+	else {$ugSQL='';}
+
+	if ($file_download < 1)
+		{
+		echo "User Time-Clock Detail                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		}
+	else
+		{
+		$file_output .= "User Time-Clock Detail                     $NOW_TIME\n";
+		$file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		}
+
+
+
+	############################################################################
+	##### BEGIN gathering information from the database section
+	############################################################################
+
+	### BEGIN gather user IDs and names for matching up later
+	$stmt="select full_name,user,user_group from vicidial_users order by user limit 100000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$users_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $users_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$ULname[$i] =	$row[0];
+		$ULuser[$i] =	$row[1];
+		$ULgroup[$i] =	$row[2];
+		$i++;
+		}
+	### END gather user IDs and names for matching up later
+
+
+	### BEGIN gather timeclock time totals per agent
+	$stmt="select user,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$punches_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $punches_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$TCuser[$i] =	$row[0];
+		$TCtime[$i] =	$row[1];
+		$uc++;
+		$i++;
+		}
+	### END gather timeclock records per agent
+
+	############################################################################
+	##### END gathering information from the database section
+	############################################################################
+
+
+
+
+	##### BEGIN print the output to screen or put into file output variable
+	if ($file_download < 1)
+		{
+		echo "AGENT TIME-CLOCK DETAIL:\n";
+		echo "+-----------------+----------+----------------------+------------+--------------------\n";
+		echo "| USER NAME       | ID       | USER GROUP           | TIME CLOCK | TIME CLOCK PUNCHES\n";
+		echo "+-----------------+----------+----------------------+------------+--------------------\n";
+		}
+	else
+		{
+		$file_output .= "USER,ID,GROUP,TIME CLOCK,TIME CLOCK PUNCHES\n";
+		}
+	##### END print the output to screen or put into file output variable
+
+
+
+
+
+	############################################################################
+	##### BEGIN formatting data for output section
+	############################################################################
+
+	##### BEGIN loop through each user formatting data for output
+	$AUTOLOGOUTflag=0;
+	$m=0;
+	while ( ($m < $uc) and ($m < 50000) )
+		{
+		$TCdetail='';
+		$rawTCdetail='';
+		$n=0;
+		$user_name_found=0;
+		$RAWuser=$TCuser[$m];
+		while ($n < $users_to_print)
+			{
+			if ($TCuser[$m] == "$ULuser[$n]")
+				{
+				$user_name_found++;
+				$RAWname = $ULname[$n];
+				$RAWgroup = $ULgroup[$n];
+				$Sname[$m] = $ULname[$n];
+				$Sgroup[$m] = $ULgroup[$n];
+				}
+			$n++;
+			}
+		if ($user_name_found < 1)
+			{
+			$RAWname =		"NOT IN SYSTEM";
+			$RAWgroup =		"GROUP NOT IN SYSTEM";
+			$Sname[$m] =	$RAWname;
+			}
+
+		$n=0;
+		$punches_found=0;
+		while ($n < $punches_to_print)
+			{
+			if ($RAWuser == "$TCuser[$n]")
+				{
+				$punches_found++;
+				$RAWtimeTCsec =		$TCtime[$n];
+				$TOTtimeTC =		($TOTtimeTC + $TCtime[$n]);
+				$StimeTC[$m]=		sec_convert($TCtime[$n],'H'); 
+				$RAWtimeTC =		$StimeTC[$m];
+				$StimeTC[$m] =		sprintf("%10s", $StimeTC[$m]);
+				}
+			$n++;
+			}
+		if ($punches_found < 1)
+			{
+			$RAWtimeTCsec =		"0";
+			$StimeTC[$m]=		"0:00"; 
+			$RAWtimeTC =		$StimeTC[$m];
+			$StimeTC[$m] =		sprintf("%10s", $StimeTC[$m]);
+			}
+
+		### Check if the user had an AUTOLOGOUT timeclock event during the time period
+		$TCuserAUTOLOGOUT = ' ';
+		$stmt="select event_epoch,event_date,login_sec,event,user_group from vicidial_timeclock_log where event_date <= '$query_date_END' and event_date >= '$query_date_BEGIN' and user='$TCuser[$m]' $TCuser_group_SQL order by event_date limit 10000000;";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$TC_results = mysql_num_rows($rslt);
+		$k=0;
+		while ($TC_results > $k)
+			{
+			$TCentryAUTOLOGOUT = ' ';
+			$row=mysql_fetch_row($rslt);
+			$event_epoch =	$row[0];
+			$event_date =	$row[1];
+			$login_sec =	$row[2];
+			$event =		$row[3];
+			$user_group =	$row[4];
+			$date_detail = explode(' ',$event_date);
+
+			if ($event == 'AUTOLOGOUT')
+				{
+				$TCentryAUTOLOGOUT = '*';
+				$TCuserAUTOLOGOUT =	'*';
+				$AUTOLOGOUTflag++;
+				}
+			$TCdetail .= "$date_detail[1]$TCentryAUTOLOGOUT ";
+			$rawTCdetail .= "$date_detail[1],";
+			$k++;
+			}
+
+		if ($TC_results > 0)
+			{$rawTCdetail = ereg_replace(",$",'',$rawTCdetail);}
+
+		$Stime[$m] =	sprintf("%10s", $Stime[$m]); 
+		$SORTname =	sprintf("%-20s", $Sname[$m]);
+		$SORTgroup =	sprintf("%-20s", $Sgroup[$m]);
+		$Sgroup[$m] =	sprintf("%-20s", $Sgroup[$m]); 
+		$SORTgroup = ereg_replace(" ",'0',$SORTgroup);
+		$SORTname = ereg_replace(" ",'0',$SORTname);
+
+		if ($non_latin < 1)
+			{
+			$Sname[$m]=	sprintf("%-15s", $Sname[$m]); 
+			while(strlen($Sname[$m])>15) {$Sname[$m] = substr("$Sname[$m]", 0, -1);}
+			$Suser[$m] =		sprintf("%-8s", $TCuser[$m]);
+			while(strlen($Suser[$m])>8) {$Suser[$m] = substr("$Suser[$m]", 0, -1);}
+			}
+		else
+			{	
+			$Sname[$m]=	sprintf("%-45s", $Sname[$m]); 
+			while(mb_strlen($Sname[$m],'utf-8')>15) {$Sname[$m] = mb_substr("$Sname[$m]", 0, -1,'utf-8');}
+			$Suser[$m] =	sprintf("%-24s", $TCuser[$m]);
+			while(mb_strlen($Suser[$m],'utf-8')>8) {$Suser[$m] = mb_substr("$Suser[$m]", 0, -1,'utf-8');}
+			}
+
+
+		if ($file_download < 1)
+			{
+			$Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n";
+			}
+		else
+			{
+			$fileToutput = "$RAWname,$RAWuser,$RAWgroup,$RAWtimeTC,$rawTCdetail\n";
+			}
+
+		$TOPsorted_output[$m] = $Toutput;
+		$TOPsorted_outputFILE[$m] = $fileToutput;
+
+		if ($stage == 'NAME')
+			{
+			$TOPsort[$m] =	'' . sprintf("%020s", $SORTname) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
+			$TOPsortTALLY[$m]=$RAWcalls;
+			}
+		if ($stage == 'ID')
+			{
+			$TOPsort[$m] =	'' . sprintf("%08s", $RAWuser) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
+			$TOPsortTALLY[$m]=$RAWcalls;
+			}
+		if ($stage == 'TCLOCK')
+			{
+			$TOPsort[$m] =	'' . sprintf("%010s", $RAWtimeTCsec) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
+			$TOPsortTALLY[$m]=$RAWtimeTCsec;
+			}
+		if ($stage == 'GROUP')
+			{
+			$TOPsort[$m] =	'' . sprintf("%020s", $SORTgroup) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
+			$TOPsortTALLY[$m]=$SORTgroup;
+			}
+		if (!ereg("NAME|ID|TCLOCK|GROUP",$stage))
+			if ($file_download < 1)
+				{echo "$Toutput";}
+			else
+				{$file_output .= "$fileToutput";}
+
+		if ($TOPsortMAX < $TOPsortTALLY[$m]) {$TOPsortMAX = $TOPsortTALLY[$m];}
+
+#		echo "$Suser[$m]|$Sname[$m]|$Swait[$m]|$Stalk[$m]|$Sdispo[$m]|$Spause[$m]|$Scalls[$m]\n";
+		$m++;
+		}
+	##### END loop through each user formatting data for output
+
+
+	$TOT_AGENTS = sprintf("%4s", $m);
+	$k=$m;
+
+	if ($DB) {echo "Done analyzing...   $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|
\n";} + + + ### BEGIN sort through output to display properly ### + if ( (ereg("NAME|ID|TCLOCK|GROUP",$stage)) and ($k > 0) ) + { + if (ereg("ID",$stage)) + {sort($TOPsort, SORT_NUMERIC);} + if (ereg("TCLOCK",$stage)) + {rsort($TOPsort, SORT_NUMERIC);} + if (ereg("GROUP",$stage)) + {sort($TOPsort, SORT_REGULAR);} + if (ereg("NAME",$stage)) + {sort($TOPsort, SORT_STRING);} + + $m=0; + while ($m < $k) + { + $sort_split = explode("-----",$TOPsort[$m]); + $i = $sort_split[1]; + $sort_order[$m] = "$i"; + if ($file_download < 1) + {echo "$TOPsorted_output[$i]";} + else + {$file_output .= "$TOPsorted_outputFILE[$i]";} + $m++; + } + } + ### END sort through output to display properly ### + + ############################################################################ + ##### END formatting data for output section + ############################################################################ + + + + + ############################################################################ + ##### BEGIN last line totals output section + ############################################################################ + + ### call function to calculate and print dialable leads + $TOTtimeTC = sec_convert($TOTtimeTC,'H'); + + $TOTtimeTC = sprintf("%11s", $TOTtimeTC); + ###### END LAST LINE TOTALS FORMATTING ########## + + + + if ($file_download < 1) + { + echo "+-----------------+----------+----------------------+------------+--------------------\n"; + echo "| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n"; + echo "+----------------------------+ +------------+\n"; + if ($AUTOLOGOUTflag > 0) + {echo " * denotes AUTOLOGOUT from timeclock\n";} + echo "\n\n
"; + } + else + { + $file_output .= "TOTALS,$TOT_AGENTS,,$TOTtimeTC\n"; + } + } + + ############################################################################ + ##### END formatting data for output section + ############################################################################ + + + + + +if ($file_download > 0) + { + $FILE_TIME = date("Ymd-His"); + $CSVfilename = "AGENT_TIME$US$FILE_TIME.csv"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$CSVfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + echo "$file_output"; + + exit; + } + + +############################################################################ +##### BEGIN HTML form section +############################################################################ +echo "
\n"; +echo "
Dates:
"; +echo "\n"; +echo "\n"; +echo "\n"; +echo ""; + +?> + +"; + +echo "
to
"; + +?> + +"; + +# echo "
Campaigns:
"; +# echo "\n"; + +echo "
User Groups:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; + + +?> + + + +
        "; + +echo "          \n"; +echo " DOWNLOAD | \n"; +echo " REPORTS \n"; +echo "\n"; +echo "
"; + +echo "
\n\n"; +############################################################################ +##### END HTML form section +############################################################################ + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "$RUNtime\n"; + +?> + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_inboundEXTstats.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_inboundEXTstats.php new file mode 100644 index 00000000..e90f463b --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_inboundEXTstats.php @@ -0,0 +1,401 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60620-1322 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# 90508-0644 - Changed to PHP long tags +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($server_ip)) {$server_ip = '10.10.11.20';} + +$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='" . mysql_real_escape_string($server_ip) . "';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$inbound_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $inbound_to_print) + { + $row=mysql_fetch_row($rslt); + $inbound[$i] =$row[0]; + $fullnum[$i] =$row[1]; + $inbname[$i] =$row[2]; + $i++; + } +?> + + + + + +\n"; +#echo"\n"; +echo "ASTERISK: Estatística das chamadas entrantes\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "POR FAVOR SELECIONE UM NÚMERO E UMA DATA ACIMA E CLIQUE EM ENVIAR\n";
+}
+
+else
+{
+
+
+echo "ASTERISK: Estatística das chamadas entrantes                      $NOW_TIME\n";
+
+echo "\n";
+echo "---------- TOTALS\n";
+
+$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
+if (eregi("\*",$group))
+	{$extenSQL = "and extension LIKE \"%$group\"";}
+$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+$TOTALcalls =	sprintf("%10s", $row[0]);
+$average_hold_seconds = ($row[1] / $row[0]);
+$average_hold_seconds = round($average_hold_seconds, 0);
+$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
+
+echo "Total de chamadas que entraram por esse número:       $TOTALcalls\n";
+echo "Average Call Length(seconds) for all Calls:   $average_hold_seconds\n";
+
+echo "\n";
+echo "---------- DERRUBADAS\n";
+
+$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+$DROPcalls =	sprintf("%10s", $row[0]);
+$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
+$DROPpercent = round($DROPpercent, 0);
+
+if ($row[0])
+	{
+	$average_hold_seconds = ($row[1] / $row[0]);
+	$average_hold_seconds = round($average_hold_seconds, 0);
+	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
+	}
+else {$DROPpercent=0;   $average_hold_seconds=0;}
+echo "Total DROP Calls:   (less than 10 seconds)    $DROPcalls  $DROPpercent%\n";
+echo "Average Call Length(seconds) for DROP Calls:  $average_hold_seconds\n";
+
+
+##############################
+#########  CALLS STATS
+
+echo "\n";
+echo "---------- CALL LISTINGS\n";
+echo "+----------------------+----------------------+--------+---------------------+\n";
+echo "| CALLERID             | CALLERIDNAME         | LENGTH | DATE TIME           |\n";
+echo "+----------------------+----------------------+--------+---------------------+\n";
+
+$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$users_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $users_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+
+	$CID =			sprintf("%-20s", $row[0]);
+	$CIDname =		sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
+	$datetime =		sprintf("%-19s", $row[3]);
+	$USERavgTALK =	$row[2];
+
+	$USERavgTALK_M = ($USERavgTALK / 60);
+	$USERavgTALK_M = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M");
+	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
+	$USERavgTALK_S = ($USERavgTALK_S * 60);
+	$USERavgTALK_S = round($USERavgTALK_S, 0);
+	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
+	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
+	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
+
+	echo "| $CID | $CIDname | $USERavgTALK_MS | $datetime |\n";
+
+	$i++;
+	}
+
+echo "+----------------------+----------------------+--------+---------------------+\n";
+
+##############################
+#########  TIME STATS
+
+if ($output == 'FULL')
+	{
+
+	echo "\n";
+	echo "---------- ESTATÍSTICAS DE TEMPO\n";
+
+	echo "\n";
+
+	$hi_hour_count=0;
+	$last_full_record=0;
+	$i=0;
+	$h=0;
+	while ($i <= 96)
+		{
+		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
+		$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
+		$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
+		$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
+		$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
+		$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
+		$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
+		$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$row=mysql_fetch_row($rslt);
+		$drop_count[$i] = $row[0];
+		$i++;
+		$h++;
+		}
+
+	$hour_multiplier = (100 / $hi_hour_count);
+	#$hour_multiplier = round($hour_multiplier, 0);
+
+	echo "\n";
+	echo "GRÁFICO TOTAL DE CHAMADAS A CADA 15 MINUTOS\n";
+
+	$k=1;
+	$Mk=0;
+	$call_scale = '0';
+	while ($k <= 102) 
+		{
+		if ($Mk >= 5) 
+			{
+			$Mk=0;
+			$scale_num=($k / $hour_multiplier);
+			$scale_num = round($scale_num, 0);
+			$LENscale_num = (strlen($scale_num));
+			$k = ($k + $LENscale_num);
+			$call_scale .= "$scale_num";
+			}
+		else
+			{
+			$call_scale .= " ";
+			$k++;   $Mk++;
+			}
+		}
+
+
+	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
+	#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
+	echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
+	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
+
+	$ZZ = '00';
+	$i=0;
+	$h=4;
+	$hour= -1;
+	$no_lines_yet=1;
+
+	while ($i <= 96)
+		{
+		$char_counter=0;
+		$time = '      ';
+		if ($h >= 4) 
+			{
+			$hour++;
+			$h=0;
+			if ($hour < 10) {$hour = "0$hour";}
+			$time = "+$hour$ZZ+";
+			}
+		if ($h == 1) {$time = "   15 ";}
+		if ($h == 2) {$time = "   30 ";}
+		if ($h == 3) {$time = "   45 ";}
+		$Ghour_count = $hour_count[$i];
+		if ($Ghour_count < 1) 
+			{
+			if ( ($no_lines_yet) or ($i > $last_full_record) )
+				{
+				$do_nothing=1;
+				}
+			else
+				{
+				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
+				echo "|$time|";
+				$k=0;   while ($k <= 102) {echo " ";   $k++;}
+				echo "| $hour_count[$i] |\n";
+				}
+			}
+		else
+			{
+			$no_lines_yet=0;
+			$Xhour_count = ($Ghour_count * $hour_multiplier);
+			$Yhour_count = (99 - $Xhour_count);
+
+			$Gdrop_count = $drop_count[$i];
+			if ($Gdrop_count < 1) 
+				{
+				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
+
+				echo "|$time|";
+				$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
+				echo "*X";   $char_counter++;
+				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
+					while ($char_counter <= 101) {echo " ";   $char_counter++;}
+				echo "| 0     | $hour_count[$i] |\n";
+
+				}
+			else
+				{
+				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
+
+			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
+
+				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
+
+				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
+				$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
+
+				echo "|$time|";
+				$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
+				echo "D";   $char_counter++;
+				$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
+				echo "X";   $char_counter++;
+				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
+					while ($char_counter <= 102) {echo " ";   $char_counter++;}
+				echo "| $drop_count[$i] | $hour_count[$i] |\n";
+				}
+			}
+		
+		
+		$i++;
+		$h++;
+		}
+
+
+	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
+
+
+	}
+
+
+
+
+}
+
+
+
+?>
+
+ + \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_server_performance.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_server_performance.php new file mode 100644 index 00000000..915c1eb6 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_server_performance.php @@ -0,0 +1,347 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 60619-1732 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# 70417-1106 - Changed time frame to be definable per time range on a single day +# - Fixed vertical scaling issues +# 80118-1508 - Fixed horizontal scale marking issues +# 90310-2151 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["begin_query_time"])) {$begin_query_time=$_GET["begin_query_time"];} + elseif (isset($_POST["begin_query_time"])) {$begin_query_time=$_POST["begin_query_time"];} +if (isset($_GET["end_query_time"])) {$end_query_time=$_GET["end_query_time"];} + elseif (isset($_POST["end_query_time"])) {$end_query_time=$_POST["end_query_time"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +# path from root to where ploticus files will be stored +$PLOTroot = "vicidial/ploticus"; +$DOCroot = "$WeBServeRRooT/$PLOTroot/"; + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); + +if (!isset($begin_query_time)) {$begin_query_time = "$NOW_DATE 09:00:00";} +if (!isset($end_query_time)) {$end_query_time = "$NOW_DATE 15:30:00";} +if (!isset($group)) {$group = '';} + +$stmt="select server_ip from servers order by server_ip;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$servers_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + $i++; + } +?> + + + + + +\n"; +echo "Server Performance Report\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + + +echo "
\n"; +echo "Date/Time Range: \n"; +echo "to \n"; +echo "Server: \n"; +echo "\n"; +echo "             RELATÓRIOS \n"; +echo "
\n\n"; + +echo "
\n";
+
+
+if (!$group)
+{
+echo "\n";
+echo "PLEASE SELECT A SERVIDOR AND DATE/TIME RANGE ABOVE AND CLICK ENVIAR\n";
+}
+
+else
+{
+
+$query_date_BEGIN = $begin_query_time;   
+$query_date_END = $end_query_time;
+
+
+echo "Server Performance Report                            $NOW_TIME\n";
+
+echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+echo "---------- TOTALS, PEAKS and AVERAGES\n";
+
+$stmt="select AVG(sysload),AVG(channels_total),MAX(sysload),MAX(channels_total),MAX(processes) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$AVGload =	sprintf("%10s", $row[0]);
+$AVGchannels =	sprintf("%10s", $row[1]);
+$HIGHload =	$row[2];
+	$HIGHmulti = intval($HIGHload / 100);
+$HIGHchannels =	$row[3];
+$HIGHprocesses =$row[4];
+if ($row[2] > $row[3]) {$HIGHlimit = $row[2];}
+else {$HIGHlimit = $row[3];}
+if ($HIGHlimit < $row[4]) {$HIGHlimit = $row[4];}
+
+$stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$AVGcpuUSER =	sprintf("%10s", $row[0]);
+$AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
+$AVGcpuIDLE =	sprintf("%10s", $row[2]);
+
+$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$TOTALcalls =	sprintf("%10s", $row[0]);
+$OFFHOOKtime =	sprintf("%10s", $row[1]);
+
+
+echo "Total Calls in/out on this server:        $TOTALcalls\n";
+echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
+echo "Average/Peak channels in use for server:  $AVGchannels / $HIGHchannels\n";
+echo "Average/Peak load for server:             $AVGload / $HIGHload\n";
+echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
+echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
+echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
+
+echo "\n";
+echo "---------- LINE GRAPH:\n";
+
+
+
+##############################
+#########  Graph stats
+
+$DAT = '.dat';
+$HTM = '.htm';
+$PNG = '.png';
+$filedate = date("Y-m-d_His");
+$DATfile = "$group$query_date$shift$filedate$DAT";
+$HTMfile = "$group$query_date$shift$filedate$HTM";
+$PNGfile = "$group$query_date$shift$filedate$PNG";
+
+$HTMfp = fopen ("$DOCroot/$HTMfile", "a");
+$DATfp = fopen ("$DOCroot/$DATfile", "a");
+
+$stmt="select DATE_FORMAT(start_time,'%Y-%m-%d.%H:%i:%s') as timex,sysload,processes,channels_total,live_recordings,cpu_user_percent,cpu_system_percent from server_performance where server_ip='" . mysql_real_escape_string($group) . "' and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' order by timex limit 99999;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$rows_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $rows_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+	if ($i<1) {$time_BEGIN = $row[0];}
+	$time_END = $row[0];
+	$row[5] = intval(($row[5] + $row[6]) * $HIGHmulti);
+	$row[6] = intval($row[6] * $HIGHmulti);
+	if ($rows_to_print > 9999)
+		{
+		if ($rows_to_print <= 19999)
+			{
+			if (preg_match("/0$|2$|4$|6$|8$/",$i))
+				{
+				fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
+				}
+			}
+		if ( ($rows_to_print > 19999) and ($rows_to_print <= 49999) )
+			{
+			if (preg_match("/0$|5$/",$i))
+				{
+				fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
+				}
+			}
+		if ( ($rows_to_print > 49999) and ($rows_to_print <= 99999) )
+			{
+			if (preg_match("/0$/",$i))
+				{
+				fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
+				}
+			}
+		}
+	else
+		{
+		fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
+		}
+	$i++;
+	}
+fclose($DATfp);
+
+$rows_to_max = ($rows_to_print + 100);
+
+$time_scale_abb = '5 minutes';
+$time_scale_tick = '1 minute';
+if ($i > 1000) {$time_scale_abb = '10 minutes';   $time_scale_tick = '2 minutes';}
+if ($i > 1500) {$time_scale_abb = '15 minutes';   $time_scale_tick = '3 minutes';}
+if ($i > 2000) {$time_scale_abb = '20 minutes';   $time_scale_tick = '4 minutes';}
+if ($i > 3000) {$time_scale_abb = '30 minutes';   $time_scale_tick = '5 minutes';}
+if ($i > 4000) {$time_scale_abb = '40 minutes';   $time_scale_tick = '10 minutes';}
+if ($i > 5000) {$time_scale_abb = '60 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 6000) {$time_scale_abb = '90 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 7000) {$time_scale_abb = '120 minutes';   $time_scale_tick = '30 minutes';}
+
+print "rows: $i   tick: $time_scale_abb   scale: $time_scale_tick\n";
+
+$HTMcontent  = '';
+$HTMcontent .= "#proc page\n";
+$HTMcontent .= "#if @DEVICE in png,gif\n";
+$HTMcontent .= "   scale: 0.6\n";
+$HTMcontent .= "\n";
+$HTMcontent .= "#endif\n";
+$HTMcontent .= "#proc getdata\n";
+$HTMcontent .= "file: $DOCroot/$DATfile\n";
+$HTMcontent .= "fieldnames: userproc sysproc datetime load processes channels\n";
+$HTMcontent .= "\n";
+$HTMcontent .= "#proc areadef\n";
+$HTMcontent .= "title: Server $group   $query_date_BEGIN to $query_date_END\n";
+$HTMcontent .= "titledetails: size=14  align=C\n";
+$HTMcontent .= "rectangle: 1 1 12 7\n";
+$HTMcontent .= "xscaletype: datetime yyyy-mm-dd.hh:mm:ss\n";
+$HTMcontent .= "xrange: $time_BEGIN $time_END\n";
+$HTMcontent .= "yrange: 0 $HIGHlimit\n";
+$HTMcontent .= "\n";
+$HTMcontent .= "#proc xaxis\n";
+$HTMcontent .= "stubs: inc $time_scale_abb\n";
+$HTMcontent .= "minorticinc: $time_scale_tick\n";
+$HTMcontent .= "stubformat: hh:mma\n";
+$HTMcontent .= "\n";
+$HTMcontent .= "#proc yaxis\n";
+$HTMcontent .= "stubs: inc 50\n";
+$HTMcontent .= "grid: color=yellow\n";
+$HTMcontent .= "gridskip: min\n";
+$HTMcontent .= "ticincrement: 100 1000\n";
+$HTMcontent .= "\n";
+$HTMcontent .= "#proc lineplot\n";
+$HTMcontent .= "xfield: datetime\n";
+$HTMcontent .= "yfield: userproc\n";
+$HTMcontent .= "linedetails: color=purple width=.5\n";
+$HTMcontent .= "fill: lavender\n";
+$HTMcontent .= "legendlabel: user proc%\n";
+$HTMcontent .= "maxinpoints: $rows_to_max\n";
+$HTMcontent .= "\n";
+$HTMcontent .= "#proc lineplot\n";
+$HTMcontent .= "xfield: datetime\n";
+$HTMcontent .= "yfield: sysproc\n";
+$HTMcontent .= "linedetails: color=yelloworange width=.5\n";
+$HTMcontent .= "fill: dullyellow\n";
+$HTMcontent .= "legendlabel: system proc%\n";
+$HTMcontent .= "maxinpoints: $rows_to_max\n";
+$HTMcontent .= "\n";
+$HTMcontent .= "#proc curvefit\n";
+$HTMcontent .= "xfield: datetime\n";
+$HTMcontent .= "yfield: load\n";
+$HTMcontent .= "linedetails: color=blue width=.5\n";
+$HTMcontent .= "legendlabel: load\n";
+$HTMcontent .= "maxinpoints: $rows_to_max\n";
+$HTMcontent .= "\n";
+$HTMcontent .= "#proc curvefit\n";
+$HTMcontent .= "xfield: datetime\n";
+$HTMcontent .= "yfield: processes\n";
+$HTMcontent .= "linedetails: color=red width=.5\n";
+$HTMcontent .= "legendlabel: processes\n";
+$HTMcontent .= "maxinpoints: $rows_to_max\n";
+$HTMcontent .= "\n";
+$HTMcontent .= "#proc curvefit\n";
+$HTMcontent .= "xfield: datetime\n";
+$HTMcontent .= "yfield: channels\n";
+$HTMcontent .= "linedetails: color=green width=.5\n";
+$HTMcontent .= "legendlabel: channels\n";
+$HTMcontent .= "maxinpoints: $rows_to_max\n";
+$HTMcontent .= "\n";
+$HTMcontent .= "#proc legend\n";
+$HTMcontent .= "location: max-1 max\n";
+$HTMcontent .= "seglen: 0.2\n";
+$HTMcontent .= "\n";
+
+fwrite ($HTMfp, "$HTMcontent");
+fclose($HTMfp);
+
+
+passthru("/usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile");
+
+sleep(1);
+
+echo "
"; +echo "\n"; +echo "\n"; + + +echo ""; + +} + + + +?> + +
+ + \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonVDAD.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonVDAD.php new file mode 100644 index 00000000..6598ba48 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonVDAD.php @@ -0,0 +1,445 @@ + LICENSE: AGPLv2 +# +# live real-time stats for the VICIDIAL Auto-Dialer +# +# CHANGES +# +# 60620-1037 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# 61114-2004 - Changed to display CLOSER and DEFAULT, added trunk shortage +# 80422-0305 - Added phone login to display, lower font size to 2 +# 81013-2227 - Fixed Remote Agent display bug +# 90310-1945 - Admin header +# 90508-0644 - Changed to PHP long tags +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} + elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["closer_display"])) {$closer_display=$_GET["closer_display"];} + elseif (isset($_POST["closer_display"])) {$closer_display=$_POST["closer_display"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +$epochSIXhoursAGO = ($STARTtime - 21600); +$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); + +$reset_counter++; + +if ($reset_counter > 7) + { + $reset_counter=0; + + $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; +# $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + + if ($DB) + { + $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; +# $rslt=mysql_query($stmt, $link); + echo "$stmt\n"; + } + } + +?> + + + +\n"; +echo " + + +\n"; +echo"\n"; +echo "Server-Specific Tempo Real Report\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
"; + +echo "
";
+
+###################################################################################
+###### SERVER INFORMATION
+###################################################################################
+
+$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where server_ip='" . mysql_real_escape_string($server_ip) . "';";
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$balanceSHORT = $row[0];
+
+echo "SERVER: $server_ip\n";
+
+
+
+###################################################################################
+###### TIME ON SYSTEM
+###################################################################################
+
+if ($closer_display>0) {$closer_display_reverse=0;   $closer_reverse_link='DEFAULT';}
+else {$closer_display_reverse=1;   $closer_reverse_link='CLOSER';}
+
+echo "Agentes Time On Calls           $NOW_TIME    $closer_reverse_link | RELATÓRIOS\n\n";
+
+if ($closer_display>0)
+{
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "| STATION    | PHONE      | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPANHA     | FRONT  |\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+}
+else
+{
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
+echo "| STATION    | PHONE      | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES |\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
+}
+
+$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),uniqueid,lead_id from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$talking_to_print = mysql_num_rows($rslt);
+	if ($talking_to_print > 0)
+	{
+	$i=0;
+	while ($i < $talking_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$Sextension[$i] =		$row[0];
+		$Suser[$i] =			$row[1];
+		$Ssessionid[$i] =		$row[2];
+		$Schannel[$i] =			$row[3];
+		$Sstatus[$i] =			$row[4];
+		$Sstart_time[$i] =		$row[5];
+		$Scall_time[$i] =		$row[6];
+		$Sfinish_time[$i] =		$row[7];
+		$Suniqueid[$i] =		$row[8];
+		$Slead_id[$i] =			$row[9];
+		$i++;
+		}
+
+	$i=0;
+	while ($i < $talking_to_print)
+		{
+		$phone[$i]='          ';
+		if (eregi("R/",$Sextension[$i])) 
+			{
+			$protocol = 'EXTERNAL';
+			$dialplan = eregi_replace('R/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("\@.*",'',$dialplan);
+			$exten = "dialplan_number='$dialplan'";
+			}
+		if (eregi("Local/",$Sextension[$i])) 
+			{
+			$protocol = 'EXTERNAL';
+			$dialplan = eregi_replace('Local/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("\@.*",'',$dialplan);
+			$exten = "dialplan_number='$dialplan'";
+			}
+		if (eregi('SIP/',$Sextension[$i])) 
+			{
+			$protocol = 'SIP';
+			$dialplan = eregi_replace('SIP/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("-.*",'',$dialplan);
+			$exten = "extension='$dialplan'";
+			}
+		if (eregi('IAX2/',$Sextension[$i])) 
+			{
+			$protocol = 'IAX2';
+			$dialplan = eregi_replace('IAX2/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("-.*",'',$dialplan);
+			$exten = "extension='$dialplan'";
+			}
+		if (eregi('Zap/',$Sextension[$i])) 
+			{
+			$protocol = 'Zap';
+			$dialplan = eregi_replace('Zap/',"",$Sextension[$i]);
+			$exten = "extension='$dialplan'";
+			}
+
+		$stmt="select login from phones where server_ip='" . mysql_real_escape_string($server_ip) . "' and $exten and protocol='$protocol';";
+		$rslt=mysql_query($stmt, $link);
+		$row=mysql_fetch_row($rslt);
+		$login = $row[0];
+
+		$phone[$i] =			sprintf("%-10s", $login);
+
+		if (eregi("READY|PAUSED|CLOSER",$Sstatus[$i]))
+			{
+			$Schannel[$i]='';
+			$Sstart_time[$i]='- WAIT -';
+			$Scall_time[$i]=$Sfinish_time[$i];
+			}
+		$extension[$i] = eregi_replace('Local/',"",$Sextension[$i]);
+		$extension[$i] =		sprintf("%-10s", $extension[$i]);
+			while(strlen($extension[$i])>10) {$extension[$i] = substr("$extension[$i]", 0, -1);}
+		$user[$i] =				sprintf("%-6s", $Suser[$i]);
+		$sessionid[$i] =		sprintf("%-9s", $Ssessionid[$i]);
+		$channel[$i] =			sprintf("%-19s", $Schannel[$i]);
+			$cc[$i]=0;
+		while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) )
+			{
+			$channel[$i] = eregi_replace(".$","",$channel[$i]);   
+			$cc[$i]++;
+			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
+			}
+		$status[$i] =			sprintf("%-6s", $Sstatus[$i]);
+		$start_time[$i] =		sprintf("%-8s", $Sstart_time[$i]);
+			$cd[$i]=0;
+		while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) )
+			{
+			$start_time[$i] = eregi_replace("^.","",$start_time[$i]);   
+			$cd[$i]++;
+			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
+			}
+		$uniqueid[$i] =			$Suniqueid[$i];
+		$lead_id[$i] =			$Slead_id[$i];
+		$closer[$i] =			$Suser[$i];
+		$call_time_S[$i] = ($STARTtime - $Scall_time[$i]);
+
+		$call_time_M[$i] = ($call_time_S[$i] / 60);
+		$call_time_M[$i] = round($call_time_M[$i], 2);
+		$call_time_M_int[$i] = intval("$call_time_M[$i]");
+		$call_time_SEC[$i] = ($call_time_M[$i] - $call_time_M_int[$i]);
+		$call_time_SEC[$i] = ($call_time_SEC[$i] * 60);
+		$call_time_SEC[$i] = round($call_time_SEC[$i], 0);
+		if ($call_time_SEC[$i] < 10) {$call_time_SEC[$i] = "0$call_time_SEC[$i]";}
+		$call_time_MS[$i] = "$call_time_M_int[$i]:$call_time_SEC[$i]";
+		$call_time_MS[$i] =		sprintf("%7s", $call_time_MS[$i]);
+
+		if ($closer_display<1)
+			{
+			$G = '';		$EG = '';
+			if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
+			if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
+			if (eregi("PAUSED",$Sstatus[$i])) 
+				{
+				if ($call_time_M_int >= 1) 
+					{$i++; continue;} 
+				else
+					{$G=''; $EG='';}
+				}
+			$agentcount++;
+			echo "| $G$extension[$i]$EG | $G$phone[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG |\n";
+			}
+		$i++;
+		}
+
+		if ($closer_display>0)
+		{
+
+			$ext_count = $i;
+			$i=0;
+		while ($i < $ext_count)
+			{
+
+			$stmt="select campaign_id from vicidial_auto_calls where lead_id='$lead_id[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';";
+			$rslt=mysql_query($stmt, $link);
+			if ($DB) {echo "$stmt\n";}
+			$camp_to_print = mysql_num_rows($rslt);
+			if ($camp_to_print > 0)
+				{
+				$row=mysql_fetch_row($rslt);
+				$campaign = sprintf("%-12s", $row[0]);
+				$camp_color = $row[0];
+				}
+			else
+				{$campaign = 'DEAD        ';   	$camp_color = 'DEAD';}
+			if (eregi("READY|PAUSED|CLOSER",$status[$i]))
+				{$campaign = '            ';   	$camp_color = '';}
+
+			$stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;";
+			$rslt=mysql_query($stmt, $link);
+			if ($DB) {echo "$stmt\n";}
+			$xfer_to_print = mysql_num_rows($rslt);
+			if ($xfer_to_print > 0)
+				{
+				$row=mysql_fetch_row($rslt);
+				$fronter = sprintf("%-6s", $row[0]);
+				}
+			else
+				{$fronter = '      ';}
+
+			$G = '';		$EG = '';
+			$G=""; $EG='';
+		#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
+		#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
+
+			echo "| $G$extension[$i]$EG | $G$phone[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG | $G$campaign$EG | $G$fronter$EG |\n";
+
+			$i++;
+			}
+		echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+		echo "  $i agentes conectados ao servidor $server_ip\n\n";
+	#	echo "             - Acima de 5 minutos em chamada\n";
+	#	echo "             - Acima de 10 minutos em chamada\n";
+		}
+	else
+		{
+		echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
+		echo "  $agentcount agentes conectados ao servidor $server_ip\n\n";
+
+		echo "             - Agentes em pausa\n";
+		echo "             - Acima de 5 minutos em chamada\n";
+		echo "             - Acima de 10 minutos em chamada\n";
+		}
+
+	}
+	else
+	{
+	echo "**************************************************************************************\n";
+	echo "**************************************************************************************\n";
+	echo "*********************************AGENTES SEM CHAMADAS*********************************\n";
+	echo "**************************************************************************************\n";
+	echo "**************************************************************************************\n";
+	}
+
+
+###################################################################################
+###### OUTBOUND CALLS
+###################################################################################
+#echo "\n\n";
+echo "----------------------------------------------------------------------------------------";
+echo "\n\n";
+echo "Server-Specific Tempo Real Report        TRUNK SHORT: $balanceSHORT          $NOW_TIME\n\n";
+echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
+echo "| CHANNEL             | STATUS | CAMPANHA     | PHONE NUMBER       | CALLTIME | MINUTES |\n";
+echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
+
+$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id desc;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$parked_to_print = mysql_num_rows($rslt);
+	if ($parked_to_print > 0)
+	{
+	$i=0;
+	while ($i < $parked_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+
+		$channel =			sprintf("%-19s", $row[0]);
+			$cc=0;
+		while ( (strlen($channel) > 19) and ($cc < 100) )
+			{
+			$channel = eregi_replace(".$","",$channel);   
+			$cc++;
+			if (strlen($channel) <= 19) {$cc=101;}
+			}
+		$start_time =		sprintf("%-8s", $row[5]);
+			$cd=0;
+		while ( (strlen($start_time) > 8) and ($cd < 100) )
+			{
+			$start_time = eregi_replace("^.","",$start_time);   
+			$cd++;
+			if (strlen($start_time) <= 8) {$cd=101;}
+			}
+		$status =			sprintf("%-6s", $row[1]);
+		$campaign =			sprintf("%-12s", $row[2]);
+			$all_phone = "$row[3]$row[4]";
+		$number_dialed =	sprintf("%-18s", $all_phone);
+		$call_time_S = ($STARTtime - $row[6]);
+
+		$call_time_M = ($call_time_S / 60);
+		$call_time_M = round($call_time_M, 2);
+		$call_time_M_int = intval("$call_time_M");
+		$call_time_SEC = ($call_time_M - $call_time_M_int);
+		$call_time_SEC = ($call_time_SEC * 60);
+		$call_time_SEC = round($call_time_SEC, 0);
+		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
+		$call_time_MS = "$call_time_M_int:$call_time_SEC";
+		$call_time_MS =		sprintf("%7s", $call_time_MS);
+		$G = '';		$EG = '';
+		if (eregi("LIVE",$status)) {$G=''; $EG='';}
+	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
+
+		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
+
+		$i++;
+		}
+
+		echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
+		echo "  $i chamadas sendo efetuadas $server_ip\n\n";
+
+		echo "             - CHAMADAS EM ESPERA\n";
+	#	echo "             - Over 5 minutes on hold\n";
+
+		}
+	else
+	{
+	echo "***************************************************************************************\n";
+	echo "***************************************************************************************\n";
+	echo "*******************************SEM CHAMADAS EM ESPERA*********************************\n";
+	echo "***************************************************************************************\n";
+	echo "***************************************************************************************\n";
+	}
+
+
+?>
+
+
+ + \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonVDADall.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonVDADall.php new file mode 100644 index 00000000..cceb0a6b --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonVDADall.php @@ -0,0 +1,2347 @@ + LICENSE: AGPLv2 +# +# live real-time stats for the VICIDIAL Auto-Dialer all servers +# +# STOP=4000, SLOW=40, GO=4 seconds refresh interval +# +# CHANGELOG: +# 50406-0920 - Added Paused agents < 1 min +# 51130-1218 - Modified layout and info to show all servers in a vicidial system +# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60511-1343 - Added leads and drop info at the top of the screen +# 60608-1539 - Fixed CLOSER tallies for active calls +# 60619-1658 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# 60626-1453 - Added display of system load to bottom (Angelito Manansala) +# 60901-1123 - Changed display elements at the top of the screen +# 60905-1342 - Fixed non INCALL|QUEUE timer column +# 61002-1642 - Added TRUNK SHORT/FILL stats +# 61101-1318 - Added SIP and IAX Listen and Barge links option +# 61101-1647 - Added Usergroup column and user name option as well as sorting +# 61102-1155 - Made display of columns more modular, added ability to hide server info +# 61215-1131 - Added answered calls and drop percent taken from answered calls +# 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns +# 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu +# 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer) +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction +# 80227-0418 - Added priority to waiting calls display +# 80311-1550 - Added calls_today on all agents and wait time/in-group for inbound calls +# 80422-0033 - Added phonediaplay option, allow for toggle-sorting on sortable fields +# 80422-1001 - Fixed sort by phone login +# 80424-0515 - Added non_latin lookup from system_settings +# 80525-1040 - Added IVR status display and summary for inbound calls +# 80619-2047 - Added DISPO status for post-call-work while paused +# 80704-0543 - Added DEAD status for agents INCALL with no live call +# 80822-1222 - Added option for display of customer phone number +# 81011-0335 - Fixed remote agent display bug +# 81022-1500 - Added inbound call stats display option +# 81029-1023 - Changed drop percent calculation for multi-stat reports +# 81029-1706 - Added pause code display if enabled per campaign +# 81108-2337 - Added inbound-only section +# 90105-1153 - Changed monitor links to use 0 prefix instead of 6 +# 90202-0108 - Changed options to pop-out frame, added outbound_autodial_active option +# 90310-0906 - Added admin header +# 90428-0727 - Changed listen and barge to use the API and manager must enter phone +# 90508-0623 - Changed to PHP long tags +# 90518-0930 - Fixed $CALLSdisplay static assignment bug for some links(bug #210) +# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion +# 90602-0405 - Added list mix display in statuses and order if active +# 90603-1845 - Fixed color coding bug +# 90627-0608 - Some Formatting changes, added in-group name display +# 90701-0657 - Fixed inbound=No calculation issues +# 90808-0212 - Fixed inbound only non-ALL bug, changed times to use agent last_state_change +# 90907-0915 - Added PARK status +# 90914-1154 - Added AgentOnly display column to waiting calls section +# 91102-2013 - Changed in-group color styles for incoming calls waiting +# 91204-1548 - Added ability to change agent in-groups and blended +# 100214-1127 - Added no-dialable-leads alert and in-groups stats option +# 100301-1229 - Added 3-WAY status for consultative transfer agents +# 100303-0930 - Added carrier stats display option +# + +$version = '2.2.0-52'; +$build = '100303-0930'; + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["RR"])) {$RR=$_GET["RR"];} + elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} +if (isset($_GET["inbound"])) {$inbound=$_GET["inbound"];} + elseif (isset($_POST["inbound"])) {$inbound=$_POST["inbound"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["groups"])) {$groups=$_GET["groups"];} + elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} +if (isset($_GET["usergroup"])) {$usergroup=$_GET["usergroup"];} + elseif (isset($_POST["usergroup"])) {$usergroup=$_POST["usergroup"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} + elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["SIPmonitorLINK"])) {$SIPmonitorLINK=$_GET["SIPmonitorLINK"];} + elseif (isset($_POST["SIPmonitorLINK"])) {$SIPmonitorLINK=$_POST["SIPmonitorLINK"];} +if (isset($_GET["IAXmonitorLINK"])) {$IAXmonitorLINK=$_GET["IAXmonitorLINK"];} + elseif (isset($_POST["IAXmonitorLINK"])) {$IAXmonitorLINK=$_POST["IAXmonitorLINK"];} +if (isset($_GET["UGdisplay"])) {$UGdisplay=$_GET["UGdisplay"];} + elseif (isset($_POST["UGdisplay"])) {$UGdisplay=$_POST["UGdisplay"];} +if (isset($_GET["UidORname"])) {$UidORname=$_GET["UidORname"];} + elseif (isset($_POST["UidORname"])) {$UidORname=$_POST["UidORname"];} +if (isset($_GET["orderby"])) {$orderby=$_GET["orderby"];} + elseif (isset($_POST["orderby"])) {$orderby=$_POST["orderby"];} +if (isset($_GET["SERVdisplay"])) {$SERVdisplay=$_GET["SERVdisplay"];} + elseif (isset($_POST["SERVdisplay"])) {$SERVdisplay=$_POST["SERVdisplay"];} +if (isset($_GET["CALLSdisplay"])) {$CALLSdisplay=$_GET["CALLSdisplay"];} + elseif (isset($_POST["CALLSdisplay"])) {$CALLSdisplay=$_POST["CALLSdisplay"];} +if (isset($_GET["PHONEdisplay"])) {$PHONEdisplay=$_GET["PHONEdisplay"];} + elseif (isset($_POST["PHONEdisplay"])) {$PHONEdisplay=$_POST["PHONEdisplay"];} +if (isset($_GET["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_GET["CUSTPHONEdisplay"];} + elseif (isset($_POST["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_POST["CUSTPHONEdisplay"];} +if (isset($_GET["NOLEADSalert"])) {$NOLEADSalert=$_GET["NOLEADSalert"];} + elseif (isset($_POST["NOLEADSalert"])) {$NOLEADSalert=$_POST["NOLEADSalert"];} +if (isset($_GET["DROPINGROUPstats"])) {$DROPINGROUPstats=$_GET["DROPINGROUPstats"];} + elseif (isset($_POST["DROPINGROUPstats"])) {$DROPINGROUPstats=$_POST["DROPINGROUPstats"];} +if (isset($_GET["ALLINGROUPstats"])) {$ALLINGROUPstats=$_GET["ALLINGROUPstats"];} + elseif (isset($_POST["ALLINGROUPstats"])) {$ALLINGROUPstats=$_POST["ALLINGROUPstats"];} +if (isset($_GET["with_inbound"])) {$with_inbound=$_GET["with_inbound"];} + elseif (isset($_POST["with_inbound"])) {$with_inbound=$_POST["with_inbound"];} +if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"];} + elseif (isset($_POST["monitor_active"])) {$monitor_active=$_POST["monitor_active"];} +if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];} + elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];} +if (isset($_GET["CARRIERstats"])) {$CARRIERstats=$_GET["CARRIERstats"];} + elseif (isset($_POST["CARRIERstats"])) {$CARRIERstats=$_POST["CARRIERstats"];} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if (!isset($DB)) {$DB=0;} +if (!isset($RR)) {$RR=40;} +if (!isset($group)) {$group='';} +if (!isset($usergroup)) {$usergroup='';} +if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes +if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name +if (!isset($orderby)) {$orderby='timeup';} +if (!isset($SERVdisplay)) {$SERVdisplay=0;} # 0=no, 1=yes +if (!isset($CALLSdisplay)) {$CALLSdisplay=1;} # 0=no, 1=yes +if (!isset($PHONEdisplay)) {$PHONEdisplay=0;} # 0=no, 1=yes +if (!isset($CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} # 0=no, 1=yes +if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes +if (!isset($with_inbound)) + { + if ($outbound_autodial_active > 0) + {$with_inbound='Y';} # N=no, Y=yes, O=only + else + {$with_inbound='O';} # N=no, Y=yes, O=only + } +$ingroup_detail=''; + +if (strlen($group)>1) {$groups[0] = $group; $RR=40;} +else {$group = $groups[0];} + +function get_server_load($windows = false) + { + $os = strtolower(PHP_OS); + if(strpos($os, "win") === false) + { + if(file_exists("/proc/loadavg")) + { + $load = file_get_contents("/proc/loadavg"); + $load = explode(' ', $load); + return $load[0] . ' ' . $load[1] . ' ' . $load[2]; + } + elseif(function_exists("shell_exec")) + { + $load = explode(' ', `uptime`); + return $load[count($load)-3] . ' ' . $load[count($load)-2] . ' ' . $load[count($load)-1]; + } + else + { + return false; + } + } + elseif($windows) + { + if(class_exists("COM")) + { + $wmi = new COM("WinMgmts:\\\\."); + $cpus = $wmi->InstancesOf("Win32_Processor"); + + $cpuload = 0; + $i = 0; + while ($cpu = $cpus->Next()) + { + $cpuload += $cpu->LoadPercentage; + $i++; + } + + $cpuload = round($cpuload / $i, 2); + return "$cpuload%"; + } + else + { + return false; + } + } + } + +$load_ave = get_server_load(true); + +$NOW_TIME = date("Y-m-d H:i:s"); +$NOW_DAY = date("Y-m-d"); +$NOW_HOUR = date("H:i:s"); +$STARTtime = date("U"); +$epochONEminuteAGO = ($STARTtime - 60); +$timeONEminuteAGO = date("Y-m-d H:i:s",$epochONEminuteAGO); +$epochFIVEminutesAGO = ($STARTtime - 300); +$timeFIVEminutesAGO = date("Y-m-d H:i:s",$epochFIVEminutesAGO); +$epochFIFTEENminutesAGO = ($STARTtime - 900); +$timeFIFTEENminutesAGO = date("Y-m-d H:i:s",$epochFIFTEENminutesAGO); +$epochONEhourAGO = ($STARTtime - 3600); +$timeONEhourAGO = date("Y-m-d H:i:s",$epochONEhourAGO); +$epochSIXhoursAGO = ($STARTtime - 21600); +$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); +$epochTWENTYFOURhoursAGO = ($STARTtime - 86400); +$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); + + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +# and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) ) +if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) + { + $stmt="select phone_login from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active='Y';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $monitor_phone = $row[0]; + } + +$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +$LISTgroups[$i]='ALL-ACTIVE'; +$i++; +$groups_to_print++; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTgroups[$i] =$row[0]; + $LISTnames[$i] =$row[1]; + $i++; + } + +$i=0; +$group_string='|'; +$group_ct = count($groups); +while($i < $group_ct) + { + $group_string .= "$groups[$i]|"; + $group_SQL .= "'$groups[$i]',"; + $groupQS .= "&groups[]=$groups[$i]"; + $i++; + } +$group_SQL = eregi_replace(",$",'',$group_SQL); + +### if no campaigns selected, display all +if ($group_ct < 1) + { + $groups[0] = 'ALL-ACTIVE'; + $group_string = 'ALL-ACTIVE'; + $group = 'ALL-ACTIVE'; + $groupQS .= "&groups[]=ALL-ACTIVE"; + } + +if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $all_active = 0; + $group_SQL = "''"; + $group_SQLand = "and FALSE"; + $group_SQLwhere = "where FALSE"; + } +elseif ( eregi('ALL-ACTIVE',$group_string) ) + { + $all_active = 1; + $group_SQL = "''"; + $group_SQLand = ""; + $group_SQLwhere = ""; + } +else + { + $all_active = 0; + $group_SQLand = "and campaign_id IN($group_SQL)"; + $group_SQLwhere = "where campaign_id IN($group_SQL)"; + } + + +$stmt="select user_group from vicidial_user_groups;"; +$rslt=mysql_query($stmt, $link); +if (!isset($DB)) {$DB=0;} +if ($DB) {echo "$stmt\n";} +$usergroups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $usergroups_to_print) + { + $row=mysql_fetch_row($rslt); + $usergroups[$i] =$row[0]; + $i++; + } + +if (!isset($RR)) {$RR=4;} + +$NFB = ''; +$NFE = ''; +$F=''; $FG=''; $B=''; $BG=''; + +$select_list = "
Select Campanhas:
"; +$select_list .= ""; +$select_list .= "
(Para selecionar mais de 1 campanha, aperte Ctrl e clique)"; +$select_list .= "
"; +$select_list .= "Fechar Painel

"; +$select_list .= ""; + +$select_list .= ""; +$select_list .= ""; + +if ($UGdisplay > 0) + { + $select_list .= ""; + } + +$select_list .= ""; +$select_list .= ""; +$select_list .= "
"; +$select_list .= "Inbound:
 
"; + $select_list .= "Select Grupo do Usuário: "; + $select_list .= "
"; +$select_list .= "Dialable Leads Alert:
"; +$select_list .= "   "; +$select_list .= ""; +$select_list .= "VERSÃO: $version   BUILD: $build"; +$select_list .= "
"; + +$open_list = "
Escolher Opções do Relat.
"; + +?> + + + + + + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;"; +$rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo"\n"; +echo "Tempo Real Report: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +echo ""; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + } + + +##### CARRIER STATS TOTALS ### +$CARRIERstatsHTML=''; +if ($CARRIERstats > 0) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeTWENTYFOURhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $car_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($car_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $TFhour_status[$ctp] = $row[0]; + $TFhour_count[$ctp] = $row[1]; + $dialstatuses .= "'$row[0]',"; + $ctp++; + } + $dialstatuses = preg_replace("/,$/",'',$dialstatuses); + + $CARRIERstatsHTML .= ""; + } + +# http://svn.eflo.net:40080/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 + +##### INBOUND ONLY ### +if (ereg('O',$with_inbound)) + { + $multi_drop++; + + $stmt="select agent_pause_codes_active from vicidial_campaigns $group_SQLwhere;"; + + $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)) + { + $inboundSQL = "where campaign_id IN ($ALLcloser_campaignsSQL)"; + $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 $inboundSQL;"; + } + + $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; + + + 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_RESPOSTAagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_RESPOSTAagent_non_pause_sec = round($AVG_RESPOSTAagent_non_pause_sec, 2); + $AVG_RESPOSTAagent_non_pause_sec = sprintf("%01.2f", $AVG_RESPOSTAagent_non_pause_sec); + } + else + {$AVG_RESPOSTAagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_RESPOSTAagent_non_pause_sec=0; + } + + echo "
"; + +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "Tempo Real Report                                                                               \n"; +echo "\n"; +echo "
\n"; +echo "Escolher Opções do Relat."; +echo "
\n"; +echo "
\n"; +echo "\n"; +echo "   "; +echo "\n"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; +if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       ALTERAR | \n"; + } +else + { + echo "       ALTERAR | \n"; + } +echo "SUMMARY \n"; +echo "\n\n"; + + +if (!$group) + {echo "

please select a campaign from the pulldown above
\n"; exit;} +else +{ +$multi_drop=0; +### Gather list of all Closer group ids for exclusion from stats +$stmt = "select group_id from vicidial_inbound_groups;"; +$rslt=mysql_query($stmt, $link); +$ingroups_to_print = mysql_num_rows($rslt); +while ($ingroups_to_print > $c) + { + $row=mysql_fetch_row($rslt); + $ALLcloser_campaignsSQL .= "'$row[0]',"; + $c++; + } +$ALLcloser_campaignsSQL = preg_replace("/,$/","",$ALLcloser_campaignsSQL); +if (strlen($ALLcloser_campaignsSQL)<2) + {$ALLcloser_campaignsSQL="''";} +if ($DB > 0) {echo "\n|$ALLcloser_campaignsSQL|$stmt|\n";} + + +##### INBOUND ##### +if ( ( ereg('Y',$with_inbound) or ereg('O',$with_inbound) ) and ($campaign_allow_inbound > 0) ) + { + ### Gather list of Closer group ids + $stmt = "select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand;"; + $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); + } +else + { + $closer_campaignsSQL = "''"; + } +if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} + + +##### SHOW IN-GROUP STATS OR INBOUND ONLY WITH VIEW-MORE ### +if ( ($ALLINGROUPstats > 0) or ( (ereg('O',$with_inbound)) and ($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) order by campaign_id;"; + + 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_RESPOSTAagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_RESPOSTAagent_non_pause_sec = round($AVG_RESPOSTAagent_non_pause_sec, 2); + $AVG_RESPOSTAagent_non_pause_sec = sprintf("%01.2f", $AVG_RESPOSTAagent_non_pause_sec); + } + else + {$AVG_RESPOSTAagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_RESPOSTAagent_non_pause_sec=0; + } + + if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';} + else {$bgcolor='white';} + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + + $r++; + } + + if ($ingroups_to_print > 0) + {$ingroup_detail .= "
        $ingroupdetail   CALLS TODAY:  $callsTODAY    TMA 1:  $PCThold_sec_stat_one%     Average Hold time for Answered Calls:  $AVGhold_sec_answer_calls  
DROPS TODAY:  $dropsTODAY    TMA 2:  $PCThold_sec_stat_two%     Average Hold time for Dropped Calls:  $AVGhold_sec_drop_calls  
RESPOSTAS TODAY:  $answersTODAY    DROP PERCENT:  $drpctTODAY%    Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
";} + } + + +##### DROP IN-GROUP ONLY TOTALS ROW ### +$DROPINGROUPstatsHTML=''; +if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) + { + $DIGcampaigns=''; + $stmtB="select drop_inbound_group from vicidial_campaigns where campaign_id IN($group_SQL) and drop_inbound_group NOT IN('---NONE---','');"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $dig_to_print = mysql_num_rows($rslt); + $dtp=0; + while ($dig_to_print > $dtp) + { + $row=mysql_fetch_row($rslt); + $DIGcampaigns .= "'$row[0]',"; + $dtp++; + } + $DIGcampaigns = preg_replace("/,$/",'',$DIGcampaigns); + if (strlen($DIGcampaigns) < 2) {$DIGcampaigns = "''";} + + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today) from vicidial_campaign_stats where campaign_id IN($DIGcampaigns);"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + if ( ($dropsTODAY > 0) and ($callsTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $callsTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + $DROPINGROUPstatsHTML .= "
DROP IN-GROUP STATS -DROP PERCENT:  $drpctTODAY%     CALLS:  $callsTODAY     DROPS/RESPOSTAS:  $dropsTODAY / $answersTODAY    
"; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + + if (strlen($dialstatuses) > 1) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeSIXhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$SIXhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEhourAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIFTEENminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FTminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIVEminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FIVEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEminuteAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + + $print_ctp=0; + while ($print_ctp < $ctp) + { + if (strlen($TFhour_count[$print_ctp])<1) {$TFhour_count[$print_ctp]=0;} + if (strlen($SIXhour_count[$print_ctp])<1) {$SIXhour_count[$print_ctp]=0;} + if (strlen($ONEhour_count[$print_ctp])<1) {$ONEhour_count[$print_ctp]=0;} + if (strlen($FTminute_count[$print_ctp])<1) {$FTminute_count[$print_ctp]=0;} + if (strlen($FIVEminute_count[$print_ctp])<1) {$FIVEminute_count[$print_ctp]=0;} + if (strlen($ONEminute_count[$print_ctp])<1) {$ONEminute_count[$print_ctp]=0;} + + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $print_ctp++; + } + } + else + { + $CARRIERstatsHTML .= ""; + } + $CARRIERstatsHTML .= "
CARRIER STATS:                 HANGUP STATUS     24 HOURS     6 HOURS     1 HOUR     15 MIN     5 MIN     1 MIN  
     $TFhour_status[$print_ctp] $TFhour_count[$print_ctp] $SIXhour_count[$print_ctp] $ONEhour_count[$print_ctp] $FTminute_count[$print_ctp] $FIVEminute_count[$print_ctp] $ONEminute_count[$print_ctp]
no log entries
"; + $CARRIERstatsHTML .= "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + +##### NOT INBOUND ONLY ### +else + { + if (eregi('ALL-ACTIVE',$group_string)) + { + $non_inboundSQL=''; + if (ereg('N',$with_inbound)) + {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} + $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 where active='Y';"; + + $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 $non_inboundSQL;"; + } + 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 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 $group_SQLwhere;"; + $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 $group_SQLwhere;"; + $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 status='ACTIVE' $groupSQLand 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 = "Mesclagem de Lista: $row[0]"; + $DIALorder = "Mesclagem de Lista: $row[0]"; + } + } + + echo "
CALLS TODAY:  $callsTODAY    TMA 1:  $PCThold_sec_stat_one%     Average Hold time for Answered Calls:  $AVGhold_sec_answer_calls   TIME:   $NOW_TIME
DROPS TODAY:  $dropsTODAY    TMA 2:  $PCThold_sec_stat_two%     Average Hold time for Dropped Calls:  $AVGhold_sec_drop_calls  
RESPOSTAS TODAY:  $answersTODAY    (Agent non-pause time / Answers)Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
DROP PERCENT:  $drpctTODAY%    PRODUCTIVITY:  $AVG_RESPOSTAagent_non_pause_sec    
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + if ($adastats>1) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + + echo "$DROPINGROUPstatsHTML\n"; + echo "$CARRIERstatsHTML\n"; + } + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
DIAL NÍVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
- min   MAX NÍVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     MÉTODO DE DISC.:  $DIALmethod    
HOPPER NÍVEL:  $HOPlev     DROPPED / RESPOSTAED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUS:  $DIALstatuses    
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; + if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} + else + {echo "$drpctTODAY%";} + echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +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 "$ingroup_detail"; + +if ($adastats<2) + { + echo "+ VIEW MORE"; + } +else + { + echo "+ VIEW LESS"; + } +if ($UGdisplay>0) + { + echo "       ESCONDER GRUPO DE USUÁRIOS"; + } +else + { + echo "       VIEW GRUPO DE USUÁRIOS"; + } +if ($SERVdisplay>0) + { + echo "       ESCONDER SERVIDOR INFO"; + } +else + { + echo "       MOSTRAR SERVIDOR INFO"; + } +if ($CALLSdisplay>0) + { + echo "       ESCONDER WAITING CALLS"; + } +else + { + echo "       MOSTRAR WAITING CALLS"; + } + +if ($ALLINGROUPstats>0) + { + echo "       ESCONDER IN-GROUP STATS"; + } +else + { + echo "       MOSTRAR IN-GROUP STATS"; + } +if ($PHONEdisplay>0) + { + echo "       ESCONDER PHONES"; + } +else + { + echo "       MOSTRAR PHONES"; + } +if ($CUSTPHONEdisplay>0) + { + echo "       ESCONDER CUSTPHONES"; + } +else + { + echo "       MOSTRAR CUSTPHONES"; + } +echo "
"; + +echo "\n\n"; + +##### check for campaigns with no dialable leads if enabled ##### +if ( ($with_inbound != 'O') and ($NOLEADSalert == 'YES') ) + { + $NDLcampaigns=''; + $stmtB="select campaign_id from vicidial_campaign_stats where campaign_id IN($group_SQL) and dialable_leads < 1 order by campaign_id;"; + if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $campaigns_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($campaigns_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $NDLcampaigns .= " $row[0]   "; + $ctp++; + if (preg_match("/0$|5$/",$ctp)) + {$NDLcampaigns .= "
";} + } + if ($ctp > 0) + { + echo "\n"; + echo "
\n"; + echo "



Close Alert"; + echo "




Campanhas with no dialable leads:

$NDLcampaigns
"; + echo "










  "; + echo "
\n"; + echo "
\n"; + } + } +} + + + +################################################################################### +###### INBOUND/OUTBOUND CALLS +################################################################################### +if ($campaign_allow_inbound > 0) + { + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select closer_campaigns from vicidial_campaigns $group_SQLwhere"; + $rslt=mysql_query($stmt, $link); + $closer_campaigns=""; + while ($row=mysql_fetch_row($rslt)) + { + $closer_campaigns.="$row[0]"; + } + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL = "'$closer_campaigns'"; + } + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; + } +else + { + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') $group_SQLand 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,agent_only"; + } +else + { + $stmtA = "SELECT status"; + } + + +$k=0; +$agentonlycount=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]; + $CDagent_only[$k] = $row[7]; + if (strlen($CDagent_only[$k]) > 0) {$agentonlycount++;} + $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]; + $CDagent_only[$k] = $row[7]; + if (strlen($CDagent_only[$k]) > 0) {$agentonlycount++;} + $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 ""; + # echo ""; + # echo " "; + # echo " "; + # echo " "; + # echo " "; + # echo " alt : test.mid"; + # echo ""; + # } + + if ($out_live > 0) {$F=''; $FG='';} + if ($out_live > 4) {$F=''; $FG='';} + if ($out_live > 9) {$F=''; $FG='';} + if ($out_live > 14) {$F=''; $FG='';} + + if ($campaign_allow_inbound > 0) + {echo "$NFB$out_total$NFE current active calls      \n";} + else + {echo "$NFB$out_total$NFE calls being placed       \n";} + + echo "$NFB$out_ring$NFE calls ringing         \n"; + echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + echo "$NFB  $in_ivr$NFE calls in IVR       \n"; + } + else + { + echo "SEM CHAMADAS EM ESPERA\n"; + } + + + +################################################################################### +###### CALLS WAITING +################################################################################### +$agentonlyheader = ''; +if ($agentonlycount > 0) + {$agentonlyheader = 'AGENTONLY';} +$Cecho = ''; +$Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPANHA | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORIDADE | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; + +$p=0; +while($p<$k) + { + $Cstatus = sprintf("%-6s", $CDstatus[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); + $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); + $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); + $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); + $Cqueue_priority = sprintf("%8s", $CDqueue_priority[$p]); + $Cagent_only = sprintf("%8s", $CDagent_only[$p]); + + $Ccall_time_S = ($STARTtime - $CDcall_time[$p]); + $Ccall_time_MS = sec_convert($Ccall_time_S,'M'); + $Ccall_time_MS = sprintf("%7s", $Ccall_time_MS); + + $G = ''; $EG = ''; + if ($CDcall_type[$p] == 'IN') + { + $G=""; $EG=''; + } + if (strlen($CDagent_only[$p]) > 0) + {$Gcalltypedisplay = "$G$Cagent_only$EG";} + else + {$Gcalltypedisplay = '';} + + $Cecho .= "| $G$Cstatus$EG | $G$Ccampaign_id$EG | $G$Cphone_number$EG | $G$Cserver_ip$EG | $G$Ccall_time_MS$EG | $G$Ccall_type$EG | $G$Cqueue_priority$EG | $Gcalltypedisplay \n"; + + $p++; + } +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; + +if ($p<1) + {$Cecho='';} + +################################################################################### +###### AGENT TIME ON SYSTEM +################################################################################### + +$agent_incall=0; +$agent_ready=0; +$agent_paused=0; +$agent_dead=0; +$agent_total=0; + +$phoneord=$orderby; +$userord=$orderby; +$groupord=$orderby; +$timeord=$orderby; +$campaignord=$orderby; + +if ($phoneord=='phoneup') {$phoneord='phonedown';} + else {$phoneord='phoneup';} +if ($userord=='userup') {$userord='userdown';} + else {$userord='userup';} +if ($groupord=='groupup') {$groupord='groupdown';} + else {$groupord='groupup';} +if ($timeord=='timeup') {$timeord='timedown';} + else {$timeord='timeup';} +if ($campaignord=='campaignup') {$campaignord='campaigndown';} + else {$campaignord='campaignup';} + +$Aecho = ''; +$Aecho .= "VICIDIAL: Agentes Time On Calls Campanha: $group_string $NOW_TIME\n"; + + +$HDbegin = "+"; +$HTbegin = "|"; +$HDstation = "----------------+"; +$HTstation = " STATION |"; +$HDphone = "-------------+"; +$HTphone = " PHONE |"; +$HDuser = "------------------------+"; + + +$HTuser = " USER "; +if ($UidORname>0) + { + $HTuser .= "MOSTRAR ID "; + } +else + { + $HTuser .= "MOSTRAR NAME"; + } + +$HTuser .= " INFO |"; + + +$HDusergroup = "--------------+"; +$HTusergroup = " GRUPO DE USUÁRIOS |"; +$HDsessionid = "------------------+"; +$HTsessionid = " SESSIONID |"; +$HDbarge = "-------+"; +$HTbarge = " BARGE |"; +$HDstatus = "----------+"; +$HTstatus = " STATUS |"; +$HDcustphone = "-------------+"; +$HTcustphone = " CUST PHONE |"; +$HDserver_ip = "-----------------+"; +$HTserver_ip = " SERVIDOR IP |"; +$HDcall_server_ip = "-----------------+"; +$HTcall_server_ip = " CALL SERVIDOR IP |"; +$HDtime = "---------+"; +$HTtime = " MM:SS |"; +$HDcampaign = "------------+"; +$HTcampaign = " CAMPANHA |"; +$HDcalls = "-------+"; +$HTcalls = " CALLS |"; +$HDpause = ''; +$HTpause = ''; +$HDigcall = "------+------------------"; +$HTigcall = " HOLD | IN-GROUP "; + +if (!ereg("N",$agent_pause_codes_active)) + { + $HDstatus = "----------"; + $HTstatus = " STATUS "; + $HDpause = "-------+"; + $HTpause = " PAUSE |"; + } +if ($PHONEdisplay < 1) + { + $HDphone = ''; + $HTphone = ''; + } +if ($CUSTPHONEdisplay < 1) + { + $HDcustphone = ''; + $HTcustphone = ''; + } +if ($UGdisplay < 1) + { + $HDusergroup = ''; + $HTusergroup = ''; + } +if ( ($SIPmonitorLINK<1) and ($IAXmonitorLINK<1) and (!preg_match("/MONITOR|BARGE/",$monitor_active) ) ) + { + $HDsessionid = "-----------+"; + $HTsessionid = " SESSIONID |"; + } +if ( ($SIPmonitorLINK<2) and ($IAXmonitorLINK<2) and (!preg_match("/BARGE/",$monitor_active) ) ) + { + $HDbarge = ''; + $HTbarge = ''; + } +if ($SERVdisplay < 1) + { + $HDserver_ip = ''; + $HTserver_ip = ''; + $HDcall_server_ip = ''; + $HTcall_server_ip = ''; + } + + + +$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; +$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; +$Aecho .= "$Aline"; +$Aecho .= "$Bline"; +$Aecho .= "$Aline"; + +if ($orderby=='timeup') {$orderSQL='vicidial_live_agents.status,last_call_time';} +if ($orderby=='timedown') {$orderSQL='vicidial_live_agents.status desc,last_call_time desc';} +if ($orderby=='campaignup') {$orderSQL='vicidial_live_agents.campaign_id,vicidial_live_agents.status,last_call_time';} +if ($orderby=='campaigndown') {$orderSQL='vicidial_live_agents.campaign_id desc,vicidial_live_agents.status desc,last_call_time desc';} +if ($orderby=='groupup') {$orderSQL='user_group,vicidial_live_agents.status,last_call_time';} +if ($orderby=='groupdown') {$orderSQL='user_group desc,vicidial_live_agents.status desc,last_call_time desc';} +if ($orderby=='phoneup') {$orderSQL='extension,server_ip';} +if ($orderby=='phonedown') {$orderSQL='extension desc,server_ip desc';} +if ($UidORname > 0) + { + if ($orderby=='userup') {$orderSQL='full_name,status,last_call_time';} + if ($orderby=='userdown') {$orderSQL='full_name desc,status desc,last_call_time desc';} + } +else + { + if ($orderby=='userup') {$orderSQL='vicidial_live_agents.user';} + if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';} + } + +if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} +else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} +if (strlen($usergroup)<1) {$usergroupSQL = '';} +else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} + +$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change) from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL order by $orderSQL;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$talking_to_print = mysql_num_rows($rslt); + if ($talking_to_print > 0) + { + $i=0; + while ($i < $talking_to_print) + { + $row=mysql_fetch_row($rslt); + + $Aextension[$i] = $row[0]; + $Auser[$i] = $row[1]; + $Asessionid[$i] = $row[2]; + $Astatus[$i] = $row[3]; + $Aserver_ip[$i] = $row[4]; + $Acall_time[$i] = $row[5]; + $Acall_finish[$i] = $row[6]; + $Acall_server_ip[$i] = $row[7]; + $Acampaign_id[$i] = $row[8]; + $Auser_group[$i] = $row[9]; + $Afull_name[$i] = $row[10]; + $Acomments[$i] = $row[11]; + $Acalls_today[$i] = $row[12]; + $Acallerid[$i] = $row[13]; + $Alead_id[$i] = $row[14]; + $Astate_change[$i] = $row[15]; + + ### 3-WAY Check ### + if ($Alead_id[$i]!=0) + { + $threewaystmt="select UNIX_TIMESTAMP(last_call_time) from vicidial_live_agents where lead_id='$Alead_id[$i]' and status='INCALL' order by UNIX_TIMESTAMP(last_call_time) desc"; + $threewayrslt=mysql_query($threewaystmt, $link); + if (mysql_num_rows($threewayrslt)>1) + { + $Astatus[$i]="3-WAY"; + $srow=mysql_fetch_row($threewayrslt); + $Acall_mostrecent[$i]=$srow[0]; + } + } + ### END 3-WAY Check ### + + $i++; + } + +$callerids=''; +$pausecode=''; +$stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$calls_to_list = mysql_num_rows($rslt); + if ($calls_to_list > 0) + { + $i=0; + while ($i < $calls_to_list) + { + $row=mysql_fetch_row($rslt); + $callerids .= "$row[0]|"; + $VAClead_ids[$i] = $row[1]; + $VACphones[$i] = $row[2]; + $i++; + } + } + +### Lookup phone logins + $i=0; + while ($i < $talking_to_print) + { + if (eregi("R/",$Aextension[$i])) + { + $protocol = 'EXTERNAL'; + $dialplan = eregi_replace('R/',"",$Aextension[$i]); + $dialplan = eregi_replace("\@.*",'',$dialplan); + $exten = "dialplan_number='$dialplan'"; + } + if (eregi("Local/",$Aextension[$i])) + { + $protocol = 'EXTERNAL'; + $dialplan = eregi_replace('Local/',"",$Aextension[$i]); + $dialplan = eregi_replace("\@.*",'',$dialplan); + $exten = "dialplan_number='$dialplan'"; + } + if (eregi('SIP/',$Aextension[$i])) + { + $protocol = 'SIP'; + $dialplan = eregi_replace('SIP/',"",$Aextension[$i]); + $dialplan = eregi_replace("-.*",'',$dialplan); + $exten = "extension='$dialplan'"; + } + if (eregi('IAX2/',$Aextension[$i])) + { + $protocol = 'IAX2'; + $dialplan = eregi_replace('IAX2/',"",$Aextension[$i]); + $dialplan = eregi_replace("-.*",'',$dialplan); + $exten = "extension='$dialplan'"; + } + if (eregi('Zap/',$Aextension[$i])) + { + $protocol = 'Zap'; + $dialplan = eregi_replace('Zap/',"",$Aextension[$i]); + $exten = "extension='$dialplan'"; + } + if (eregi('DAHDI/',$Aextension[$i])) + { + $protocol = 'Zap'; + $dialplan = eregi_replace('DAHDI/',"",$Aextension[$i]); + $exten = "extension='$dialplan'"; + } + + $stmt="select login from phones where server_ip='$Aserver_ip[$i]' and $exten and protocol='$protocol';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $phones_to_print = mysql_num_rows($rslt); + if ($phones_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $Alogin[$i] = "$row[0]-----$i"; + } + else + { + $Alogin[$i] = "$Aextension[$i]-----$i"; + } + $i++; + } + +### Sort by phone if selected + if ($orderby=='phoneup') + { + sort($Alogin); + } + if ($orderby=='phonedown') + { + rsort($Alogin); + } + +### Run through the loop to display agents + $j=0; + $agentcount=0; + while ($j < $talking_to_print) + { + $n=0; + $custphone=''; + while ($n < $calls_to_list) + { + if ( (ereg("$VAClead_ids[$n]", $Alead_id[$j])) and (strlen($VAClead_ids[$n]) == strlen($Alead_id[$j])) ) + {$custphone = $VACphones[$n];} + $n++; + } + + $phone_split = explode("-----",$Alogin[$j]); + $i = $phone_split[1]; + + if (eregi("READY|PAUSED",$Astatus[$i])) + { + $Acall_time[$i]=$Astate_change[$i]; + + if ($Alead_id[$i] > 0) + { + $Astatus[$i] = 'DISPO'; + $Lstatus = 'DISPO'; + $status = ' DISPO'; + } + } + if ($non_latin < 1) + { + $extension = eregi_replace('Local/',"",$Aextension[$i]); + $extension = sprintf("%-14s", $extension); + while(strlen($extension)>14) {$extension = substr("$extension", 0, -1);} + } + else + { + $extension = eregi_replace('Local/',"",$Aextension[$i]); + $extension = sprintf("%-48s", $extension); + while(mb_strlen($extension, 'utf-8')>14) {$extension = mb_substr("$extension", 0, -1,'utf8');} + } + + $phone = sprintf("%-12s", $phone_split[0]); + $custphone = sprintf("%-11s", $custphone); + $Luser = $Auser[$i]; + $user = sprintf("%-20s", $Auser[$i]); + $Lsessionid = $Asessionid[$i]; + $sessionid = sprintf("%-9s", $Asessionid[$i]); + $Lstatus = $Astatus[$i]; + $status = sprintf("%-6s", $Astatus[$i]); + $Lserver_ip = $Aserver_ip[$i]; + $server_ip = sprintf("%-15s", $Aserver_ip[$i]); + $call_server_ip = sprintf("%-15s", $Acall_server_ip[$i]); + $campaign_id = sprintf("%-10s", $Acampaign_id[$i]); + $comments= $Acomments[$i]; + $calls_today = sprintf("%-5s", $Acalls_today[$i]); + + if (!ereg("N",$agent_pause_codes_active)) + {$pausecode=' ';} + else + {$pausecode='';} + + if (eregi("INCALL",$Lstatus)) + { + $stmtP="select count(*) from parked_channels where channel_group='$Acallerid[$i]';"; + $rsltP=mysql_query($stmtP,$link); + $rowP=mysql_fetch_row($rsltP); + $parked_channel = $rowP[0]; + + if ($parked_channel > 0) + { + $Astatus[$i] = 'PARK'; + $Lstatus = 'PARK'; + $status = ' PARK '; + } + else + { + if (!ereg("$Acallerid[$i]\|",$callerids)) + { + $Acall_time[$i]=$Astate_change[$i]; + + $Astatus[$i] = 'DEAD'; + $Lstatus = 'DEAD'; + $status = ' DEAD '; + } + } + + if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) + {$CM='A';} + else + { + if (eregi("ENTRANTE",$comments)) + {$CM='I';} + else + {$CM='M';} + } + } + else {$CM=' ';} + + if ($UGdisplay > 0) + { + if ($non_latin < 1) + { + $user_group = sprintf("%-12s", $Auser_group[$i]); + while(strlen($user_group)>12) {$user_group = substr("$user_group", 0, -1);} + } + else + { + $user_group = sprintf("%-40s", $Auser_group[$i]); + while(mb_strlen($user_group, 'utf-8')>12) {$user_group = mb_substr("$user_group", 0, -1,'utf8');} + } + } + if ($UidORname > 0) + { + if ($non_latin < 1) + { + $user = sprintf("%-20s", $Afull_name[$i]); + while(strlen($user)>20) {$user = substr("$user", 0, -1);} + } + else + { + $user = sprintf("%-60s", $Afull_name[$i]); + while(mb_strlen($user, 'utf-8')>20) {$user = mb_substr("$user", 0, -1,'utf8');} + } + } + if (!eregi("INCALL|QUEUE|PARK|3-WAY",$Astatus[$i])) + {$call_time_S = ($STARTtime - $Astate_change[$i]);} + else if (eregi("3-WAY",$Astatus[$i])) + {$call_time_S = ($STARTtime - $Acall_mostrecent[$i]);} + else + {$call_time_S = ($STARTtime - $Acall_time[$i]);} + + $call_time_MS = sec_convert($call_time_S,'M'); + $call_time_MS = sprintf("%7s", $call_time_MS); + $G = ''; $EG = ''; + if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') ) + { + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_S >= 60) {$G=''; $EG='';} + if ($call_time_S >= 300) {$G=''; $EG='';} + # if ($call_time_S >= 600) {$G=''; $EG='';} + } + if ($Lstatus=='3-WAY') + { + if ($call_time_S >= 10) {$G=''; $EG='';} + } + if ($Lstatus=='DEAD') + { + if ($call_time_S >= 21600) + {$j++; continue;} + else + { + $agent_dead++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + } + } + if ($Lstatus=='DISPO') + { + if ($call_time_S >= 21600) + {$j++; continue;} + else + { + $agent_paused++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_S >= 60) {$G=''; $EG='';} + if ($call_time_S >= 300) {$G=''; $EG='';} + } + } + if ($Lstatus=='PAUSED') + { + if (!ereg("N",$agent_pause_codes_active)) + { + $stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;"; + $rsltC=mysql_query($stmtC,$link); + $rowC=mysql_fetch_row($rsltC); + $pausecode = sprintf("%-6s", $rowC[0]); + $pausecode = "$pausecode "; + } + else + {$pausecode='';} + + if ($call_time_S >= 21600) + {$j++; continue;} + else + { + $agent_paused++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_S >= 60) {$G=''; $EG='';} + if ($call_time_S >= 300) {$G=''; $EG='';} + } + } +# if ( (strlen($Acall_server_ip[$i])> 4) and ($Acall_server_ip[$i] != "$Aserver_ip[$i]") ) +# {$G=''; $EG='';} + + if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) or (eregi("3-WAY",$status)) or (eregi("PARK",$status))) {$agent_incall++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) + { + $G=''; $EG=''; + if ($call_time_S >= 60) {$G=''; $EG='';} + if ($call_time_S >= 300) {$G=''; $EG='';} + } + + $L=''; + $R=''; + if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} + if ($IAXmonitorLINK>0) {$L=" LISTEN"; $R='';} + if ($SIPmonitorLINK>1) {$R=" | BARGE";} + if ($IAXmonitorLINK>1) {$R=" | BARGE";} + if ( (strlen($monitor_phone)>1) and (preg_match("/MONITOR|BARGE/",$monitor_active) ) ) + {$L=" LISTEN"; $R='';} + if ( (strlen($monitor_phone)>1) and (preg_match("/BARGE/",$monitor_active) ) ) + {$R=" | BARGE";} + + if ($CUSTPHONEdisplay > 0) {$CP = " $G$custphone$EG |";} + else {$CP = "";} + + if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} + else {$UGD = "";} + + if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} + else {$SVD = "";} + + if ($PHONEdisplay > 0) {$phoneD = "$G$phone$EG | ";} + else {$phoneD = " ";} + + $vac_stage=''; + $vac_campaign=''; + $INGRP=''; + if ($CM == 'I') + { + $stmt="select vac.campaign_id,vac.stage,vig.group_name from vicidial_auto_calls vac,vicidial_inbound_groups vig where vac.callerid='$Acallerid[$i]' and vac.campaign_id=vig.group_id LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ingrp_to_print = mysql_num_rows($rslt); + if ($ingrp_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $vac_campaign = sprintf("%-20s", "$row[0] - $row[2]"); + $row[1] = eregi_replace(".*-",'',$row[1]); + $vac_stage = sprintf("%-4s", $row[1]); + } + + $INGRP = " $G$vac_stage$EG | $G$vac_campaign$EG "; + } + + $agentcount++; + + $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + + $j++; + } + + $Aecho .= "$Aline"; + $Aecho .= " $agentcount agents logged in on all servers\n"; + $Aecho .= " Carga do Sistema Average: $load_ave\n\n"; + + # $Aecho .= " - Balanced call\n"; + $Aecho .= " - Agent waiting for call\n"; + $Aecho .= " - Agent waiting for call > 1 minute\n"; + $Aecho .= " - Agent waiting for call > 5 minutes\n"; + $Aecho .= " - Agent on call > 10 seconds\n"; + $Aecho .= " - Agent on call > 1 minute\n"; + $Aecho .= " - Agent on call > 5 minutes\n"; + $Aecho .= " - Agent Paused > 10 seconds\n"; + $Aecho .= " - Agent Paused > 1 minute\n"; + $Aecho .= " - Agent Paused > 5 minutes\n"; + $Aecho .= " - Agent in 3-WAY > 10 seconds\n"; + $Aecho .= " - Agent on a dead call\n"; + + if ($agent_ready > 0) {$B=''; $BG='';} + if ($agent_ready > 4) {$B=''; $BG='';} + if ($agent_ready > 9) {$B=''; $BG='';} + if ($agent_ready > 14) {$B=''; $BG='';} + + + echo "\n
\n"; + + echo "$NFB$agent_total$NFE agents logged in         \n"; + echo "$NFB$agent_incall$NFE agents in calls       \n"; + echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; + echo "$NFB$agent_paused$NFE paused agents       \n"; + echo "$NFB$agent_dead$NFE agentes em chamadas perdidas      \n"; + + echo "
";
+		echo "";
+		echo "$Cecho";
+		echo "$Aecho";
+	}
+	else
+	{
+	echo "AGENTES SEM CHAMADAS\n";
+	echo "
$Cecho";
+	}
+
+?>
+
+
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonVDADallSUMMARY.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonVDADallSUMMARY.php new file mode 100644 index 00000000..652f014e --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonVDADallSUMMARY.php @@ -0,0 +1,457 @@ + LICENSE: AGPLv2 +# +# Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers +# +# STOP=4000, SLOW=40, GO=4 seconds refresh interval +# +# changes: +# 61102-1616 - first build +# 61215-1131 - added answered calls and drop percent taken from answered calls +# 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction +# 80525-1040 - Added IVR status summary display for inbound calls +# 90310-2119 - Added admin header +# 90508-0644 - Changed to PHP long tags +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["RR"])) {$RR=$_GET["RR"];} + elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} + elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +if (!isset($RR)) {$gRRroup=4;} + + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); + +$stmt="select campaign_id from vicidial_campaigns where active='Y';"; +$rslt=mysql_query($stmt, $link); +if (!isset($DB)) {$DB=0;} +if ($DB) {echo "$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + $i++; + } + +if (!isset($RR)) {$RR=4;} + +?> + + + + + +\n"; +echo "Tempo Real All Campanhas Summary\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "Tempo Real All Campanhas Summary           \n"; +echo "STOP | "; +echo "SLOW | "; +echo "GO "; +echo "       \n"; +if ($adastats<2) + { + echo "+ VIEW MORE SETTINGS"; + } +else + { + echo "- VIEW LESS SETTINGS"; + } +echo "       RELATÓRIOS"; +echo "

\n\n"; + +$k=0; +while($k<$groups_to_print) +{ +$NFB = ''; +$NFE = ''; +$F=''; $FG=''; $B=''; $BG=''; + +$group = $groups[$k]; +echo "$group   -   "; +echo "Modify\n"; + + +$stmt = "select count(*) from vicidial_campaigns where campaign_id='$group' and campaign_allow_inbound='Y';"; +$rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +$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 from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; +$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]; + $DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses)); + $DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses)); + +$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$VDhop = $row[0]; + +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,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 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $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]; +$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='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$balanceSHORT = $row[0]; + +echo "
"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +if ($adastats>1) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
DIAL NÍVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
  MAX NÍVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
DIAL TIMEOUT:  $DIALtimeout  TAPER TIME:  $TAPERtime  LOCAL TIME:  $CALLtime  AVAIL ONLY:  $ADAavailonly  
DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     MÉTODO DE DISC.:  $DIALmethod    
HOPPER NÍVEL:  $HOPlev     DROPPED / RESPOSTAED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUS:  $DIALstatuses    
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +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 "
"; + +### Header finish + + + + + +################################################################################ +### START calculating calls/agents +################################################################################ + +################################################################################ +###### OUTBOUND CALLS +################################################################################ +if ($campaign_allow_inbound > 0) + { + $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaigns = "'$closer_campaigns'"; + + $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );"; + } +else + { + if ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} + else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";} + + $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;"; + } +$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++;} + else + { + if (eregi("IVR",$row[0])) + {$in_ivr++;} + if (eregi("CLOSER",$row[0])) + {$nothing=1;} + else + {$out_ring++;} + } + $out_total++; + $i++; + } + + if ($out_live > 0) {$F=''; $FG='';} + if ($out_live > 4) {$F=''; $FG='';} + if ($out_live > 9) {$F=''; $FG='';} + if ($out_live > 14) {$F=''; $FG='';} + + if ($campaign_allow_inbound > 0) + {echo "$NFB$out_total$NFE current active calls      \n";} + else + {echo "$NFB$out_total$NFE calls being placed       \n";} + + echo "$NFB$out_ring$NFE calls ringing         \n"; + echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + echo "$NFB  $in_ivr$NFE calls in IVR       \n"; + } + else + { + echo "SEM CHAMADAS EM ESPERA\n"; + } + + +################################################################################### +###### TIME ON SYSTEM +################################################################################### + +$agent_incall=0; +$agent_ready=0; +$agent_paused=0; +$agent_total=0; + +$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$talking_to_print = mysql_num_rows($rslt); + if ($talking_to_print > 0) + { + $i=0; + $agentcount=0; + while ($i < $talking_to_print) + { + $row=mysql_fetch_row($rslt); + if (eregi("READY|PAUSED",$row[3])) + { + $row[5]=$row[6]; + } + $Lstatus = $row[3]; + $status = sprintf("%-6s", $row[3]); + if (!eregi("INCALL|QUEUE",$row[3])) + {$call_time_S = ($STARTtime - $row[6]);} + else + {$call_time_S = ($STARTtime - $row[5]);} + + $call_time_M = ($call_time_S / 60); + $call_time_M = round($call_time_M, 2); + $call_time_M_int = intval("$call_time_M"); + $call_time_SEC = ($call_time_M - $call_time_M_int); + $call_time_SEC = ($call_time_SEC * 60); + $call_time_SEC = round($call_time_SEC, 0); + if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} + $call_time_MS = "$call_time_M_int:$call_time_SEC"; + $call_time_MS = sprintf("%7s", $call_time_MS); + $G = ''; $EG = ''; + if (eregi("PAUSED",$row[3])) + { + if ($call_time_M_int >= 30) + {$i++; continue;} + else + { + $agent_paused++; $agent_total++; + } + } + + if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} + $agentcount++; + + + $i++; + } + + if ($agent_ready > 0) {$B=''; $BG='';} + if ($agent_ready > 4) {$B=''; $BG='';} + if ($agent_ready > 9) {$B=''; $BG='';} + if ($agent_ready > 14) {$B=''; $BG='';} + + echo "\n
\n"; + + echo "$NFB$agent_total$NFE agents logged in         \n"; + echo "$NFB$agent_incall$NFE agents in calls       \n"; + echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; + echo "$NFB$agent_paused$NFE paused agents       \n"; + + echo "
";
+		echo "";
+	}
+	else
+	{
+	echo " NO AGENTS ON CALLS
\n"; + } + +################################################################################ +### END calculating calls/agents +################################################################################ + + + + + +echo "
"; + +echo "\n\n"; +$k++; +} + +?> + +
+ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonpark.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonpark.php new file mode 100644 index 00000000..d32cf6b6 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/AST_timeonpark.php @@ -0,0 +1,220 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 60620-1042 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# 90508-0644 - Changed to PHP long tags +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} + elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +$timeONEhoursAGO = ($STARTtime - 3600); +$epochHALFhoursAGO = ($STARTtime - 1860); +$timeONEhoursAGO = date("Y-m-d H:i:s",$timeONEhoursAGO); +$timeHALFhoursAGO = date("Y-m-d H:i:s",$epochHALFhoursAGO); + +$reset_counter++; + +if ($reset_counter > 7) + { + $reset_counter=0; + + $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + + if ($DB) + { + $stmt="delete from park_log where status='TALKING' and grab_time < '$timeONEhoursAGO' and (hangup_time is null or hangup_time='');"; + $rslt=mysql_query($stmt, $link); + echo "$stmt\n"; + + $stmt="delete from park_log where status='PARKED' and parked_time < '$timeHALFhoursAGO' and (hangup_time is null or hangup_time='');"; + $rslt=mysql_query($stmt, $link); + echo "$stmt\n"; + + } + } + +?> + + + + + +\n"; +echo"\n"; +echo "VICIDIAL: Time On Park\n"; +echo "
\n\n";
+
+echo "VICIDIAL: Time On Park         $NOW_TIME    RELATÓRIOS\n\n";
+echo "+------------+-----------------+---------------------+---------+\n";
+echo "| CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
+echo "+------------+-----------------+---------------------+---------+\n";
+
+#$link=mysql_connect("localhost", "cron", "1234");
+# $linkX=mysql_connect("localhost", "cron", "1234");
+#mysql_select_db("asterisk");
+
+$stmt="select extension,user,channel,channel_group,parked_time,UNIX_TIMESTAMP(parked_time) from park_log where status ='PARKED' and server_ip='" . mysql_real_escape_string($server_ip) . "' order by uniqueid;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$parked_to_print = mysql_num_rows($rslt);
+	if ($parked_to_print > 0)
+	{
+	$i=0;
+	while ($i < $parked_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+
+		$channel =			sprintf("%-10s", $row[2]);
+		$number_dialed =	sprintf("%-15s", $row[3]);
+		$start_time =		sprintf("%-19s", $row[4]);
+		$call_time_S = ($STARTtime - $row[5]);
+
+		$call_time_M = ($call_time_S / 60);
+		$call_time_M = round($call_time_M, 2);
+		$call_time_M_int = intval("$call_time_M");
+		$call_time_SEC = ($call_time_M - $call_time_M_int);
+		$call_time_SEC = ($call_time_SEC * 60);
+		$call_time_SEC = round($call_time_SEC, 0);
+		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
+		$call_time_MS = "$call_time_M_int:$call_time_SEC";
+		$call_time_MS =		sprintf("%7s", $call_time_MS);
+		$G = '';		$EG = '';
+		if ($call_time_M_int >= 1) {$G=''; $EG='';}
+		if ($call_time_M_int >= 6) {$G=''; $EG='';}
+
+		echo "| $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
+
+		$i++;
+		}
+
+		echo "+------------+-----------------+---------------------+---------+\n";
+		echo "  $i callers waiting on server $server_ip\n\n";
+
+		echo "             - 1 minute or more on hold\n";
+		echo "             - Over 5 minutes on hold\n";
+
+		}
+	else
+	{
+	echo "****************************************************************\n";
+	echo "****************************************************************\n";
+	echo "********************SEM CHAMADAS EM ESPERA*********************\n";
+	echo "****************************************************************\n";
+	echo "****************************************************************\n";
+	}
+
+###################################################################################
+###### TIME ON INBOUND CALLS
+###################################################################################
+echo "\n\n";
+echo "----------------------------------------------------------------------------------------";
+echo "\n\n";
+echo "VICIDIAL: Agentes Time On Inbound Calls                             $NOW_TIME\n\n";
+echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
+echo "| STATION    | USER   | CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
+echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
+
+
+$stmt="select extension,user,channel,channel_group,grab_time,UNIX_TIMESTAMP(grab_time) from park_log where status ='TALKING' and server_ip='" . mysql_real_escape_string($server_ip) . "' order by uniqueid;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$talking_to_print = mysql_num_rows($rslt);
+	if ($talking_to_print > 0)
+	{
+	$i=0;
+	while ($i < $talking_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+
+		$extension =		sprintf("%-10s", $row[0]);
+		$user =				sprintf("%-6s", $row[1]);
+		$channel =			sprintf("%-10s", $row[2]);
+		$number_dialed =	sprintf("%-15s", $row[3]);
+		$start_time =		sprintf("%-19s", $row[4]);
+		$call_time_S = ($STARTtime - $row[5]);
+
+		$call_time_M = ($call_time_S / 60);
+		$call_time_M = round($call_time_M, 2);
+		$call_time_M_int = intval("$call_time_M");
+		$call_time_SEC = ($call_time_M - $call_time_M_int);
+		$call_time_SEC = ($call_time_SEC * 60);
+		$call_time_SEC = round($call_time_SEC, 0);
+		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
+		$call_time_MS = "$call_time_M_int:$call_time_SEC";
+		$call_time_MS =		sprintf("%7s", $call_time_MS);
+		$G = '';		$EG = '';
+		if ($call_time_M_int >= 12) {$G=''; $EG='';}
+		if ($call_time_M_int >= 31) {$G=''; $EG='';}
+
+		echo "| $G$extension$EG | $G$user$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
+
+		$i++;
+		}
+
+		echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
+		echo "  $i agents on calls on server $server_ip\n\n";
+
+		echo "             - 12 minutes or more on call\n";
+		echo "             - Over 30 minutes on call\n";
+
+	}
+	else
+	{
+	echo "**************************************************************************************\n";
+	echo "**************************************************************************************\n";
+	echo "*********************************AGENTES SEM CHAMADAS*********************************\n";
+	echo "**************************************************************************************\n";
+	echo "**************************************************************************************\n";
+	}
+
+
+?>
+
+ + \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/admin.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/admin.php new file mode 100644 index 00000000..209385a8 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/admin.php @@ -0,0 +1,25097 @@ + LICENSE: AGPLv2 +# + +require("dbconnect.php"); + +###################################################################################################### +###################################################################################################### +####### static variable settings for display options +###################################################################################################### +###################################################################################################### + +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold=''; +$header_nonselected_bold=''; +$users_color = '#FFFF99'; +$campaigns_color = '#FFCC99'; +$lists_color = '#FFCCCC'; +$ingroups_color = '#CC99FF'; +$remoteagent_color ='#CCFFCC'; +$usergroups_color = '#CCFFFF'; +$scripts_color = '#99FFCC'; +$filters_color = '#CCCCCC'; +$admin_color = '#FF99FF'; +$reports_color = '#99FF33'; + $times_color = '#FF33FF'; + $shifts_color = '#FF33FF'; + $phones_color = '#FF33FF'; + $conference_color = '#FF33FF'; + $server_color = '#FF33FF'; + $templates_color = '#FF33FF'; + $carriers_color = '#FF33FF'; + $settings_color = '#FF33FF'; + $status_color = '#FF33FF'; + $moh_color = '#FF33FF'; + $vm_color = '#FF33FF'; + $tts_color = '#FF33FF'; +$subcamp_color = '#FF9933'; +$users_font = 'BLACK'; +$campaigns_font = 'BLACK'; +$lists_font = 'BLACK'; +$ingroups_font = 'BLACK'; +$remoteagent_font = 'BLACK'; +$usergroups_font = 'BLACK'; +$scripts_font = 'BLACK'; +$filters_font = 'BLACK'; +$admin_font = 'BLACK'; +$reports_font = 'BLACK'; + $times_font = 'BLACK'; + $phones_font = 'BLACK'; + $conference_font = 'BLACK'; + $server_font = 'BLACK'; + $settings_font = 'BLACK'; + $status_font = 'BLACK'; + $moh_font = 'BLACK'; + $vm_font = 'BLACK'; + $tts_font = 'BLACK'; +$subcamp_font = 'BLACK'; + +### comment this section out for colorful section headings +$users_color = '#E6E6E6'; +$campaigns_color = '#E6E6E6'; +$lists_color = '#E6E6E6'; +$ingroups_color = '#E6E6E6'; +$remoteagent_color ='#E6E6E6'; +$usergroups_color = '#E6E6E6'; +$scripts_color = '#E6E6E6'; +$filters_color = '#E6E6E6'; +$admin_color = '#E6E6E6'; +$reports_color = '#E6E6E6'; + $times_color = '#C6C6C6'; + $shifts_color = '#C6C6C6'; + $phones_color = '#C6C6C6'; + $conference_color = '#C6C6C6'; + $server_color = '#C6C6C6'; + $templates_color = '#C6C6C6'; + $carriers_color = '#C6C6C6'; + $settings_color = '#C6C6C6'; + $status_color = '#C6C6C6'; + $moh_color = '#C6C6C6'; + $vm_color = '#C6C6C6'; + $tts_color = '#C6C6C6'; +$subcamp_color = '#C6C6C6'; +### + + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + +###################################################################################################### +###################################################################################################### +####### Form variable declaration +###################################################################################################### +###################################################################################################### + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["active"])) {$active=$_GET["active"];} + elseif (isset($_POST["active"])) {$active=$_POST["active"];} +if (isset($_GET["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_GET["adaptive_dl_diff_target"];} + elseif (isset($_POST["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_POST["adaptive_dl_diff_target"];} +if (isset($_GET["adaptive_dropped_percentage"])) {$adaptive_dropped_percentage=$_GET["adaptive_dropped_percentage"];} + elseif (isset($_POST["adaptive_dropped_percentage"])){$adaptive_dropped_percentage=$_POST["adaptive_dropped_percentage"];} +if (isset($_GET["adaptive_intensity"])) {$adaptive_intensity=$_GET["adaptive_intensity"];} + elseif (isset($_POST["adaptive_intensity"])) {$adaptive_intensity=$_POST["adaptive_intensity"];} +if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$_GET["adaptive_latest_server_time"];} + elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} +if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} + elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} +if (isset($_GET["SUB"])) {$SUB=$_GET["SUB"];} + elseif (isset($_POST["SUB"])) {$SUB=$_POST["SUB"];} +if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} + elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} +if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} + elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} +if (isset($_GET["admin_hijack_enabled"])) {$admin_hijack_enabled=$_GET["admin_hijack_enabled"];} + elseif (isset($_POST["admin_hijack_enabled"])) {$admin_hijack_enabled=$_POST["admin_hijack_enabled"];} +if (isset($_GET["admin_monitor_enabled"])) {$admin_monitor_enabled=$_GET["admin_monitor_enabled"];} + elseif (isset($_POST["admin_monitor_enabled"])) {$admin_monitor_enabled=$_POST["admin_monitor_enabled"];} +if (isset($_GET["AFLogging_enabled"])) {$AFLogging_enabled=$_GET["AFLogging_enabled"];} + elseif (isset($_POST["AFLogging_enabled"])) {$AFLogging_enabled=$_POST["AFLogging_enabled"];} +if (isset($_GET["agent_choose_ingroups"])) {$agent_choose_ingroups=$_GET["agent_choose_ingroups"];} + elseif (isset($_POST["agent_choose_ingroups"])) {$agent_choose_ingroups=$_POST["agent_choose_ingroups"];} +if (isset($_GET["agentcall_manual"])) {$agentcall_manual=$_GET["agentcall_manual"];} + elseif (isset($_POST["agentcall_manual"])) {$agentcall_manual=$_POST["agentcall_manual"];} +if (isset($_GET["agentonly_callbacks"])) {$agentonly_callbacks=$_GET["agentonly_callbacks"];} + elseif (isset($_POST["agentonly_callbacks"])) {$agentonly_callbacks=$_POST["agentonly_callbacks"];} +if (isset($_GET["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_GET["AGI_call_logging_enabled"];} + elseif (isset($_POST["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_POST["AGI_call_logging_enabled"];} +if (isset($_GET["agi_output"])) {$agi_output=$_GET["agi_output"];} + elseif (isset($_POST["agi_output"])) {$agi_output=$_POST["agi_output"];} +if (isset($_GET["allcalls_delay"])) {$allcalls_delay=$_GET["allcalls_delay"];} + elseif (isset($_POST["allcalls_delay"])) {$allcalls_delay=$_POST["allcalls_delay"];} +if (isset($_GET["allow_closers"])) {$allow_closers=$_GET["allow_closers"];} + elseif (isset($_POST["allow_closers"])) {$allow_closers=$_POST["allow_closers"];} +if (isset($_GET["alt_number_dialing"])) {$alt_number_dialing=$_GET["alt_number_dialing"];} + elseif (isset($_POST["alt_number_dialing"])) {$alt_number_dialing=$_POST["alt_number_dialing"];} +if (isset($_GET["alter_agent_interface_options"])) {$alter_agent_interface_options=$_GET["alter_agent_interface_options"];} + elseif (isset($_POST["alter_agent_interface_options"])) {$alter_agent_interface_options=$_POST["alter_agent_interface_options"];} +if (isset($_GET["am_message_exten"])) {$am_message_exten=$_GET["am_message_exten"];} + elseif (isset($_POST["am_message_exten"])) {$am_message_exten=$_POST["am_message_exten"];} +if (isset($_GET["amd_send_to_vmx"])) {$amd_send_to_vmx=$_GET["amd_send_to_vmx"];} + elseif (isset($_POST["amd_send_to_vmx"])) {$amd_send_to_vmx=$_POST["amd_send_to_vmx"];} +if (isset($_GET["answer_transfer_agent"])) {$answer_transfer_agent=$_GET["answer_transfer_agent"];} + elseif (isset($_POST["answer_transfer_agent"])) {$answer_transfer_agent=$_POST["answer_transfer_agent"];} +if (isset($_GET["ast_admin_access"])) {$ast_admin_access=$_GET["ast_admin_access"];} + elseif (isset($_POST["ast_admin_access"])) {$ast_admin_access=$_POST["ast_admin_access"];} +if (isset($_GET["ast_delete_phones"])) {$ast_delete_phones=$_GET["ast_delete_phones"];} + elseif (isset($_POST["ast_delete_phones"])) {$ast_delete_phones=$_POST["ast_delete_phones"];} +if (isset($_GET["asterisk_version"])) {$asterisk_version=$_GET["asterisk_version"];} + elseif (isset($_POST["asterisk_version"])) {$asterisk_version=$_POST["asterisk_version"];} +if (isset($_GET["ASTmgrSECRET"])) {$ASTmgrSECRET=$_GET["ASTmgrSECRET"];} + elseif (isset($_POST["ASTmgrSECRET"])) {$ASTmgrSECRET=$_POST["ASTmgrSECRET"];} +if (isset($_GET["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_GET["ASTmgrUSERNAME"];} + elseif (isset($_POST["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_POST["ASTmgrUSERNAME"];} +if (isset($_GET["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_GET["ASTmgrUSERNAMElisten"];} + elseif (isset($_POST["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_POST["ASTmgrUSERNAMElisten"];} +if (isset($_GET["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_GET["ASTmgrUSERNAMEsend"];} + elseif (isset($_POST["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_POST["ASTmgrUSERNAMEsend"];} +if (isset($_GET["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_GET["ASTmgrUSERNAMEupdate"];} + elseif (isset($_POST["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_POST["ASTmgrUSERNAMEupdate"];} +if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} + elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} +if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} + elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} +if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} + elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} +if (isset($_GET["auto_dial_next_number"])) {$auto_dial_next_number=$_GET["auto_dial_next_number"];} + elseif (isset($_POST["auto_dial_next_number"])) {$auto_dial_next_number=$_POST["auto_dial_next_number"];} +if (isset($_GET["available_only_ratio_tally"])) {$available_only_ratio_tally=$_GET["available_only_ratio_tally"];} + elseif (isset($_POST["available_only_ratio_tally"])){$available_only_ratio_tally=$_POST["available_only_ratio_tally"];} +if (isset($_GET["call_out_number_group"])) {$call_out_number_group=$_GET["call_out_number_group"];} + elseif (isset($_POST["call_out_number_group"])) {$call_out_number_group=$_POST["call_out_number_group"];} +if (isset($_GET["call_parking_enabled"])) {$call_parking_enabled=$_GET["call_parking_enabled"];} + elseif (isset($_POST["call_parking_enabled"])) {$call_parking_enabled=$_POST["call_parking_enabled"];} +if (isset($_GET["call_time_comments"])) {$call_time_comments=$_GET["call_time_comments"];} + elseif (isset($_POST["call_time_comments"])) {$call_time_comments=$_POST["call_time_comments"];} +if (isset($_GET["call_time_id"])) {$call_time_id=$_GET["call_time_id"];} + elseif (isset($_POST["call_time_id"])) {$call_time_id=$_POST["call_time_id"];} +if (isset($_GET["call_time_name"])) {$call_time_name=$_GET["call_time_name"];} + elseif (isset($_POST["call_time_name"])) {$call_time_name=$_POST["call_time_name"];} +if (isset($_GET["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_GET["CallerID_popup_enabled"];} + elseif (isset($_POST["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_POST["CallerID_popup_enabled"];} +if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} + elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} +if (isset($_GET["campaign_detail"])) {$campaign_detail=$_GET["campaign_detail"];} + elseif (isset($_POST["campaign_detail"])) {$campaign_detail=$_POST["campaign_detail"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["campaign_name"])) {$campaign_name=$_GET["campaign_name"];} + elseif (isset($_POST["campaign_name"])) {$campaign_name=$_POST["campaign_name"];} +if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec_exten"];} + elseif (isset($_POST["campaign_rec_exten"])) {$campaign_rec_exten=$_POST["campaign_rec_exten"];} +if (isset($_GET["campaign_rec_filename"])) {$campaign_rec_filename=$_GET["campaign_rec_filename"];} + elseif (isset($_POST["campaign_rec_filename"])) {$campaign_rec_filename=$_POST["campaign_rec_filename"];} +if (isset($_GET["ingroup_rec_filename"])) {$ingroup_rec_filename=$_GET["ingroup_rec_filename"];} + elseif (isset($_POST["ingroup_rec_filename"])) {$ingroup_rec_filename=$_POST["ingroup_rec_filename"];} +if (isset($_GET["campaign_recording"])) {$campaign_recording=$_GET["campaign_recording"];} + elseif (isset($_POST["campaign_recording"])) {$campaign_recording=$_POST["campaign_recording"];} +if (isset($_GET["campaign_vdad_exten"])) {$campaign_vdad_exten=$_GET["campaign_vdad_exten"];} + elseif (isset($_POST["campaign_vdad_exten"])) {$campaign_vdad_exten=$_POST["campaign_vdad_exten"];} +if (isset($_GET["change_agent_campaign"])) {$change_agent_campaign=$_GET["change_agent_campaign"];} + elseif (isset($_POST["change_agent_campaign"])) {$change_agent_campaign=$_POST["change_agent_campaign"];} +if (isset($_GET["client_browser"])) {$client_browser=$_GET["client_browser"];} + elseif (isset($_POST["client_browser"])) {$client_browser=$_POST["client_browser"];} +if (isset($_GET["closer_default_blended"])) {$closer_default_blended=$_GET["closer_default_blended"];} + elseif (isset($_POST["closer_default_blended"])) {$closer_default_blended=$_POST["closer_default_blended"];} +if (isset($_GET["company"])) {$company=$_GET["company"];} + elseif (isset($_POST["company"])) {$company=$_POST["company"];} +if (isset($_GET["computer_ip"])) {$computer_ip=$_GET["computer_ip"];} + elseif (isset($_POST["computer_ip"])) {$computer_ip=$_POST["computer_ip"];} +if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} + elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} +if (isset($_GET["conf_on_extension"])) {$conf_on_extension=$_GET["conf_on_extension"];} + elseif (isset($_POST["conf_on_extension"])) {$conf_on_extension=$_POST["conf_on_extension"];} +if (isset($_GET["conferencing_enabled"])) {$conferencing_enabled=$_GET["conferencing_enabled"];} + elseif (isset($_POST["conferencing_enabled"])) {$conferencing_enabled=$_POST["conferencing_enabled"];} +if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} + elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} +if (isset($_GET["ct_default_start"])) {$ct_default_start=$_GET["ct_default_start"];} + elseif (isset($_POST["ct_default_start"])) {$ct_default_start=$_POST["ct_default_start"];} +if (isset($_GET["ct_default_stop"])) {$ct_default_stop=$_GET["ct_default_stop"];} + elseif (isset($_POST["ct_default_stop"])) {$ct_default_stop=$_POST["ct_default_stop"];} +if (isset($_GET["ct_friday_start"])) {$ct_friday_start=$_GET["ct_friday_start"];} + elseif (isset($_POST["ct_friday_start"])) {$ct_friday_start=$_POST["ct_friday_start"];} +if (isset($_GET["ct_friday_stop"])) {$ct_friday_stop=$_GET["ct_friday_stop"];} + elseif (isset($_POST["ct_friday_stop"])) {$ct_friday_stop=$_POST["ct_friday_stop"];} +if (isset($_GET["ct_monday_start"])) {$ct_monday_start=$_GET["ct_monday_start"];} + elseif (isset($_POST["ct_monday_start"])) {$ct_monday_start=$_POST["ct_monday_start"];} +if (isset($_GET["ct_monday_stop"])) {$ct_monday_stop=$_GET["ct_monday_stop"];} + elseif (isset($_POST["ct_monday_stop"])) {$ct_monday_stop=$_POST["ct_monday_stop"];} +if (isset($_GET["ct_saturday_start"])) {$ct_saturday_start=$_GET["ct_saturday_start"];} + elseif (isset($_POST["ct_saturday_start"])) {$ct_saturday_start=$_POST["ct_saturday_start"];} +if (isset($_GET["ct_saturday_stop"])) {$ct_saturday_stop=$_GET["ct_saturday_stop"];} + elseif (isset($_POST["ct_saturday_stop"])) {$ct_saturday_stop=$_POST["ct_saturday_stop"];} +if (isset($_GET["ct_sunday_start"])) {$ct_sunday_start=$_GET["ct_sunday_start"];} + elseif (isset($_POST["ct_sunday_start"])) {$ct_sunday_start=$_POST["ct_sunday_start"];} +if (isset($_GET["ct_sunday_stop"])) {$ct_sunday_stop=$_GET["ct_sunday_stop"];} + elseif (isset($_POST["ct_sunday_stop"])) {$ct_sunday_stop=$_POST["ct_sunday_stop"];} +if (isset($_GET["ct_thursday_start"])) {$ct_thursday_start=$_GET["ct_thursday_start"];} + elseif (isset($_POST["ct_thursday_start"])) {$ct_thursday_start=$_POST["ct_thursday_start"];} +if (isset($_GET["ct_thursday_stop"])) {$ct_thursday_stop=$_GET["ct_thursday_stop"];} + elseif (isset($_POST["ct_thursday_stop"])) {$ct_thursday_stop=$_POST["ct_thursday_stop"];} +if (isset($_GET["ct_tuesday_start"])) {$ct_tuesday_start=$_GET["ct_tuesday_start"];} + elseif (isset($_POST["ct_tuesday_start"])) {$ct_tuesday_start=$_POST["ct_tuesday_start"];} +if (isset($_GET["ct_tuesday_stop"])) {$ct_tuesday_stop=$_GET["ct_tuesday_stop"];} + elseif (isset($_POST["ct_tuesday_stop"])) {$ct_tuesday_stop=$_POST["ct_tuesday_stop"];} +if (isset($_GET["ct_wednesday_start"])) {$ct_wednesday_start=$_GET["ct_wednesday_start"];} + elseif (isset($_POST["ct_wednesday_start"])) {$ct_wednesday_start=$_POST["ct_wednesday_start"];} +if (isset($_GET["ct_wednesday_stop"])) {$ct_wednesday_stop=$_GET["ct_wednesday_stop"];} + elseif (isset($_POST["ct_wednesday_stop"])) {$ct_wednesday_stop=$_POST["ct_wednesday_stop"];} +if (isset($_GET["DBX_database"])) {$DBX_database=$_GET["DBX_database"];} + elseif (isset($_POST["DBX_database"])) {$DBX_database=$_POST["DBX_database"];} +if (isset($_GET["DBX_pass"])) {$DBX_pass=$_GET["DBX_pass"];} + elseif (isset($_POST["DBX_pass"])) {$DBX_pass=$_POST["DBX_pass"];} +if (isset($_GET["DBX_port"])) {$DBX_port=$_GET["DBX_port"];} + elseif (isset($_POST["DBX_port"])) {$DBX_port=$_POST["DBX_port"];} +if (isset($_GET["DBX_server"])) {$DBX_server=$_GET["DBX_server"];} + elseif (isset($_POST["DBX_server"])) {$DBX_server=$_POST["DBX_server"];} +if (isset($_GET["DBX_user"])) {$DBX_user=$_GET["DBX_user"];} + elseif (isset($_POST["DBX_user"])) {$DBX_user=$_POST["DBX_user"];} +if (isset($_GET["DBY_database"])) {$DBY_database=$_GET["DBY_database"];} + elseif (isset($_POST["DBY_database"])) {$DBY_database=$_POST["DBY_database"];} +if (isset($_GET["DBY_pass"])) {$DBY_pass=$_GET["DBY_pass"];} + elseif (isset($_POST["DBY_pass"])) {$DBY_pass=$_POST["DBY_pass"];} +if (isset($_GET["DBY_port"])) {$DBY_port=$_GET["DBY_port"];} + elseif (isset($_POST["DBY_port"])) {$DBY_port=$_POST["DBY_port"];} +if (isset($_GET["DBY_server"])) {$DBY_server=$_GET["DBY_server"];} + elseif (isset($_POST["DBY_server"])) {$DBY_server=$_POST["DBY_server"];} +if (isset($_GET["DBY_user"])) {$DBY_user=$_GET["DBY_user"];} + elseif (isset($_POST["DBY_user"])) {$DBY_user=$_POST["DBY_user"];} +if (isset($_GET["delete_call_times"])) {$delete_call_times=$_GET["delete_call_times"];} + elseif (isset($_POST["delete_call_times"])) {$delete_call_times=$_POST["delete_call_times"];} +if (isset($_GET["delete_campaigns"])) {$delete_campaigns=$_GET["delete_campaigns"];} + elseif (isset($_POST["delete_campaigns"])) {$delete_campaigns=$_POST["delete_campaigns"];} +if (isset($_GET["delete_filters"])) {$delete_filters=$_GET["delete_filters"];} + elseif (isset($_POST["delete_filters"])) {$delete_filters=$_POST["delete_filters"];} +if (isset($_GET["delete_ingroups"])) {$delete_ingroups=$_GET["delete_ingroups"];} + elseif (isset($_POST["delete_ingroups"])) {$delete_ingroups=$_POST["delete_ingroups"];} +if (isset($_GET["delete_lists"])) {$delete_lists=$_GET["delete_lists"];} + elseif (isset($_POST["delete_lists"])) {$delete_lists=$_POST["delete_lists"];} +if (isset($_GET["delete_remote_agents"])) {$delete_remote_agents=$_GET["delete_remote_agents"];} + elseif (isset($_POST["delete_remote_agents"])) {$delete_remote_agents=$_POST["delete_remote_agents"];} +if (isset($_GET["delete_scripts"])) {$delete_scripts=$_GET["delete_scripts"];} + elseif (isset($_POST["delete_scripts"])) {$delete_scripts=$_POST["delete_scripts"];} +if (isset($_GET["delete_user_groups"])) {$delete_user_groups=$_GET["delete_user_groups"];} + elseif (isset($_POST["delete_user_groups"])) {$delete_user_groups=$_POST["delete_user_groups"];} +if (isset($_GET["delete_users"])) {$delete_users=$_GET["delete_users"];} + elseif (isset($_POST["delete_users"])) {$delete_users=$_POST["delete_users"];} +if (isset($_GET["dial_method"])) {$dial_method=$_GET["dial_method"];} + elseif (isset($_POST["dial_method"])) {$dial_method=$_POST["dial_method"];} +if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} + elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} +if (isset($_GET["dial_status_a"])) {$dial_status_a=$_GET["dial_status_a"];} + elseif (isset($_POST["dial_status_a"])) {$dial_status_a=$_POST["dial_status_a"];} +if (isset($_GET["dial_status_b"])) {$dial_status_b=$_GET["dial_status_b"];} + elseif (isset($_POST["dial_status_b"])) {$dial_status_b=$_POST["dial_status_b"];} +if (isset($_GET["dial_status_c"])) {$dial_status_c=$_GET["dial_status_c"];} + elseif (isset($_POST["dial_status_c"])) {$dial_status_c=$_POST["dial_status_c"];} +if (isset($_GET["dial_status_d"])) {$dial_status_d=$_GET["dial_status_d"];} + elseif (isset($_POST["dial_status_d"])) {$dial_status_d=$_POST["dial_status_d"];} +if (isset($_GET["dial_status_e"])) {$dial_status_e=$_GET["dial_status_e"];} + elseif (isset($_POST["dial_status_e"])) {$dial_status_e=$_POST["dial_status_e"];} +if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} + elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} +if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} + elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} +if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seconds"];} + elseif (isset($_POST["drop_call_seconds"])) {$drop_call_seconds=$_POST["drop_call_seconds"];} +if (isset($_GET["drop_exten"])) {$drop_exten=$_GET["drop_exten"];} + elseif (isset($_POST["drop_exten"])) {$drop_exten=$_POST["drop_exten"];} +if (isset($_GET["drop_action"])) {$drop_action=$_GET["drop_action"];} + elseif (isset($_POST["drop_action"])) {$drop_action=$_POST["drop_action"];} +if (isset($_GET["dtmf_send_extension"])) {$dtmf_send_extension=$_GET["dtmf_send_extension"];} + elseif (isset($_POST["dtmf_send_extension"])) {$dtmf_send_extension=$_POST["dtmf_send_extension"];} +if (isset($_GET["enable_fast_refresh"])) {$enable_fast_refresh=$_GET["enable_fast_refresh"];} + elseif (isset($_POST["enable_fast_refresh"])) {$enable_fast_refresh=$_POST["enable_fast_refresh"];} +if (isset($_GET["enable_persistant_mysql"])) {$enable_persistant_mysql=$_GET["enable_persistant_mysql"];} + elseif (isset($_POST["enable_persistant_mysql"])) {$enable_persistant_mysql=$_POST["enable_persistant_mysql"];} +if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} + elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["fast_refresh_rate"])) {$fast_refresh_rate=$_GET["fast_refresh_rate"];} + elseif (isset($_POST["fast_refresh_rate"])) {$fast_refresh_rate=$_POST["fast_refresh_rate"];} +if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} + elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} +if (isset($_GET["fronter_display"])) {$fronter_display=$_GET["fronter_display"];} + elseif (isset($_POST["fronter_display"])) {$fronter_display=$_POST["fronter_display"];} +if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} + elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} +if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} + elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} +if (isset($_GET["get_call_launch"])) {$get_call_launch=$_GET["get_call_launch"];} + elseif (isset($_POST["get_call_launch"])) {$get_call_launch=$_POST["get_call_launch"];} +if (isset($_GET["group_color"])) {$group_color=$_GET["group_color"];} + elseif (isset($_POST["group_color"])) {$group_color=$_POST["group_color"];} +if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} + elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} +if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} + elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} +if (isset($_GET["groups"])) {$groups=$_GET["groups"];} + elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} +if (isset($_GET["XFERgroups"])) {$XFERgroups=$_GET["XFERgroups"];} + elseif (isset($_POST["XFERgroups"])) {$XFERgroups=$_POST["XFERgroups"];} +if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} + elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} +if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} + elseif (isset($_POST["hopper_level"])) {$hopper_level=$_POST["hopper_level"];} +if (isset($_GET["hotkey"])) {$hotkey=$_GET["hotkey"];} + elseif (isset($_POST["hotkey"])) {$hotkey=$_POST["hotkey"];} +if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} + elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} +if (isset($_GET["install_directory"])) {$install_directory=$_GET["install_directory"];} + elseif (isset($_POST["install_directory"])) {$install_directory=$_POST["install_directory"];} +if (isset($_GET["lead_filter_comments"])) {$lead_filter_comments=$_GET["lead_filter_comments"];} + elseif (isset($_POST["lead_filter_comments"])) {$lead_filter_comments=$_POST["lead_filter_comments"];} +if (isset($_GET["lead_filter_id"])) {$lead_filter_id=$_GET["lead_filter_id"];} + elseif (isset($_POST["lead_filter_id"])) {$lead_filter_id=$_POST["lead_filter_id"];} +if (isset($_GET["lead_filter_name"])) {$lead_filter_name=$_GET["lead_filter_name"];} + elseif (isset($_POST["lead_filter_name"])) {$lead_filter_name=$_POST["lead_filter_name"];} +if (isset($_GET["lead_filter_sql"])) {$lead_filter_sql=$_GET["lead_filter_sql"];} + elseif (isset($_POST["lead_filter_sql"])) {$lead_filter_sql=$_POST["lead_filter_sql"];} +if (isset($_GET["lead_order"])) {$lead_order=$_GET["lead_order"];} + elseif (isset($_POST["lead_order"])) {$lead_order=$_POST["lead_order"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} + elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} +if (isset($_GET["load_leads"])) {$load_leads=$_GET["load_leads"];} + elseif (isset($_POST["load_leads"])) {$load_leads=$_POST["load_leads"];} +if (isset($_GET["local_call_time"])) {$local_call_time=$_GET["local_call_time"];} + elseif (isset($_POST["local_call_time"])) {$local_call_time=$_POST["local_call_time"];} +if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} + elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} +if (isset($_GET["local_web_callerID_URL"])) {$local_web_callerID_URL=$_GET["local_web_callerID_URL"];} + elseif (isset($_POST["local_web_callerID_URL"])) {$local_web_callerID_URL=$_POST["local_web_callerID_URL"];} +if (isset($_GET["login"])) {$login=$_GET["login"];} + elseif (isset($_POST["login"])) {$login=$_POST["login"];} +if (isset($_GET["login_campaign"])) {$login_campaign=$_GET["login_campaign"];} + elseif (isset($_POST["login_campaign"])) {$login_campaign=$_POST["login_campaign"];} +if (isset($_GET["login_pass"])) {$login_pass=$_GET["login_pass"];} + elseif (isset($_POST["login_pass"])) {$login_pass=$_POST["login_pass"];} +if (isset($_GET["login_user"])) {$login_user=$_GET["login_user"];} + elseif (isset($_POST["login_user"])) {$login_user=$_POST["login_user"];} +if (isset($_GET["max_vicidial_trunks"])) {$max_vicidial_trunks=$_GET["max_vicidial_trunks"];} + elseif (isset($_POST["max_vicidial_trunks"])) {$max_vicidial_trunks=$_POST["max_vicidial_trunks"];} +if (isset($_GET["modify_call_times"])) {$modify_call_times=$_GET["modify_call_times"];} + elseif (isset($_POST["modify_call_times"])) {$modify_call_times=$_POST["modify_call_times"];} +if (isset($_GET["modify_leads"])) {$modify_leads=$_GET["modify_leads"];} + elseif (isset($_POST["modify_leads"])) {$modify_leads=$_POST["modify_leads"];} +if (isset($_GET["monitor_prefix"])) {$monitor_prefix=$_GET["monitor_prefix"];} + elseif (isset($_POST["monitor_prefix"])) {$monitor_prefix=$_POST["monitor_prefix"];} +if (isset($_GET["next_agent_call"])) {$next_agent_call=$_GET["next_agent_call"];} + elseif (isset($_POST["next_agent_call"])) {$next_agent_call=$_POST["next_agent_call"];} +if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} + elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} +if (isset($_GET["old_campaign_id"])) {$old_campaign_id=$_GET["old_campaign_id"];} + elseif (isset($_POST["old_campaign_id"])) {$old_campaign_id=$_POST["old_campaign_id"];} +if (isset($_GET["old_conf_exten"])) {$old_conf_exten=$_GET["old_conf_exten"];} + elseif (isset($_POST["old_conf_exten"])) {$old_conf_exten=$_POST["old_conf_exten"];} +if (isset($_GET["old_extension"])) {$old_extension=$_GET["old_extension"];} + elseif (isset($_POST["old_extension"])) {$old_extension=$_POST["old_extension"];} +if (isset($_GET["old_server_id"])) {$old_server_id=$_GET["old_server_id"];} + elseif (isset($_POST["old_server_id"])) {$old_server_id=$_POST["old_server_id"];} +if (isset($_GET["old_server_ip"])) {$old_server_ip=$_GET["old_server_ip"];} + elseif (isset($_POST["old_server_ip"])) {$old_server_ip=$_POST["old_server_ip"];} +if (isset($_GET["OLDuser_group"])) {$OLDuser_group=$_GET["OLDuser_group"];} + elseif (isset($_POST["OLDuser_group"])) {$OLDuser_group=$_POST["OLDuser_group"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} +if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} + elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} +if (isset($_GET["park_ext"])) {$park_ext=$_GET["park_ext"];} + elseif (isset($_POST["park_ext"])) {$park_ext=$_POST["park_ext"];} +if (isset($_GET["park_file_name"])) {$park_file_name=$_GET["park_file_name"];} + elseif (isset($_POST["park_file_name"])) {$park_file_name=$_POST["park_file_name"];} +if (isset($_GET["park_on_extension"])) {$park_on_extension=$_GET["park_on_extension"];} + elseif (isset($_POST["park_on_extension"])) {$park_on_extension=$_POST["park_on_extension"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} + elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["phone_type"])) {$phone_type=$_GET["phone_type"];} + elseif (isset($_POST["phone_type"])) {$phone_type=$_POST["phone_type"];} +if (isset($_GET["picture"])) {$picture=$_GET["picture"];} + elseif (isset($_POST["picture"])) {$picture=$_POST["picture"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_GET["QUEUE_ACTION_enabled"];} + elseif (isset($_POST["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_POST["QUEUE_ACTION_enabled"];} +if (isset($_GET["recording_exten"])) {$recording_exten=$_GET["recording_exten"];} + elseif (isset($_POST["recording_exten"])) {$recording_exten=$_POST["recording_exten"];} +if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} + elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} +if (isset($_GET["reset_hopper"])) {$reset_hopper=$_GET["reset_hopper"];} + elseif (isset($_POST["reset_hopper"])) {$reset_hopper=$_POST["reset_hopper"];} +if (isset($_GET["reset_list"])) {$reset_list=$_GET["reset_list"];} + elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} +if (isset($_GET["safe_harbor_exten"])) {$safe_harbor_exten=$_GET["safe_harbor_exten"];} + elseif (isset($_POST["safe_harbor_exten"])) {$safe_harbor_exten=$_POST["safe_harbor_exten"];} +if (isset($_GET["drop_action"])) {$drop_action=$_GET["drop_action"];} + elseif (isset($_POST["drop_action"])) {$drop_action=$_POST["drop_action"];} +if (isset($_GET["scheduled_callbacks"])) {$scheduled_callbacks=$_GET["scheduled_callbacks"];} + elseif (isset($_POST["scheduled_callbacks"])) {$scheduled_callbacks=$_POST["scheduled_callbacks"];} +if (isset($_GET["script_comments"])) {$script_comments=$_GET["script_comments"];} + elseif (isset($_POST["script_comments"])) {$script_comments=$_POST["script_comments"];} +if (isset($_GET["script_id"])) {$script_id=$_GET["script_id"];} + elseif (isset($_POST["script_id"])) {$script_id=$_POST["script_id"];} +if (isset($_GET["script_name"])) {$script_name=$_GET["script_name"];} + elseif (isset($_POST["script_name"])) {$script_name=$_POST["script_name"];} +if (isset($_GET["script_text"])) {$script_text=$_GET["script_text"];} + elseif (isset($_POST["script_text"])) {$script_text=$_POST["script_text"];} +if (isset($_GET["selectable"])) {$selectable=$_GET["selectable"];} + elseif (isset($_POST["selectable"])) {$selectable=$_POST["selectable"];} +if (isset($_GET["server_description"])) {$server_description=$_GET["server_description"];} + elseif (isset($_POST["server_description"])) {$server_description=$_POST["server_description"];} +if (isset($_GET["server_id"])) {$server_id=$_GET["server_id"];} + elseif (isset($_POST["server_id"])) {$server_id=$_POST["server_id"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["state_call_time_state"])) {$state_call_time_state=$_GET["state_call_time_state"];} + elseif (isset($_POST["state_call_time_state"])) {$state_call_time_state=$_POST["state_call_time_state"];} +if (isset($_GET["state_rule"])) {$state_rule=$_GET["state_rule"];} + elseif (isset($_POST["state_rule"])) {$state_rule=$_POST["state_rule"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["status_id"])) {$status_id=$_GET["status_id"];} + elseif (isset($_POST["status_id"])) {$status_id=$_POST["status_id"];} +if (isset($_GET["status_name"])) {$status_name=$_GET["status_name"];} + elseif (isset($_POST["status_name"])) {$status_name=$_POST["status_name"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["sys_perf_log"])) {$sys_perf_log=$_GET["sys_perf_log"];} + elseif (isset($_POST["sys_perf_log"])) {$sys_perf_log=$_POST["sys_perf_log"];} +if (isset($_GET["telnet_host"])) {$telnet_host=$_GET["telnet_host"];} + elseif (isset($_POST["telnet_host"])) {$telnet_host=$_POST["telnet_host"];} +if (isset($_GET["telnet_port"])) {$telnet_port=$_GET["telnet_port"];} + elseif (isset($_POST["telnet_port"])) {$telnet_port=$_POST["telnet_port"];} +if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["updater_check_enabled"];} + elseif (isset($_POST["updater_check_enabled"])) {$updater_check_enabled=$_POST["updater_check_enabled"];} +if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} + elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} +if (isset($_GET["use_campaign_dnc"])) {$use_campaign_dnc=$_GET["use_campaign_dnc"];} + elseif (isset($_POST["use_campaign_dnc"])) {$use_campaign_dnc=$_POST["use_campaign_dnc"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["user_level"])) {$user_level=$_GET["user_level"];} + elseif (isset($_POST["user_level"])) {$user_level=$_POST["user_level"];} +if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} + elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} +if (isset($_GET["user_switching_enabled"])) {$user_switching_enabled=$_GET["user_switching_enabled"];} + elseif (isset($_POST["user_switching_enabled"])) {$user_switching_enabled=$_POST["user_switching_enabled"];} +if (isset($_GET["vd_server_logs"])) {$vd_server_logs=$_GET["vd_server_logs"];} + elseif (isset($_POST["vd_server_logs"])) {$vd_server_logs=$_POST["vd_server_logs"];} +if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} + elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} +if (isset($_GET["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_GET["VICIDIAL_park_on_extension"];} + elseif (isset($_POST["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_POST["VICIDIAL_park_on_extension"];} +if (isset($_GET["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_GET["VICIDIAL_park_on_filename"];} + elseif (isset($_POST["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_POST["VICIDIAL_park_on_filename"];} +if (isset($_GET["vicidial_recording"])) {$vicidial_recording=$_GET["vicidial_recording"];} + elseif (isset($_POST["vicidial_recording"])) {$vicidial_recording=$_POST["vicidial_recording"];} +if (isset($_GET["vicidial_transfers"])) {$vicidial_transfers=$_GET["vicidial_transfers"];} + elseif (isset($_POST["vicidial_transfers"])) {$vicidial_transfers=$_POST["vicidial_transfers"];} +if (isset($_GET["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_GET["VICIDIAL_web_URL"];} + elseif (isset($_POST["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_POST["VICIDIAL_web_URL"];} +if (isset($_GET["voicemail_button_enabled"])) {$voicemail_button_enabled=$_GET["voicemail_button_enabled"];} + elseif (isset($_POST["voicemail_button_enabled"])) {$voicemail_button_enabled=$_POST["voicemail_button_enabled"];} +if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} + elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} +if (isset($_GET["voicemail_ext"])) {$voicemail_ext=$_GET["voicemail_ext"];} + elseif (isset($_POST["voicemail_ext"])) {$voicemail_ext=$_POST["voicemail_ext"];} +if (isset($_GET["voicemail_exten"])) {$voicemail_exten=$_GET["voicemail_exten"];} + elseif (isset($_POST["voicemail_exten"])) {$voicemail_exten=$_POST["voicemail_exten"];} +if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} + elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} +if (isset($_GET["web_form_address"])) {$web_form_address=$_GET["web_form_address"];} + elseif (isset($_POST["web_form_address"])) {$web_form_address=$_POST["web_form_address"];} +if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];} + elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];} +if (isset($_GET["wrapup_seconds"])) {$wrapup_seconds=$_GET["wrapup_seconds"];} + elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];} +if (isset($_GET["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_GET["xferconf_a_dtmf"];} + elseif (isset($_POST["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_POST["xferconf_a_dtmf"];} +if (isset($_GET["xferconf_a_number"])) {$xferconf_a_number=$_GET["xferconf_a_number"];} + elseif (isset($_POST["xferconf_a_number"])) {$xferconf_a_number=$_POST["xferconf_a_number"];} +if (isset($_GET["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_GET["xferconf_b_dtmf"];} + elseif (isset($_POST["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_POST["xferconf_b_dtmf"];} +if (isset($_GET["xferconf_b_number"])) {$xferconf_b_number=$_GET["xferconf_b_number"];} + elseif (isset($_POST["xferconf_b_number"])) {$xferconf_b_number=$_POST["xferconf_b_number"];} +if (isset($_GET["vicidial_balance_active"])) {$vicidial_balance_active=$_GET["vicidial_balance_active"];} + elseif (isset($_POST["vicidial_balance_active"])) {$vicidial_balance_active=$_POST["vicidial_balance_active"];} +if (isset($_GET["balance_trunks_offlimits"])) {$balance_trunks_offlimits=$_GET["balance_trunks_offlimits"];} + elseif (isset($_POST["balance_trunks_offlimits"])) {$balance_trunks_offlimits=$_POST["balance_trunks_offlimits"];} +if (isset($_GET["dedicated_trunks"])) {$dedicated_trunks=$_GET["dedicated_trunks"];} + elseif (isset($_POST["dedicated_trunks"])) {$dedicated_trunks=$_POST["dedicated_trunks"];} +if (isset($_GET["trunk_restriction"])) {$trunk_restriction=$_GET["trunk_restriction"];} + elseif (isset($_POST["trunk_restriction"])) {$trunk_restriction=$_POST["trunk_restriction"];} +if (isset($_GET["campaigns"])) {$campaigns=$_GET["campaigns"];} + elseif (isset($_POST["campaigns"])) {$campaigns=$_POST["campaigns"];} +if (isset($_GET["dial_level_override"])) {$dial_level_override=$_GET["dial_level_override"];} + elseif (isset($_POST["dial_level_override"])) {$dial_level_override=$_POST["dial_level_override"];} +if (isset($_GET["concurrent_transfers"])) {$concurrent_transfers=$_GET["concurrent_transfers"];} + elseif (isset($_POST["concurrent_transfers"])) {$concurrent_transfers=$_POST["concurrent_transfers"];} +if (isset($_GET["auto_alt_dial"])) {$auto_alt_dial=$_GET["auto_alt_dial"];} + elseif (isset($_POST["auto_alt_dial"])) {$auto_alt_dial=$_POST["auto_alt_dial"];} +if (isset($_GET["modify_users"])) {$modify_users=$_GET["modify_users"];} + elseif (isset($_POST["modify_users"])) {$modify_users=$_POST["modify_users"];} +if (isset($_GET["modify_campaigns"])) {$modify_campaigns=$_GET["modify_campaigns"];} + elseif (isset($_POST["modify_campaigns"])) {$modify_campaigns=$_POST["modify_campaigns"];} +if (isset($_GET["modify_lists"])) {$modify_lists=$_GET["modify_lists"];} + elseif (isset($_POST["modify_lists"])) {$modify_lists=$_POST["modify_lists"];} +if (isset($_GET["modify_scripts"])) {$modify_scripts=$_GET["modify_scripts"];} + elseif (isset($_POST["modify_scripts"])) {$modify_scripts=$_POST["modify_scripts"];} +if (isset($_GET["modify_filters"])) {$modify_filters=$_GET["modify_filters"];} + elseif (isset($_POST["modify_filters"])) {$modify_filters=$_POST["modify_filters"];} +if (isset($_GET["modify_ingroups"])) {$modify_ingroups=$_GET["modify_ingroups"];} + elseif (isset($_POST["modify_ingroups"])) {$modify_ingroups=$_POST["modify_ingroups"];} +if (isset($_GET["modify_usergroups"])) {$modify_usergroups=$_GET["modify_usergroups"];} + elseif (isset($_POST["modify_usergroups"])) {$modify_usergroups=$_POST["modify_usergroups"];} +if (isset($_GET["modify_remoteagents"])) {$modify_remoteagents=$_GET["modify_remoteagents"];} + elseif (isset($_POST["modify_remoteagents"])) {$modify_remoteagents=$_POST["modify_remoteagents"];} +if (isset($_GET["modify_servers"])) {$modify_servers=$_GET["modify_servers"];} + elseif (isset($_POST["modify_servers"])) {$modify_servers=$_POST["modify_servers"];} +if (isset($_GET["view_reports"])) {$view_reports=$_GET["view_reports"];} + elseif (isset($_POST["view_reports"])) {$view_reports=$_POST["view_reports"];} +if (isset($_GET["agent_pause_codes_active"])) {$agent_pause_codes_active=$_GET["agent_pause_codes_active"];} + elseif (isset($_POST["agent_pause_codes_active"])) {$agent_pause_codes_active=$_POST["agent_pause_codes_active"];} +if (isset($_GET["pause_code"])) {$pause_code=$_GET["pause_code"];} + elseif (isset($_POST["pause_code"])) {$pause_code=$_POST["pause_code"];} +if (isset($_GET["pause_code_name"])) {$pause_code_name=$_GET["pause_code_name"];} + elseif (isset($_POST["pause_code_name"])) {$pause_code_name=$_POST["pause_code_name"];} +if (isset($_GET["billable"])) {$billable=$_GET["billable"];} + elseif (isset($_POST["billable"])) {$billable=$_POST["billable"];} +if (isset($_GET["campaign_description"])) {$campaign_description=$_GET["campaign_description"];} + elseif (isset($_POST["campaign_description"])) {$campaign_description=$_POST["campaign_description"];} +if (isset($_GET["campaign_stats_refresh"])) {$campaign_stats_refresh=$_GET["campaign_stats_refresh"];} + elseif (isset($_POST["campaign_stats_refresh"])){$campaign_stats_refresh=$_POST["campaign_stats_refresh"];} +if (isset($_GET["list_description"])) {$list_description=$_GET["list_description"];} + elseif (isset($_POST["list_description"])) {$list_description=$_POST["list_description"];} +if (isset($_GET["vicidial_recording_override"])) {$vicidial_recording_override=$_GET["vicidial_recording_override"];} + elseif (isset($_POST["vicidial_recording_override"])) {$vicidial_recording_override=$_POST["vicidial_recording_override"];} +if (isset($_GET["use_non_latin"])) {$use_non_latin=$_GET["use_non_latin"];} + elseif (isset($_POST["use_non_latin"])) {$use_non_latin=$_POST["use_non_latin"];} +if (isset($_GET["webroot_writable"])) {$webroot_writable=$_GET["webroot_writable"];} + elseif (isset($_POST["webroot_writable"])) {$webroot_writable=$_POST["webroot_writable"];} +if (isset($_GET["enable_queuemetrics_logging"])) {$enable_queuemetrics_logging=$_GET["enable_queuemetrics_logging"];} + elseif (isset($_POST["enable_queuemetrics_logging"])) {$enable_queuemetrics_logging=$_POST["enable_queuemetrics_logging"];} +if (isset($_GET["queuemetrics_server_ip"])) {$queuemetrics_server_ip=$_GET["queuemetrics_server_ip"];} + elseif (isset($_POST["queuemetrics_server_ip"])) {$queuemetrics_server_ip=$_POST["queuemetrics_server_ip"];} +if (isset($_GET["queuemetrics_dbname"])) {$queuemetrics_dbname=$_GET["queuemetrics_dbname"];} + elseif (isset($_POST["queuemetrics_dbname"])) {$queuemetrics_dbname=$_POST["queuemetrics_dbname"];} +if (isset($_GET["queuemetrics_login"])) {$queuemetrics_login=$_GET["queuemetrics_login"];} + elseif (isset($_POST["queuemetrics_login"])) {$queuemetrics_login=$_POST["queuemetrics_login"];} +if (isset($_GET["queuemetrics_pass"])) {$queuemetrics_pass=$_GET["queuemetrics_pass"];} + elseif (isset($_POST["queuemetrics_pass"])) {$queuemetrics_pass=$_POST["queuemetrics_pass"];} +if (isset($_GET["queuemetrics_url"])) {$queuemetrics_url=$_GET["queuemetrics_url"];} + elseif (isset($_POST["queuemetrics_url"])) {$queuemetrics_url=$_POST["queuemetrics_url"];} +if (isset($_GET["queuemetrics_log_id"])) {$queuemetrics_log_id=$_GET["queuemetrics_log_id"];} + elseif (isset($_POST["queuemetrics_log_id"])) {$queuemetrics_log_id=$_POST["queuemetrics_log_id"];} +if (isset($_GET["dial_status"])) {$dial_status=$_GET["dial_status"];} + elseif (isset($_POST["dial_status"])) {$dial_status=$_POST["dial_status"];} +if (isset($_GET["queuemetrics_eq_prepend"])) {$queuemetrics_eq_prepend=$_GET["queuemetrics_eq_prepend"];} + elseif (isset($_POST["queuemetrics_eq_prepend"])) {$queuemetrics_eq_prepend=$_POST["queuemetrics_eq_prepend"];} +if (isset($_GET["vicidial_agent_disable"])) {$vicidial_agent_disable=$_GET["vicidial_agent_disable"];} + elseif (isset($_POST["vicidial_agent_disable"])) {$vicidial_agent_disable=$_POST["vicidial_agent_disable"];} +if (isset($_GET["disable_alter_custdata"])) {$disable_alter_custdata=$_GET["disable_alter_custdata"];} + elseif (isset($_POST["disable_alter_custdata"])) {$disable_alter_custdata=$_POST["disable_alter_custdata"];} +if (isset($_GET["alter_custdata_override"])) {$alter_custdata_override=$_GET["alter_custdata_override"];} + elseif (isset($_POST["alter_custdata_override"])) {$alter_custdata_override=$_POST["alter_custdata_override"];} +if (isset($_GET["no_hopper_leads_logins"])) {$no_hopper_leads_logins=$_GET["no_hopper_leads_logins"];} + elseif (isset($_POST["no_hopper_leads_logins"])) {$no_hopper_leads_logins=$_POST["no_hopper_leads_logins"];} +if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} + elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} +if (isset($_GET["allow_sipsak_messages"])) {$allow_sipsak_messages=$_GET["allow_sipsak_messages"];} + elseif (isset($_POST["allow_sipsak_messages"])) {$allow_sipsak_messages=$_POST["allow_sipsak_messages"];} +if (isset($_GET["admin_home_url"])) {$admin_home_url=$_GET["admin_home_url"];} + elseif (isset($_POST["admin_home_url"])) {$admin_home_url=$_POST["admin_home_url"];} +if (isset($_GET["list_order_mix"])) {$list_order_mix=$_GET["list_order_mix"];} + elseif (isset($_POST["list_order_mix"])) {$list_order_mix=$_POST["list_order_mix"];} +if (isset($_GET["vcl_id"])) {$vcl_id=$_GET["vcl_id"];} + elseif (isset($_POST["vcl_id"])) {$vcl_id=$_POST["vcl_id"];} +if (isset($_GET["vcl_name"])) {$vcl_name=$_GET["vcl_name"];} + elseif (isset($_POST["vcl_name"])) {$vcl_name=$_POST["vcl_name"];} +if (isset($_GET["list_mix_container"])) {$list_mix_container=$_GET["list_mix_container"];} + elseif (isset($_POST["list_mix_container"])) {$list_mix_container=$_POST["list_mix_container"];} +if (isset($_GET["mix_method"])) {$mix_method=$_GET["mix_method"];} + elseif (isset($_POST["mix_method"])) {$mix_method=$_POST["mix_method"];} +if (isset($_GET["human_answered"])) {$human_answered=$_GET["human_answered"];} + elseif (isset($_POST["human_answered"])) {$human_answered=$_POST["human_answered"];} +if (isset($_GET["category"])) {$category=$_GET["category"];} + elseif (isset($_POST["category"])) {$category=$_POST["category"];} +if (isset($_GET["vsc_id"])) {$vsc_id=$_GET["vsc_id"];} + elseif (isset($_POST["vsc_id"])) {$vsc_id=$_POST["vsc_id"];} +if (isset($_GET["vsc_name"])) {$vsc_name=$_GET["vsc_name"];} + elseif (isset($_POST["vsc_name"])) {$vsc_name=$_POST["vsc_name"];} +if (isset($_GET["vsc_description"])) {$vsc_description=$_GET["vsc_description"];} + elseif (isset($_POST["vsc_description"])) {$vsc_description=$_POST["vsc_description"];} +if (isset($_GET["tovdad_display"])) {$tovdad_display=$_GET["tovdad_display"];} + elseif (isset($_POST["tovdad_display"])) {$tovdad_display=$_POST["tovdad_display"];} +if (isset($_GET["mix_container_item"])) {$mix_container_item=$_GET["mix_container_item"];} + elseif (isset($_POST["mix_container_item"])) {$mix_container_item=$_POST["mix_container_item"];} +if (isset($_GET["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_GET["enable_agc_xfer_log"];} + elseif (isset($_POST["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_POST["enable_agc_xfer_log"];} +if (isset($_GET["after_hours_action"])) {$after_hours_action=$_GET["after_hours_action"];} + elseif (isset($_POST["after_hours_action"])) {$after_hours_action=$_POST["after_hours_action"];} +if (isset($_GET["after_hours_message_filename"])) {$after_hours_message_filename=$_GET["after_hours_message_filename"];} + elseif (isset($_POST["after_hours_message_filename"])) {$after_hours_message_filename=$_POST["after_hours_message_filename"];} +if (isset($_GET["after_hours_exten"])) {$after_hours_exten=$_GET["after_hours_exten"];} + elseif (isset($_POST["after_hours_exten"])) {$after_hours_exten=$_POST["after_hours_exten"];} +if (isset($_GET["after_hours_voicemail"])) {$after_hours_voicemail=$_GET["after_hours_voicemail"];} + elseif (isset($_POST["after_hours_voicemail"])) {$after_hours_voicemail=$_POST["after_hours_voicemail"];} +if (isset($_GET["welcome_message_filename"])) {$welcome_message_filename=$_GET["welcome_message_filename"];} + elseif (isset($_POST["welcome_message_filename"])) {$welcome_message_filename=$_POST["welcome_message_filename"];} +if (isset($_GET["moh_context"])) {$moh_context=$_GET["moh_context"];} + elseif (isset($_POST["moh_context"])) {$moh_context=$_POST["moh_context"];} +if (isset($_GET["onhold_prompt_filename"])) {$onhold_prompt_filename=$_GET["onhold_prompt_filename"];} + elseif (isset($_POST["onhold_prompt_filename"])) {$onhold_prompt_filename=$_POST["onhold_prompt_filename"];} +if (isset($_GET["prompt_interval"])) {$prompt_interval=$_GET["prompt_interval"];} + elseif (isset($_POST["prompt_interval"])) {$prompt_interval=$_POST["prompt_interval"];} +if (isset($_GET["agent_alert_exten"])) {$agent_alert_exten=$_GET["agent_alert_exten"];} + elseif (isset($_POST["agent_alert_exten"])) {$agent_alert_exten=$_POST["agent_alert_exten"];} +if (isset($_GET["agent_alert_delay"])) {$agent_alert_delay=$_GET["agent_alert_delay"];} + elseif (isset($_POST["agent_alert_delay"])) {$agent_alert_delay=$_POST["agent_alert_delay"];} +if (isset($_GET["group_rank"])) {$group_rank=$_GET["group_rank"];} + elseif (isset($_POST["group_rank"])) {$group_rank=$_POST["group_rank"];} +if (isset($_GET["campaign_allow_inbound"])) {$campaign_allow_inbound=$_GET["campaign_allow_inbound"];} + elseif (isset($_POST["campaign_allow_inbound"])) {$campaign_allow_inbound=$_POST["campaign_allow_inbound"];} +if (isset($_GET["manual_dial_list_id"])) {$manual_dial_list_id=$_GET["manual_dial_list_id"];} + elseif (isset($_POST["manual_dial_list_id"])) {$manual_dial_list_id=$_POST["manual_dial_list_id"];} +if (isset($_GET["campaign_rank"])) {$campaign_rank=$_GET["campaign_rank"];} + elseif (isset($_POST["campaign_rank"])) {$campaign_rank=$_POST["campaign_rank"];} +if (isset($_GET["source_campaign_id"])) {$source_campaign_id=$_GET["source_campaign_id"];} + elseif (isset($_POST["source_campaign_id"])) {$source_campaign_id=$_POST["source_campaign_id"];} +if (isset($_GET["source_user_id"])) {$source_user_id=$_GET["source_user_id"];} + elseif (isset($_POST["source_user_id"])) {$source_user_id=$_POST["source_user_id"];} +if (isset($_GET["source_group_id"])) {$source_group_id=$_GET["source_group_id"];} + elseif (isset($_POST["source_group_id"])) {$source_group_id=$_POST["source_group_id"];} +if (isset($_GET["default_xfer_group"])) {$default_xfer_group=$_GET["default_xfer_group"];} + elseif (isset($_POST["default_xfer_group"])) {$default_xfer_group=$_POST["default_xfer_group"];} +if (isset($_GET["qc_enabled"])) {$qc_enabled=$_GET["qc_enabled"];} + elseif (isset($_POST["qc_enabled"])) {$qc_enabled=$_POST["qc_enabled"];} +if (isset($_GET["qc_user_level"])) {$qc_user_level=$_GET["qc_user_level"];} + elseif (isset($_POST["qc_user_level"])) {$qc_user_level=$_POST["qc_user_level"];} +if (isset($_GET["qc_pass"])) {$qc_pass=$_GET["qc_pass"];} + elseif (isset($_POST["qc_pass"])) {$qc_pass=$_POST["qc_pass"];} +if (isset($_GET["qc_finish"])) {$qc_finish=$_GET["qc_finish"];} + elseif (isset($_POST["qc_finish"])) {$qc_finish=$_POST["qc_finish"];} +if (isset($_GET["qc_commit"])) {$qc_commit=$_GET["qc_commit"];} + elseif (isset($_POST["qc_commit"])) {$qc_commit=$_POST["qc_commit"];} +if (isset($_GET["qc_campaigns"])) {$qc_campaigns=$_GET["qc_campaigns"];} + elseif (isset($_POST["qc_campaigns"])) {$qc_campaigns=$_POST["qc_campaigns"];} +if (isset($_GET["qc_groups"])) {$qc_groups=$_GET["qc_groups"];} + elseif (isset($_POST["qc_groups"])) {$qc_groups=$_POST["qc_groups"];} +if (isset($_GET["queue_priority"])) {$queue_priority=$_GET["queue_priority"];} + elseif (isset($_POST["queue_priority"])) {$queue_priority=$_POST["queue_priority"];} +if (isset($_GET["drop_inbound_group"])) {$drop_inbound_group=$_GET["drop_inbound_group"];} + elseif (isset($_POST["drop_inbound_group"])) {$drop_inbound_group=$_POST["drop_inbound_group"];} +if (isset($_GET["qc_statuses"])) {$qc_statuses=$_GET["qc_statuses"];} + elseif (isset($_POST["qc_statuses"])) {$qc_statuses=$_POST["qc_statuses"];} +if (isset($_GET["qc_lists"])) {$qc_lists=$_GET["qc_lists"];} + elseif (isset($_POST["qc_lists"])) {$qc_lists=$_POST["qc_lists"];} +if (isset($_GET["qc_get_record_launch"])) {$qc_get_record_launch=$_GET["qc_get_record_launch"];} + elseif (isset($_POST["qc_get_record_launch"])) {$qc_get_record_launch=$_POST["qc_get_record_launch"];} +if (isset($_GET["qc_show_recording"])) {$qc_show_recording=$_GET["qc_show_recording"];} + elseif (isset($_POST["qc_show_recording"])) {$qc_show_recording=$_POST["qc_show_recording"];} +if (isset($_GET["qc_shift_id"])) {$qc_shift_id=$_GET["qc_shift_id"];} + elseif (isset($_POST["qc_shift_id"])) {$qc_shift_id=$_POST["qc_shift_id"];} +if (isset($_GET["qc_web_form_address"])) {$qc_web_form_address=$_GET["qc_web_form_address"];} + elseif (isset($_POST["qc_web_form_address"])) {$qc_web_form_address=$_POST["qc_web_form_address"];} +if (isset($_GET["qc_script"])) {$qc_script=$_GET["qc_script"];} + elseif (isset($_POST["qc_script"])) {$qc_script=$_POST["qc_script"];} +if (isset($_GET["ingroup_recording_override"])) {$ingroup_recording_override=$_GET["ingroup_recording_override"];} + elseif (isset($_POST["ingroup_recording_override"])) {$ingroup_recording_override=$_POST["ingroup_recording_override"];} +if (isset($_GET["code"])) {$code=$_GET["code"];} + elseif (isset($_POST["code"])) {$code=$_POST["code"];} +if (isset($_GET["code_name"])) {$code_name=$_GET["code_name"];} + elseif (isset($_POST["code_name"])) {$code_name=$_POST["code_name"];} +if (isset($_GET["afterhours_xfer_group"])) {$afterhours_xfer_group=$_GET["afterhours_xfer_group"];} + elseif (isset($_POST["afterhours_xfer_group"])) {$afterhours_xfer_group=$_POST["afterhours_xfer_group"];} +if (isset($_GET["alias_id"])) {$alias_id=$_GET["alias_id"];} + elseif (isset($_POST["alias_id"])) {$alias_id=$_POST["alias_id"];} +if (isset($_GET["alias_name"])) {$alias_name=$_GET["alias_name"];} + elseif (isset($_POST["alias_name"])) {$alias_name=$_POST["alias_name"];} +if (isset($_GET["logins_list"])) {$logins_list=$_GET["logins_list"];} + elseif (isset($_POST["logins_list"])) {$logins_list=$_POST["logins_list"];} +if (isset($_GET["shift_id"])) {$shift_id=$_GET["shift_id"];} + elseif (isset($_POST["shift_id"])) {$shift_id=$_POST["shift_id"];} +if (isset($_GET["shift_name"])) {$shift_name=$_GET["shift_name"];} + elseif (isset($_POST["shift_name"])) {$shift_name=$_POST["shift_name"];} +if (isset($_GET["shift_start_time"])) {$shift_start_time=$_GET["shift_start_time"];} + elseif (isset($_POST["shift_start_time"])) {$shift_start_time=$_POST["shift_start_time"];} +if (isset($_GET["shift_length"])) {$shift_length=$_GET["shift_length"];} + elseif (isset($_POST["shift_length"])) {$shift_length=$_POST["shift_length"];} +if (isset($_GET["shift_weekdays"])) {$shift_weekdays=$_GET["shift_weekdays"];} + elseif (isset($_POST["shift_weekdays"])) {$shift_weekdays=$_POST["shift_weekdays"];} +if (isset($_GET["group_shifts"])) {$group_shifts=$_GET["group_shifts"];} + elseif (isset($_POST["group_shifts"])) {$group_shifts=$_POST["group_shifts"];} +if (isset($_GET["timeclock_end_of_day"])) {$timeclock_end_of_day=$_GET["timeclock_end_of_day"];} + elseif (isset($_POST["timeclock_end_of_day"])) {$timeclock_end_of_day=$_POST["timeclock_end_of_day"];} +if (isset($_GET["survey_first_audio_file"])) {$survey_first_audio_file=$_GET["survey_first_audio_file"];} + elseif (isset($_POST["survey_first_audio_file"])) {$survey_first_audio_file=$_POST["survey_first_audio_file"];} +if (isset($_GET["survey_dtmf_digits"])) {$survey_dtmf_digits=$_GET["survey_dtmf_digits"];} + elseif (isset($_POST["survey_dtmf_digits"])) {$survey_dtmf_digits=$_POST["survey_dtmf_digits"];} +if (isset($_GET["survey_ni_digit"])) {$survey_ni_digit=$_GET["survey_ni_digit"];} + elseif (isset($_POST["survey_ni_digit"])) {$survey_ni_digit=$_POST["survey_ni_digit"];} +if (isset($_GET["survey_opt_in_audio_file"])) {$survey_opt_in_audio_file=$_GET["survey_opt_in_audio_file"];} + elseif (isset($_POST["survey_opt_in_audio_file"])) {$survey_opt_in_audio_file=$_POST["survey_opt_in_audio_file"];} +if (isset($_GET["survey_ni_audio_file"])) {$survey_ni_audio_file=$_GET["survey_ni_audio_file"];} + elseif (isset($_POST["survey_ni_audio_file"])) {$survey_ni_audio_file=$_POST["survey_ni_audio_file"];} +if (isset($_GET["survey_method"])) {$survey_method=$_GET["survey_method"];} + elseif (isset($_POST["survey_method"])) {$survey_method=$_POST["survey_method"];} +if (isset($_GET["survey_no_response_action"])) {$survey_no_response_action=$_GET["survey_no_response_action"];} + elseif (isset($_POST["survey_no_response_action"])) {$survey_no_response_action=$_POST["survey_no_response_action"];} +if (isset($_GET["survey_ni_status"])) {$survey_ni_status=$_GET["survey_ni_status"];} + elseif (isset($_POST["survey_ni_status"])) {$survey_ni_status=$_POST["survey_ni_status"];} +if (isset($_GET["survey_response_digit_map"])) {$survey_response_digit_map=$_GET["survey_response_digit_map"];} + elseif (isset($_POST["survey_response_digit_map"])) {$survey_response_digit_map=$_POST["survey_response_digit_map"];} +if (isset($_GET["survey_xfer_exten"])) {$survey_xfer_exten=$_GET["survey_xfer_exten"];} + elseif (isset($_POST["survey_xfer_exten"])) {$survey_xfer_exten=$_POST["survey_xfer_exten"];} +if (isset($_GET["survey_camp_record_dir"])) {$survey_camp_record_dir=$_GET["survey_camp_record_dir"];} + elseif (isset($_POST["survey_camp_record_dir"])) {$survey_camp_record_dir=$_POST["survey_camp_record_dir"];} +if (isset($_GET["add_timeclock_log"])) {$add_timeclock_log=$_GET["add_timeclock_log"];} + elseif (isset($_POST["add_timeclock_log"])) {$add_timeclock_log=$_POST["add_timeclock_log"];} +if (isset($_GET["modify_timeclock_log"])) {$modify_timeclock_log=$_GET["modify_timeclock_log"];} + elseif (isset($_POST["modify_timeclock_log"])) {$modify_timeclock_log=$_POST["modify_timeclock_log"];} +if (isset($_GET["delete_timeclock_log"])) {$delete_timeclock_log=$_GET["delete_timeclock_log"];} + elseif (isset($_POST["delete_timeclock_log"])) {$delete_timeclock_log=$_POST["delete_timeclock_log"];} +if (isset($_GET["phone_numbers"])) {$phone_numbers=$_GET["phone_numbers"];} + elseif (isset($_POST["phone_numbers"])) {$phone_numbers=$_POST["phone_numbers"];} +if (isset($_GET["vdc_header_date_format"])) {$vdc_header_date_format=$_GET["vdc_header_date_format"];} + elseif (isset($_POST["vdc_header_date_format"])) {$vdc_header_date_format=$_POST["vdc_header_date_format"];} +if (isset($_GET["vdc_customer_date_format"])) {$vdc_customer_date_format=$_GET["vdc_customer_date_format"];} + elseif (isset($_POST["vdc_customer_date_format"])) {$vdc_customer_date_format=$_POST["vdc_customer_date_format"];} +if (isset($_GET["vdc_header_phone_format"])) {$vdc_header_phone_format=$_GET["vdc_header_phone_format"];} + elseif (isset($_POST["vdc_header_phone_format"])) {$vdc_header_phone_format=$_POST["vdc_header_phone_format"];} +if (isset($_GET["disable_alter_custphone"])) {$disable_alter_custphone=$_GET["disable_alter_custphone"];} + elseif (isset($_POST["disable_alter_custphone"])) {$disable_alter_custphone=$_POST["disable_alter_custphone"];} +if (isset($_GET["alter_custphone_override"])) {$alter_custphone_override=$_GET["alter_custphone_override"];} + elseif (isset($_POST["alter_custphone_override"])) {$alter_custphone_override=$_POST["alter_custphone_override"];} +if (isset($_GET["vdc_agent_api_access"])) {$vdc_agent_api_access=$_GET["vdc_agent_api_access"];} + elseif (isset($_POST["vdc_agent_api_access"])) {$vdc_agent_api_access=$_POST["vdc_agent_api_access"];} +if (isset($_GET["vdc_agent_api_active"])) {$vdc_agent_api_active=$_GET["vdc_agent_api_active"];} + elseif (isset($_POST["vdc_agent_api_active"])) {$vdc_agent_api_active=$_POST["vdc_agent_api_active"];} +if (isset($_GET["display_queue_count"])) {$display_queue_count=$_GET["display_queue_count"];} + elseif (isset($_POST["display_queue_count"])) {$display_queue_count=$_POST["display_queue_count"];} +if (isset($_GET["sale_category"])) {$sale_category=$_GET["sale_category"];} + elseif (isset($_POST["sale_category"])) {$sale_category=$_POST["sale_category"];} +if (isset($_GET["dead_lead_category"])) {$dead_lead_category=$_GET["dead_lead_category"];} + elseif (isset($_POST["dead_lead_category"])) {$dead_lead_category=$_POST["dead_lead_category"];} +if (isset($_GET["manual_dial_filter"])) {$manual_dial_filter=$_GET["manual_dial_filter"];} + elseif (isset($_POST["manual_dial_filter"])) {$manual_dial_filter=$_POST["manual_dial_filter"];} +if (isset($_GET["agent_clipboard_copy"])) {$agent_clipboard_copy=$_GET["agent_clipboard_copy"];} + elseif (isset($_POST["agent_clipboard_copy"])) {$agent_clipboard_copy=$_POST["agent_clipboard_copy"];} +if (isset($_GET["agent_extended_alt_dial"])) {$agent_extended_alt_dial=$_GET["agent_extended_alt_dial"];} + elseif (isset($_POST["agent_extended_alt_dial"])) {$agent_extended_alt_dial=$_POST["agent_extended_alt_dial"];} +if (isset($_GET["play_place_in_line"])) {$play_place_in_line=$_GET["play_place_in_line"];} + elseif (isset($_POST["play_place_in_line"])) {$play_place_in_line=$_POST["play_place_in_line"];} +if (isset($_GET["play_estimate_hold_time"])) {$play_estimate_hold_time=$_GET["play_estimate_hold_time"];} + elseif (isset($_POST["play_estimate_hold_time"])) {$play_estimate_hold_time=$_POST["play_estimate_hold_time"];} +if (isset($_GET["hold_time_option"])) {$hold_time_option=$_GET["hold_time_option"];} + elseif (isset($_POST["hold_time_option"])) {$hold_time_option=$_POST["hold_time_option"];} +if (isset($_GET["hold_time_option_seconds"])) {$hold_time_option_seconds=$_GET["hold_time_option_seconds"];} + elseif (isset($_POST["hold_time_option_seconds"])) {$hold_time_option_seconds=$_POST["hold_time_option_seconds"];} +if (isset($_GET["hold_time_option_exten"])) {$hold_time_option_exten=$_GET["hold_time_option_exten"];} + elseif (isset($_POST["hold_time_option_exten"])) {$hold_time_option_exten=$_POST["hold_time_option_exten"];} +if (isset($_GET["hold_time_option_voicemail"])) {$hold_time_option_voicemail=$_GET["hold_time_option_voicemail"];} + elseif (isset($_POST["hold_time_option_voicemail"])) {$hold_time_option_voicemail=$_POST["hold_time_option_voicemail"];} +if (isset($_GET["hold_time_option_xfer_group"])) {$hold_time_option_xfer_group=$_GET["hold_time_option_xfer_group"];} + elseif (isset($_POST["hold_time_option_xfer_group"])) {$hold_time_option_xfer_group=$_POST["hold_time_option_xfer_group"];} +if (isset($_GET["hold_time_option_callback_filename"])) {$hold_time_option_callback_filename=$_GET["hold_time_option_callback_filename"];} + elseif (isset($_POST["hold_time_option_callback_filename"])) {$hold_time_option_callback_filename=$_POST["hold_time_option_callback_filename"];} +if (isset($_GET["hold_time_option_callback_list_id"])) {$hold_time_option_callback_list_id=$_GET["hold_time_option_callback_list_id"];} + elseif (isset($_POST["hold_time_option_callback_list_id"])) {$hold_time_option_callback_list_id=$_POST["hold_time_option_callback_list_id"];} +if (isset($_GET["hold_recall_xfer_group"])) {$hold_recall_xfer_group=$_GET["hold_recall_xfer_group"];} + elseif (isset($_POST["hold_recall_xfer_group"])) {$hold_recall_xfer_group=$_POST["hold_recall_xfer_group"];} +if (isset($_GET["no_delay_call_route"])) {$no_delay_call_route=$_GET["no_delay_call_route"];} + elseif (isset($_POST["no_delay_call_route"])) {$no_delay_call_route=$_POST["no_delay_call_route"];} +if (isset($_GET["play_welcome_message"])) {$play_welcome_message=$_GET["play_welcome_message"];} + elseif (isset($_POST["play_welcome_message"])) {$play_welcome_message=$_POST["play_welcome_message"];} +if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} + elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} +if (isset($_GET["source_did"])) {$source_did=$_GET["source_did"];} + elseif (isset($_POST["source_did"])) {$source_did=$_POST["source_did"];} +if (isset($_GET["did_pattern"])) {$did_pattern=$_GET["did_pattern"];} + elseif (isset($_POST["did_pattern"])) {$did_pattern=$_POST["did_pattern"];} +if (isset($_GET["did_description"])) {$did_description=$_GET["did_description"];} + elseif (isset($_POST["did_description"])) {$did_description=$_POST["did_description"];} +if (isset($_GET["did_active"])) {$did_active=$_GET["did_active"];} + elseif (isset($_POST["did_active"])) {$did_active=$_POST["did_active"];} +if (isset($_GET["did_route"])) {$did_route=$_GET["did_route"];} + elseif (isset($_POST["did_route"])) {$did_route=$_POST["did_route"];} +if (isset($_GET["exten_context"])) {$exten_context=$_GET["exten_context"];} + elseif (isset($_POST["exten_context"])) {$exten_context=$_POST["exten_context"];} +if (isset($_GET["phone"])) {$phone=$_GET["phone"];} + elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} +if (isset($_GET["user_unavailable_action"])) {$user_unavailable_action=$_GET["user_unavailable_action"];} + elseif (isset($_POST["user_unavailable_action"])) {$user_unavailable_action=$_POST["user_unavailable_action"];} +if (isset($_GET["user_route_settings_ingroup"])) {$user_route_settings_ingroup=$_GET["user_route_settings_ingroup"];} + elseif (isset($_POST["user_route_settings_ingroup"])) {$user_route_settings_ingroup=$_POST["user_route_settings_ingroup"];} +if (isset($_GET["call_handle_method"])) {$call_handle_method=$_GET["call_handle_method"];} + elseif (isset($_POST["call_handle_method"])) {$call_handle_method=$_POST["call_handle_method"];} +if (isset($_GET["agent_search_method"])) {$agent_search_method=$_GET["agent_search_method"];} + elseif (isset($_POST["agent_search_method"])) {$agent_search_method=$_POST["agent_search_method"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["email"];} +if (isset($_GET["modify_inbound_dids"])) {$modify_inbound_dids=$_GET["modify_inbound_dids"];} + elseif (isset($_POST["modify_inbound_dids"])) {$modify_inbound_dids=$_POST["modify_inbound_dids"];} +if (isset($_GET["delete_inbound_dids"])) {$delete_inbound_dids=$_GET["delete_inbound_dids"];} + elseif (isset($_POST["delete_inbound_dids"])) {$delete_inbound_dids=$_POST["delete_inbound_dids"];} +if (isset($_GET["three_way_call_cid"])) {$three_way_call_cid=$_GET["three_way_call_cid"];} + elseif (isset($_POST["three_way_call_cid"])) {$three_way_call_cid=$_POST["three_way_call_cid"];} +if (isset($_GET["three_way_dial_prefix"])) {$three_way_dial_prefix=$_GET["three_way_dial_prefix"];} + elseif (isset($_POST["three_way_dial_prefix"])) {$three_way_dial_prefix=$_POST["three_way_dial_prefix"];} +if (isset($_GET["forced_timeclock_login"])) {$forced_timeclock_login=$_GET["forced_timeclock_login"];} + elseif (isset($_POST["forced_timeclock_login"])) {$forced_timeclock_login=$_POST["forced_timeclock_login"];} +if (isset($_GET["answer_sec_pct_rt_stat_one"])) {$answer_sec_pct_rt_stat_one=$_GET["answer_sec_pct_rt_stat_one"];} + elseif (isset($_POST["answer_sec_pct_rt_stat_one"])) {$answer_sec_pct_rt_stat_one=$_POST["answer_sec_pct_rt_stat_one"];} +if (isset($_GET["answer_sec_pct_rt_stat_two"])) {$answer_sec_pct_rt_stat_two=$_GET["answer_sec_pct_rt_stat_two"];} + elseif (isset($_POST["answer_sec_pct_rt_stat_two"])) {$answer_sec_pct_rt_stat_two=$_POST["answer_sec_pct_rt_stat_two"];} +if (isset($_GET["list_active_change"])) {$list_active_change=$_GET["list_active_change"];} + elseif (isset($_POST["list_active_change"])) {$list_active_change=$_POST["list_active_change"];} +if (isset($_GET["web_form_target"])) {$web_form_target=$_GET["web_form_target"];} + elseif (isset($_POST["web_form_target"])) {$web_form_target=$_POST["web_form_target"];} +if (isset($_GET["alt_server_ip"])) {$alt_server_ip=$_GET["alt_server_ip"];} + elseif (isset($_POST["alt_server_ip"])) {$alt_server_ip=$_POST["alt_server_ip"];} +if (isset($_GET["recording_web_link"])) {$recording_web_link=$_GET["recording_web_link"];} + elseif (isset($_POST["recording_web_link"])) {$recording_web_link=$_POST["recording_web_link"];} +if (isset($_GET["enable_vtiger_integration"])) {$enable_vtiger_integration=$_GET["enable_vtiger_integration"];} + elseif (isset($_POST["enable_vtiger_integration"])) {$enable_vtiger_integration=$_POST["enable_vtiger_integration"];} +if (isset($_GET["vtiger_server_ip"])) {$vtiger_server_ip=$_GET["vtiger_server_ip"];} + elseif (isset($_POST["vtiger_server_ip"])) {$vtiger_server_ip=$_POST["vtiger_server_ip"];} +if (isset($_GET["vtiger_dbname"])) {$vtiger_dbname=$_GET["vtiger_dbname"];} + elseif (isset($_POST["vtiger_dbname"])) {$vtiger_dbname=$_POST["vtiger_dbname"];} +if (isset($_GET["vtiger_login"])) {$vtiger_login=$_GET["vtiger_login"];} + elseif (isset($_POST["vtiger_login"])) {$vtiger_login=$_POST["vtiger_login"];} +if (isset($_GET["vtiger_pass"])) {$vtiger_pass=$_GET["vtiger_pass"];} + elseif (isset($_POST["vtiger_pass"])) {$vtiger_pass=$_POST["vtiger_pass"];} +if (isset($_GET["vtiger_url"])) {$vtiger_url=$_GET["vtiger_url"];} + elseif (isset($_POST["vtiger_url"])) {$vtiger_url=$_POST["vtiger_url"];} +if (isset($_GET["vtiger_search_category"])) {$vtiger_search_category=$_GET["vtiger_search_category"];} + elseif (isset($_POST["vtiger_search_category"])) {$vtiger_search_category=$_POST["vtiger_search_category"];} +if (isset($_GET["vtiger_create_call_record"])) {$vtiger_create_call_record=$_GET["vtiger_create_call_record"];} + elseif (isset($_POST["vtiger_create_call_record"])) {$vtiger_create_call_record=$_POST["vtiger_create_call_record"];} +if (isset($_GET["vtiger_create_lead_record"])) {$vtiger_create_lead_record=$_GET["vtiger_create_lead_record"];} + elseif (isset($_POST["vtiger_create_lead_record"])) {$vtiger_create_lead_record=$_POST["vtiger_create_lead_record"];} +if (isset($_GET["vtiger_screen_login"])) {$vtiger_screen_login=$_GET["vtiger_screen_login"];} + elseif (isset($_POST["vtiger_screen_login"])) {$vtiger_screen_login=$_POST["vtiger_screen_login"];} +if (isset($_GET["qc_features_active"])) {$qc_features_active=$_GET["qc_features_active"];} + elseif (isset($_POST["qc_features_active"])) {$qc_features_active=$_POST["qc_features_active"];} +if (isset($_GET["outbound_autodial_active"])) {$outbound_autodial_active=$_GET["outbound_autodial_active"];} + elseif (isset($_POST["outbound_autodial_active"])) {$outbound_autodial_active=$_POST["outbound_autodial_active"];} +if (isset($_GET["cpd_amd_action"])) {$cpd_amd_action=$_GET["cpd_amd_action"];} + elseif (isset($_POST["cpd_amd_action"])) {$cpd_amd_action=$_POST["cpd_amd_action"];} +if (isset($_GET["download_lists"])) {$download_lists=$_GET["download_lists"];} + elseif (isset($_POST["download_lists"])) {$download_lists=$_POST["download_lists"];} +if (isset($_GET["active_asterisk_server"])) {$active_asterisk_server=$_GET["active_asterisk_server"];} + elseif (isset($_POST["active_asterisk_server"])) {$active_asterisk_server=$_POST["active_asterisk_server"];} +if (isset($_GET["generate_vicidial_conf"])) {$generate_vicidial_conf=$_GET["generate_vicidial_conf"];} + elseif (isset($_POST["generate_vicidial_conf"])) {$generate_vicidial_conf=$_POST["generate_vicidial_conf"];} +if (isset($_GET["rebuild_conf_files"])) {$rebuild_conf_files=$_GET["rebuild_conf_files"];} + elseif (isset($_POST["rebuild_conf_files"])) {$rebuild_conf_files=$_POST["rebuild_conf_files"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["conf_override"])) {$conf_override=$_GET["conf_override"];} + elseif (isset($_POST["conf_override"])) {$conf_override=$_POST["conf_override"];} +if (isset($_GET["template_name"])) {$template_name=$_GET["template_name"];} + elseif (isset($_POST["template_name"])) {$template_name=$_POST["template_name"];} +if (isset($_GET["template_contents"])) {$template_contents=$_GET["template_contents"];} + elseif (isset($_POST["template_contents"])) {$template_contents=$_POST["template_contents"];} +if (isset($_GET["carrier_id"])) {$carrier_id=$_GET["carrier_id"];} + elseif (isset($_POST["carrier_id"])) {$carrier_id=$_POST["carrier_id"];} +if (isset($_GET["carrier_name"])) {$carrier_name=$_GET["carrier_name"];} + elseif (isset($_POST["carrier_name"])) {$carrier_name=$_POST["carrier_name"];} +if (isset($_GET["registration_string"])) {$registration_string=$_GET["registration_string"];} + elseif (isset($_POST["registration_string"])) {$registration_string=$_POST["registration_string"];} +if (isset($_GET["account_entry"])) {$account_entry=$_GET["account_entry"];} + elseif (isset($_POST["account_entry"])) {$account_entry=$_POST["account_entry"];} +if (isset($_GET["globals_string"])) {$globals_string=$_GET["globals_string"];} + elseif (isset($_POST["globals_string"])) {$globals_string=$_POST["globals_string"];} +if (isset($_GET["dialplan_entry"])) {$dialplan_entry=$_GET["dialplan_entry"];} + elseif (isset($_POST["dialplan_entry"])) {$dialplan_entry=$_POST["dialplan_entry"];} +if (isset($_GET["group_alias_id"])) {$group_alias_id=$_GET["group_alias_id"];} + elseif (isset($_POST["group_alias_id"])) {$group_alias_id=$_POST["group_alias_id"];} +if (isset($_GET["group_alias_name"])) {$group_alias_name=$_GET["group_alias_name"];} + elseif (isset($_POST["group_alias_name"])) {$group_alias_name=$_POST["group_alias_name"];} +if (isset($_GET["caller_id_number"])) {$caller_id_number=$_GET["caller_id_number"];} + elseif (isset($_POST["caller_id_number"])) {$caller_id_number=$_POST["caller_id_number"];} +if (isset($_GET["caller_id_name"])) {$caller_id_name=$_GET["caller_id_name"];} + elseif (isset($_POST["caller_id_name"])) {$caller_id_name=$_POST["caller_id_name"];} +if (isset($_GET["agent_allow_group_alias"])) {$agent_allow_group_alias=$_GET["agent_allow_group_alias"];} + elseif (isset($_POST["agent_allow_group_alias"])) {$agent_allow_group_alias=$_POST["agent_allow_group_alias"];} +if (isset($_GET["default_group_alias"])) {$default_group_alias=$_GET["default_group_alias"];} + elseif (isset($_POST["default_group_alias"])) {$default_group_alias=$_POST["default_group_alias"];} +if (isset($_GET["outbound_calls_per_second"])) {$outbound_calls_per_second=$_GET["outbound_calls_per_second"];} + elseif (isset($_POST["outbound_calls_per_second"])) {$outbound_calls_per_second=$_POST["outbound_calls_per_second"];} +if (isset($_GET["shift_enforcement"])) {$shift_enforcement=$_GET["shift_enforcement"];} + elseif (isset($_POST["shift_enforcement"])) {$shift_enforcement=$_POST["shift_enforcement"];} +if (isset($_GET["agent_shift_enforcement_override"])) {$agent_shift_enforcement_override=$_GET["agent_shift_enforcement_override"];} + elseif (isset($_POST["agent_shift_enforcement_override"])) {$agent_shift_enforcement_override=$_POST["agent_shift_enforcement_override"];} +if (isset($_GET["manager_shift_enforcement_override"])) {$manager_shift_enforcement_override=$_GET["manager_shift_enforcement_override"];} + elseif (isset($_POST["manager_shift_enforcement_override"])) {$manager_shift_enforcement_override=$_POST["manager_shift_enforcement_override"];} +if (isset($_GET["export_reports"])) {$export_reports=$_GET["export_reports"];} + elseif (isset($_POST["export_reports"])) {$export_reports=$_POST["export_reports"];} +if (isset($_GET["delete_from_dnc"])) {$delete_from_dnc=$_GET["delete_from_dnc"];} + elseif (isset($_POST["delete_from_dnc"])) {$delete_from_dnc=$_POST["delete_from_dnc"];} +if (isset($_GET["vtiger_search_dead"])) {$vtiger_search_dead=$_GET["vtiger_search_dead"];} + elseif (isset($_POST["vtiger_search_dead"])) {$vtiger_search_dead=$_POST["vtiger_search_dead"];} +if (isset($_GET["vtiger_status_call"])) {$vtiger_status_call=$_GET["vtiger_status_call"];} + elseif (isset($_POST["vtiger_status_call"])) {$vtiger_status_call=$_POST["vtiger_status_call"];} +if (isset($_GET["sale"])) {$sale=$_GET["sale"];} + elseif (isset($_POST["sale"])) {$sale=$_POST["sale"];} +if (isset($_GET["dnc"])) {$dnc=$_GET["dnc"];} + elseif (isset($_POST["dnc"])) {$dnc=$_POST["dnc"];} +if (isset($_GET["customer_contact"])) {$customer_contact=$_GET["customer_contact"];} + elseif (isset($_POST["customer_contact"])) {$customer_contact=$_POST["customer_contact"];} +if (isset($_GET["not_interested"])) {$not_interested=$_GET["not_interested"];} + elseif (isset($_POST["not_interested"])) {$not_interested=$_POST["not_interested"];} +if (isset($_GET["unworkable"])) {$unworkable=$_GET["unworkable"];} + elseif (isset($_POST["unworkable"])) {$unworkable=$_POST["unworkable"];} +if (isset($_GET["user_code"])) {$user_code=$_GET["user_code"];} + elseif (isset($_POST["user_code"])) {$user_code=$_POST["user_code"];} +if (isset($_GET["territory"])) {$territory=$_GET["territory"];} + elseif (isset($_POST["territory"])) {$territory=$_POST["territory"];} +if (isset($_GET["survey_third_digit"])) {$survey_third_digit=$_GET["survey_third_digit"];} + elseif (isset($_POST["survey_third_digit"])) {$survey_third_digit=$_POST["survey_third_digit"];} +if (isset($_GET["survey_fourth_digit"])) {$survey_fourth_digit=$_GET["survey_fourth_digit"];} + elseif (isset($_POST["survey_fourth_digit"])) {$survey_fourth_digit=$_POST["survey_fourth_digit"];} +if (isset($_GET["survey_third_audio_file"])) {$survey_third_audio_file=$_GET["survey_third_audio_file"];} + elseif (isset($_POST["survey_third_audio_file"])) {$survey_third_audio_file=$_POST["survey_third_audio_file"];} +if (isset($_GET["survey_fourth_audio_file"])) {$survey_fourth_audio_file=$_GET["survey_fourth_audio_file"];} + elseif (isset($_POST["survey_fourth_audio_file"])) {$survey_fourth_audio_file=$_POST["survey_fourth_audio_file"];} +if (isset($_GET["survey_third_status"])) {$survey_third_status=$_GET["survey_third_status"];} + elseif (isset($_POST["survey_third_status"])) {$survey_third_status=$_POST["survey_third_status"];} +if (isset($_GET["survey_fourth_status"])) {$survey_fourth_status=$_GET["survey_fourth_status"];} + elseif (isset($_POST["survey_fourth_status"])) {$survey_fourth_status=$_POST["survey_fourth_status"];} +if (isset($_GET["survey_third_exten"])) {$survey_third_exten=$_GET["survey_third_exten"];} + elseif (isset($_POST["survey_third_exten"])) {$survey_third_exten=$_POST["survey_third_exten"];} +if (isset($_GET["survey_fourth_exten"])) {$survey_fourth_exten=$_GET["survey_fourth_exten"];} + elseif (isset($_POST["survey_fourth_exten"])) {$survey_fourth_exten=$_POST["survey_fourth_exten"];} +if (isset($_GET["menu_id"])) {$menu_id=$_GET["menu_id"];} + elseif (isset($_POST["menu_id"])) {$menu_id=$_POST["menu_id"];} +if (isset($_GET["menu_name"])) {$menu_name=$_GET["menu_name"];} + elseif (isset($_POST["menu_name"])) {$menu_name=$_POST["menu_name"];} +if (isset($_GET["menu_prompt"])) {$menu_prompt=$_GET["menu_prompt"];} + elseif (isset($_POST["menu_prompt"])) {$menu_prompt=$_POST["menu_prompt"];} +if (isset($_GET["menu_timeout"])) {$menu_timeout=$_GET["menu_timeout"];} + elseif (isset($_POST["menu_timeout"])) {$menu_timeout=$_POST["menu_timeout"];} +if (isset($_GET["menu_timeout_prompt"])) {$menu_timeout_prompt=$_GET["menu_timeout_prompt"];} + elseif (isset($_POST["menu_timeout_prompt"])) {$menu_timeout_prompt=$_POST["menu_timeout_prompt"];} +if (isset($_GET["menu_invalid_prompt"])) {$menu_invalid_prompt=$_GET["menu_invalid_prompt"];} + elseif (isset($_POST["menu_invalid_prompt"])) {$menu_invalid_prompt=$_POST["menu_invalid_prompt"];} +if (isset($_GET["menu_repeat"])) {$menu_repeat=$_GET["menu_repeat"];} + elseif (isset($_POST["menu_repeat"])) {$menu_repeat=$_POST["menu_repeat"];} +if (isset($_GET["menu_time_check"])) {$menu_time_check=$_GET["menu_time_check"];} + elseif (isset($_POST["menu_time_check"])) {$menu_time_check=$_POST["menu_time_check"];} +if (isset($_GET["track_in_vdac"])) {$track_in_vdac=$_GET["track_in_vdac"];} + elseif (isset($_POST["track_in_vdac"])) {$track_in_vdac=$_POST["track_in_vdac"];} +if (isset($_GET["source_menu"])) {$source_menu=$_GET["source_menu"];} + elseif (isset($_POST["source_menu"])) {$source_menu=$_POST["source_menu"];} +if (isset($_GET["agentonly_callback_campaign_lock"])) {$agentonly_callback_campaign_lock=$_GET["agentonly_callback_campaign_lock"];} + elseif (isset($_POST["agentonly_callback_campaign_lock"])) {$agentonly_callback_campaign_lock=$_POST["agentonly_callback_campaign_lock"];} +if (isset($_GET["sounds_central_control_active"])) {$sounds_central_control_active=$_GET["sounds_central_control_active"];} + elseif (isset($_POST["sounds_central_control_active"])) {$sounds_central_control_active=$_POST["sounds_central_control_active"];} +if (isset($_GET["sounds_web_server"])) {$sounds_web_server=$_GET["sounds_web_server"];} + elseif (isset($_POST["sounds_web_server"])) {$sounds_web_server=$_POST["sounds_web_server"];} +if (isset($_GET["sounds_web_directory"])) {$sounds_web_directory=$_GET["sounds_web_directory"];} + elseif (isset($_POST["sounds_web_directory"])) {$sounds_web_directory=$_POST["sounds_web_directory"];} +if (isset($_GET["sounds_update"])) {$sounds_update=$_GET["sounds_update"];} + elseif (isset($_POST["sounds_update"])) {$sounds_update=$_POST["sounds_update"];} +if (isset($_GET["active_voicemail_server"])) {$active_voicemail_server=$_GET["active_voicemail_server"];} + elseif (isset($_POST["active_voicemail_server"])) {$active_voicemail_server=$_POST["active_voicemail_server"];} +if (isset($_GET["auto_dial_limit"])) {$auto_dial_limit=$_GET["auto_dial_limit"];} + elseif (isset($_POST["auto_dial_limit"])) {$auto_dial_limit=$_POST["auto_dial_limit"];} +if (isset($_GET["user_territories_active"])) {$user_territories_active=$_GET["user_territories_active"];} + elseif (isset($_POST["user_territories_active"])) {$user_territories_active=$_POST["user_territories_active"];} +if (isset($_GET["vicidial_recording_limit"])) {$vicidial_recording_limit=$_GET["vicidial_recording_limit"];} + elseif (isset($_POST["vicidial_recording_limit"])) {$vicidial_recording_limit=$_POST["vicidial_recording_limit"];} +if (isset($_GET["phone_context"])) {$phone_context=$_GET["phone_context"];} + elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];} +if (isset($_GET["carrier_logging_active"])) {$carrier_logging_active=$_GET["carrier_logging_active"];} + elseif (isset($_POST["carrier_logging_active"])) {$carrier_logging_active=$_POST["carrier_logging_active"];} +if (isset($_GET["drop_lockout_time"])) {$drop_lockout_time=$_GET["drop_lockout_time"];} + elseif (isset($_POST["drop_lockout_time"])) {$drop_lockout_time=$_POST["drop_lockout_time"];} +if (isset($_GET["allow_custom_dialplan"])) {$allow_custom_dialplan=$_GET["allow_custom_dialplan"];} + elseif (isset($_POST["allow_custom_dialplan"])) {$allow_custom_dialplan=$_POST["allow_custom_dialplan"];} +if (isset($_GET["custom_dialplan_entry"])) {$custom_dialplan_entry=$_GET["custom_dialplan_entry"];} + elseif (isset($_POST["custom_dialplan_entry"])) {$custom_dialplan_entry=$_POST["custom_dialplan_entry"];} +if (isset($_GET["phone_ring_timeout"])) {$phone_ring_timeout=$_GET["phone_ring_timeout"];} + elseif (isset($_POST["phone_ring_timeout"])) {$phone_ring_timeout=$_POST["phone_ring_timeout"];} +if (isset($_GET["conf_secret"])) {$conf_secret=$_GET["conf_secret"];} + elseif (isset($_POST["conf_secret"])) {$conf_secret=$_POST["conf_secret"];} +if (isset($_GET["tracking_group"])) {$tracking_group=$_GET["tracking_group"];} + elseif (isset($_POST["tracking_group"])) {$tracking_group=$_POST["tracking_group"];} +if (isset($_GET["no_agent_no_queue"])) {$no_agent_no_queue=$_GET["no_agent_no_queue"];} + elseif (isset($_POST["no_agent_no_queue"])) {$no_agent_no_queue=$_POST["no_agent_no_queue"];} +if (isset($_GET["no_agent_action"])) {$no_agent_action=$_GET["no_agent_action"];} + elseif (isset($_POST["no_agent_action"])) {$no_agent_action=$_POST["no_agent_action"];} +if (isset($_GET["no_agent_action_value"])) {$no_agent_action_value=$_GET["no_agent_action_value"];} + elseif (isset($_POST["no_agent_action_value"])) {$no_agent_action_value=$_POST["no_agent_action_value"];} +if (isset($_GET["quick_transfer_button"])) {$quick_transfer_button=$_GET["quick_transfer_button"];} + elseif (isset($_POST["quick_transfer_button"])) {$quick_transfer_button=$_POST["quick_transfer_button"];} +if (isset($_GET["prepopulate_transfer_preset"])) {$prepopulate_transfer_preset=$_GET["prepopulate_transfer_preset"];} + elseif (isset($_POST["prepopulate_transfer_preset"])) {$prepopulate_transfer_preset=$_POST["prepopulate_transfer_preset"];} +if (isset($_GET["enable_tts_integration"])) {$enable_tts_integration=$_GET["enable_tts_integration"];} + elseif (isset($_POST["enable_tts_integration"])) {$enable_tts_integration=$_POST["enable_tts_integration"];} +if (isset($_GET["tts_id"])) {$tts_id=$_GET["tts_id"];} + elseif (isset($_POST["tts_id"])) {$tts_id=$_POST["tts_id"];} +if (isset($_GET["tts_name"])) {$tts_name=$_GET["tts_name"];} + elseif (isset($_POST["tts_name"])) {$tts_name=$_POST["tts_name"];} +if (isset($_GET["tts_text"])) {$tts_text=$_GET["tts_text"];} + elseif (isset($_POST["tts_text"])) {$tts_text=$_POST["tts_text"];} +if (isset($_GET["drop_rate_group"])) {$drop_rate_group=$_GET["drop_rate_group"];} + elseif (isset($_POST["drop_rate_group"])) {$drop_rate_group=$_POST["drop_rate_group"];} +if (isset($_GET["agent_status_viewable_groups"])) {$agent_status_viewable_groups=$_GET["agent_status_viewable_groups"];} + elseif (isset($_POST["agent_status_viewable_groups"])) {$agent_status_viewable_groups=$_POST["agent_status_viewable_groups"];} +if (isset($_GET["agent_status_view_time"])) {$agent_status_view_time=$_GET["agent_status_view_time"];} + elseif (isset($_POST["agent_status_view_time"])) {$agent_status_view_time=$_POST["agent_status_view_time"];} +if (isset($_GET["view_calls_in_queue"])) {$view_calls_in_queue=$_GET["view_calls_in_queue"];} + elseif (isset($_POST["view_calls_in_queue"])) {$view_calls_in_queue=$_POST["view_calls_in_queue"];} +if (isset($_GET["view_calls_in_queue_launch"])) {$view_calls_in_queue_launch=$_GET["view_calls_in_queue_launch"];} + elseif (isset($_POST["view_calls_in_queue_launch"])) {$view_calls_in_queue_launch=$_POST["view_calls_in_queue_launch"];} +if (isset($_GET["grab_calls_in_queue"])) {$grab_calls_in_queue=$_GET["grab_calls_in_queue"];} + elseif (isset($_POST["grab_calls_in_queue"])) {$grab_calls_in_queue=$_POST["grab_calls_in_queue"];} +if (isset($_GET["call_requeue_button"])) {$call_requeue_button=$_GET["call_requeue_button"];} + elseif (isset($_POST["call_requeue_button"])) {$call_requeue_button=$_POST["call_requeue_button"];} +if (isset($_GET["pause_after_each_call"])) {$pause_after_each_call=$_GET["pause_after_each_call"];} + elseif (isset($_POST["pause_after_each_call"])) {$pause_after_each_call=$_POST["pause_after_each_call"];} +if (isset($_GET["no_hopper_dialing"])) {$no_hopper_dialing=$_GET["no_hopper_dialing"];} + elseif (isset($_POST["no_hopper_dialing"])) {$no_hopper_dialing=$_POST["no_hopper_dialing"];} +if (isset($_GET["agent_dial_owner_only"])) {$agent_dial_owner_only=$_GET["agent_dial_owner_only"];} + elseif (isset($_POST["agent_dial_owner_only"])) {$agent_dial_owner_only=$_POST["agent_dial_owner_only"];} +if (isset($_GET["reset_time"])) {$reset_time=$_GET["reset_time"];} + elseif (isset($_POST["reset_time"])) {$reset_time=$_POST["reset_time"];} +if (isset($_GET["allow_alerts"])) {$allow_alerts=$_GET["allow_alerts"];} + elseif (isset($_POST["allow_alerts"])) {$allow_alerts=$_POST["allow_alerts"];} +if (isset($_GET["agent_display_dialable_leads"])) {$agent_display_dialable_leads=$_GET["agent_display_dialable_leads"];} + elseif (isset($_POST["agent_display_dialable_leads"])) {$agent_display_dialable_leads=$_POST["agent_display_dialable_leads"];} +if (isset($_GET["vicidial_balance_rank"])) {$vicidial_balance_rank=$_GET["vicidial_balance_rank"];} + elseif (isset($_POST["vicidial_balance_rank"])) {$vicidial_balance_rank=$_POST["vicidial_balance_rank"];} +if (isset($_GET["agent_script_override"])) {$agent_script_override=$_GET["agent_script_override"];} + elseif (isset($_POST["agent_script_override"])) {$agent_script_override=$_POST["agent_script_override"];} +if (isset($_GET["moh_id"])) {$moh_id=$_GET["moh_id"];} + elseif (isset($_POST["moh_id"])) {$moh_id=$_POST["moh_id"];} +if (isset($_GET["moh_name"])) {$moh_name=$_GET["moh_name"];} + elseif (isset($_POST["moh_name"])) {$moh_name=$_POST["moh_name"];} +if (isset($_GET["random"])) {$random=$_GET["random"];} + elseif (isset($_POST["random"])) {$random=$_POST["random"];} +if (isset($_GET["filename"])) {$filename=$_GET["filename"];} + elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} +if (isset($_GET["rank"])) {$rank=$_GET["rank"];} + elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];} +if (isset($_GET["rebuild_music_on_hold"])) {$rebuild_music_on_hold=$_GET["rebuild_music_on_hold"];} + elseif (isset($_POST["rebuild_music_on_hold"])) {$rebuild_music_on_hold=$_POST["rebuild_music_on_hold"];} +if (isset($_GET["active_agent_login_server"])) {$active_agent_login_server=$_GET["active_agent_login_server"];} + elseif (isset($_POST["active_agent_login_server"])) {$active_agent_login_server=$_POST["active_agent_login_server"];} +if (isset($_GET["enable_second_webform"])) {$enable_second_webform=$_GET["enable_second_webform"];} + elseif (isset($_POST["enable_second_webform"])) {$enable_second_webform=$_POST["enable_second_webform"];} +if (isset($_GET["web_form_address_two"])) {$web_form_address_two=$_GET["web_form_address_two"];} + elseif (isset($_POST["web_form_address_two"])) {$web_form_address_two=$_POST["web_form_address_two"];} +if (isset($_GET["waitforsilence_options"])) {$waitforsilence_options=$_GET["waitforsilence_options"];} + elseif (isset($_POST["waitforsilence_options"])) {$waitforsilence_options=$_POST["waitforsilence_options"];} +if (isset($_GET["campaign_cid_override"])) {$campaign_cid_override=$_GET["campaign_cid_override"];} + elseif (isset($_POST["campaign_cid_override"])) {$campaign_cid_override=$_POST["campaign_cid_override"];} +if (isset($_GET["am_message_exten_override"])) {$am_message_exten_override=$_GET["am_message_exten_override"];} + elseif (isset($_POST["am_message_exten_override"])) {$am_message_exten_override=$_POST["am_message_exten_override"];} +if (isset($_GET["drop_inbound_group_override"])) {$drop_inbound_group_override=$_GET["drop_inbound_group_override"];} + elseif (isset($_POST["drop_inbound_group_override"])) {$drop_inbound_group_override=$_POST["drop_inbound_group_override"];} +if (isset($_GET["agent_select_territories"])) {$agent_select_territories=$_GET["agent_select_territories"];} + elseif (isset($_POST["agent_select_territories"])) {$agent_select_territories=$_POST["agent_select_territories"];} +if (isset($_GET["agent_choose_territories"])) {$agent_choose_territories=$_GET["agent_choose_territories"];} + elseif (isset($_POST["agent_choose_territories"])) {$agent_choose_territories=$_POST["agent_choose_territories"];} +if (isset($_GET["carrier_description"])) {$carrier_description=$_GET["carrier_description"];} + elseif (isset($_POST["carrier_description"])) {$carrier_description=$_POST["carrier_description"];} +if (isset($_GET["delete_vm_after_email"])) {$delete_vm_after_email=$_GET["delete_vm_after_email"];} + elseif (isset($_POST["delete_vm_after_email"])) {$delete_vm_after_email=$_POST["delete_vm_after_email"];} +if (isset($_GET["custom_one"])) {$custom_one=$_GET["custom_one"];} + elseif (isset($_POST["custom_one"])) {$custom_one=$_POST["custom_one"];} +if (isset($_GET["custom_two"])) {$custom_two=$_GET["custom_two"];} + elseif (isset($_POST["custom_two"])) {$custom_two=$_POST["custom_two"];} +if (isset($_GET["custom_three"])) {$custom_three=$_GET["custom_three"];} + elseif (isset($_POST["custom_three"])) {$custom_three=$_POST["custom_three"];} +if (isset($_GET["custom_four"])) {$custom_four=$_GET["custom_four"];} + elseif (isset($_POST["custom_four"])) {$custom_four=$_POST["custom_four"];} +if (isset($_GET["custom_five"])) {$custom_five=$_GET["custom_five"];} + elseif (isset($_POST["custom_five"])) {$custom_five=$_POST["custom_five"];} +if (isset($_GET["crm_popup_login"])) {$crm_popup_login=$_GET["crm_popup_login"];} + elseif (isset($_POST["crm_popup_login"])) {$crm_popup_login=$_POST["crm_popup_login"];} +if (isset($_GET["crm_login_address"])) {$crm_login_address=$_GET["crm_login_address"];} + elseif (isset($_POST["crm_login_address"])) {$crm_login_address=$_POST["crm_login_address"];} +if (isset($_GET["timer_action"])) {$timer_action=$_GET["timer_action"];} + elseif (isset($_POST["timer_action"])) {$timer_action=$_POST["timer_action"];} +if (isset($_GET["timer_action_message"])) {$timer_action_message=$_GET["timer_action_message"];} + elseif (isset($_POST["timer_action_message"])) {$timer_action_message=$_POST["timer_action_message"];} +if (isset($_GET["timer_action_seconds"])) {$timer_action_seconds=$_GET["timer_action_seconds"];} + elseif (isset($_POST["timer_action_seconds"])) {$timer_action_seconds=$_POST["timer_action_seconds"];} +if (isset($_GET["start_call_url"])) {$start_call_url=$_GET["start_call_url"];} + elseif (isset($_POST["start_call_url"])) {$start_call_url=$_POST["start_call_url"];} +if (isset($_GET["dispo_call_url"])) {$dispo_call_url=$_GET["dispo_call_url"];} + elseif (isset($_POST["dispo_call_url"])) {$dispo_call_url=$_POST["dispo_call_url"];} +if (isset($_GET["xferconf_c_number"])) {$xferconf_c_number=$_GET["xferconf_c_number"];} + elseif (isset($_POST["xferconf_c_number"])) {$xferconf_c_number=$_POST["xferconf_c_number"];} +if (isset($_GET["xferconf_d_number"])) {$xferconf_d_number=$_GET["xferconf_d_number"];} + elseif (isset($_POST["xferconf_d_number"])) {$xferconf_d_number=$_POST["xferconf_d_number"];} +if (isset($_GET["xferconf_e_number"])) {$xferconf_e_number=$_GET["xferconf_e_number"];} + elseif (isset($_POST["xferconf_e_number"])) {$xferconf_e_number=$_POST["xferconf_e_number"];} + + if (isset($script_id)) {$script_id= strtoupper($script_id);} + if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} + +if (strlen($dial_status) > 0) + { + $ADD='28'; + $status = $dial_status; + } + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $SSenable_queuemetrics_logging = $row[1]; + $SSenable_vtiger_integration = $row[2]; + $SSqc_features_active = $row[3]; + $SSoutbound_autodial_active = $row[4]; + $SSsounds_central_control_active = $row[5]; + $SSenable_second_webform = $row[6]; + $SSuser_territories_active = $row[7]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +###################################################################################################### +###################################################################################################### +####### Form variable filtering for security and data integrity +###################################################################################################### +###################################################################################################### + +if ($non_latin < 1) + { + ### DIGITS ONLY ### + $adaptive_latest_server_time = ereg_replace("[^0-9]","",$adaptive_latest_server_time); + $admin_hangup_enabled = ereg_replace("[^0-9]","",$admin_hangup_enabled); + $admin_hijack_enabled = ereg_replace("[^0-9]","",$admin_hijack_enabled); + $admin_monitor_enabled = ereg_replace("[^0-9]","",$admin_monitor_enabled); + $AFLogging_enabled = ereg_replace("[^0-9]","",$AFLogging_enabled); + $agent_choose_ingroups = ereg_replace("[^0-9]","",$agent_choose_ingroups); + $agentcall_manual = ereg_replace("[^0-9]","",$agentcall_manual); + $agentonly_callbacks = ereg_replace("[^0-9]","",$agentonly_callbacks); + $AGI_call_logging_enabled = ereg_replace("[^0-9]","",$AGI_call_logging_enabled); + $allcalls_delay = ereg_replace("[^0-9]","",$allcalls_delay); + $alter_agent_interface_options = ereg_replace("[^0-9]","",$alter_agent_interface_options); + $answer_transfer_agent = ereg_replace("[^0-9]","",$answer_transfer_agent); + $ast_admin_access = ereg_replace("[^0-9]","",$ast_admin_access); + $ast_delete_phones = ereg_replace("[^0-9]","",$ast_delete_phones); + $attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); + $attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); + $auto_dial_next_number = ereg_replace("[^0-9]","",$auto_dial_next_number); + $balance_trunks_offlimits = ereg_replace("[^0-9]","",$balance_trunks_offlimits); + $call_parking_enabled = ereg_replace("[^0-9]","",$call_parking_enabled); + $CallerID_popup_enabled = ereg_replace("[^0-9]","",$CallerID_popup_enabled); + $campaign_detail = ereg_replace("[^0-9]","",$campaign_detail); + $campaign_rec_exten = ereg_replace("[^0-9]","",$campaign_rec_exten); + $campaign_vdad_exten = ereg_replace("[^0-9]","",$campaign_vdad_exten); + $change_agent_campaign = ereg_replace("[^0-9]","",$change_agent_campaign); + $closer_default_blended = ereg_replace("[^0-9]","",$closer_default_blended); + $conf_exten = ereg_replace("[^0-9]","",$conf_exten); + $conf_on_extension = ereg_replace("[^0-9]","",$conf_on_extension); + $conferencing_enabled = ereg_replace("[^0-9]","",$conferencing_enabled); + $ct_default_start = ereg_replace("[^0-9]","",$ct_default_start); + $ct_default_stop = ereg_replace("[^0-9]","",$ct_default_stop); + $ct_friday_start = ereg_replace("[^0-9]","",$ct_friday_start); + $ct_friday_stop = ereg_replace("[^0-9]","",$ct_friday_stop); + $ct_monday_start = ereg_replace("[^0-9]","",$ct_monday_start); + $ct_monday_stop = ereg_replace("[^0-9]","",$ct_monday_stop); + $ct_saturday_start = ereg_replace("[^0-9]","",$ct_saturday_start); + $ct_saturday_stop = ereg_replace("[^0-9]","",$ct_saturday_stop); + $ct_sunday_start = ereg_replace("[^0-9]","",$ct_sunday_start); + $ct_sunday_stop = ereg_replace("[^0-9]","",$ct_sunday_stop); + $ct_thursday_start = ereg_replace("[^0-9]","",$ct_thursday_start); + $ct_thursday_stop = ereg_replace("[^0-9]","",$ct_thursday_stop); + $ct_tuesday_start = ereg_replace("[^0-9]","",$ct_tuesday_start); + $ct_tuesday_stop = ereg_replace("[^0-9]","",$ct_tuesday_stop); + $ct_wednesday_start = ereg_replace("[^0-9]","",$ct_wednesday_start); + $ct_wednesday_stop = ereg_replace("[^0-9]","",$ct_wednesday_stop); + $DBX_port = ereg_replace("[^0-9]","",$DBX_port); + $DBY_port = ereg_replace("[^0-9]","",$DBY_port); + $dedicated_trunks = ereg_replace("[^0-9]","",$dedicated_trunks); + $delete_call_times = ereg_replace("[^0-9]","",$delete_call_times); + $delete_campaigns = ereg_replace("[^0-9]","",$delete_campaigns); + $delete_filters = ereg_replace("[^0-9]","",$delete_filters); + $delete_ingroups = ereg_replace("[^0-9]","",$delete_ingroups); + $delete_lists = ereg_replace("[^0-9]","",$delete_lists); + $delete_remote_agents = ereg_replace("[^0-9]","",$delete_remote_agents); + $delete_scripts = ereg_replace("[^0-9]","",$delete_scripts); + $delete_user_groups = ereg_replace("[^0-9]","",$delete_user_groups); + $delete_users = ereg_replace("[^0-9]","",$delete_users); + $dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); + $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); + $enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); + $enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); + $fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); + $hopper_level = ereg_replace("[^0-9]","",$hopper_level); + $hotkey = ereg_replace("[^0-9]","",$hotkey); + $hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); + $list_id = ereg_replace("[^0-9]","",$list_id); + $load_leads = ereg_replace("[^0-9]","",$load_leads); + $max_vicidial_trunks = ereg_replace("[^0-9]","",$max_vicidial_trunks); + $modify_call_times = ereg_replace("[^0-9]","",$modify_call_times); + $modify_users = ereg_replace("[^0-9]","",$modify_users); + $modify_campaigns = ereg_replace("[^0-9]","",$modify_campaigns); + $modify_lists = ereg_replace("[^0-9]","",$modify_lists); + $modify_scripts = ereg_replace("[^0-9]","",$modify_scripts); + $modify_filters = ereg_replace("[^0-9]","",$modify_filters); + $modify_ingroups = ereg_replace("[^0-9]","",$modify_ingroups); + $modify_usergroups = ereg_replace("[^0-9]","",$modify_usergroups); + $modify_remoteagents = ereg_replace("[^0-9]","",$modify_remoteagents); + $modify_servers = ereg_replace("[^0-9]","",$modify_servers); + $view_reports = ereg_replace("[^0-9]","",$view_reports); + $modify_leads = ereg_replace("[^0-9]","",$modify_leads); + $monitor_prefix = ereg_replace("[^0-9]","",$monitor_prefix); + $number_of_lines = ereg_replace("[^0-9]","",$number_of_lines); + $old_conf_exten = ereg_replace("[^0-9]","",$old_conf_exten); + $outbound_cid = ereg_replace("[^0-9]","",$outbound_cid); + $park_ext = ereg_replace("[^0-9]","",$park_ext); + $park_on_extension = ereg_replace("[^0-9]","",$park_on_extension); + $phone_number = ereg_replace("[^0-9]","",$phone_number); + $QUEUE_ACTION_enabled = ereg_replace("[^0-9]","",$QUEUE_ACTION_enabled); + $recording_exten = ereg_replace("[^0-9]","",$recording_exten); + $remote_agent_id = ereg_replace("[^0-9]","",$remote_agent_id); + $telnet_port = ereg_replace("[^0-9]","",$telnet_port); + $updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); + $user_level = ereg_replace("[^0-9]","",$user_level); + $user_start = ereg_replace("[^0-9]","",$user_start); + $user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); + $VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); + $VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); + $vicidial_recording = ereg_replace("[^0-9]","",$vicidial_recording); + $vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); + $voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); + $voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); + $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); + $voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); + $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); + $use_non_latin = ereg_replace("[^0-9]","",$use_non_latin); + $webroot_writable = ereg_replace("[^0-9]","",$webroot_writable); + $enable_queuemetrics_logging = ereg_replace("[^0-9]","",$enable_queuemetrics_logging); + $enable_sipsak_messages = ereg_replace("[^0-9]","",$enable_sipsak_messages); + $allow_sipsak_messages = ereg_replace("[^0-9]","",$allow_sipsak_messages); + $mix_container_item = ereg_replace("[^0-9]","",$mix_container_item); + $prompt_interval = ereg_replace("[^0-9]","",$prompt_interval); + $agent_alert_delay = ereg_replace("[^0-9]","",$agent_alert_delay); + $manual_dial_list_id = ereg_replace("[^0-9]","",$manual_dial_list_id); + $qc_user_level = ereg_replace("[^0-9]","",$qc_user_level); + $qc_pass = ereg_replace("[^0-9]","",$qc_pass); + $qc_finish = ereg_replace("[^0-9]","",$qc_finish); + $qc_commit = ereg_replace("[^0-9]","",$qc_commit); + $shift_start_time = ereg_replace("[^0-9]","",$shift_start_time); + $timeclock_end_of_day = ereg_replace("[^0-9]","",$timeclock_end_of_day); + $survey_xfer_exten = ereg_replace("[^0-9]","",$survey_xfer_exten); + $add_timeclock_log = ereg_replace("[^0-9]","",$add_timeclock_log); + $modify_timeclock_log = ereg_replace("[^0-9]","",$modify_timeclock_log); + $delete_timeclock_log = ereg_replace("[^0-9]","",$delete_timeclock_log); + $vdc_agent_api_access = ereg_replace("[^0-9]","",$vdc_agent_api_access); + $vdc_agent_api_active = ereg_replace("[^0-9]","",$vdc_agent_api_active); + $hold_time_option_seconds = ereg_replace("[^0-9]","",$hold_time_option_seconds); + $hold_time_option_callback_list_id = ereg_replace("[^0-9]","",$hold_time_option_callback_list_id); + $did_id = ereg_replace("[^0-9]","",$did_id); + $source_did = ereg_replace("[^0-9]","",$source_did); + $modify_inbound_dids = ereg_replace("[^0-9]","",$modify_inbound_dids); + $delete_inbound_dids = ereg_replace("[^0-9]","",$delete_inbound_dids); + $answer_sec_pct_rt_stat_one = ereg_replace("[^0-9]","",$answer_sec_pct_rt_stat_one); + $answer_sec_pct_rt_stat_two = ereg_replace("[^0-9]","",$answer_sec_pct_rt_stat_two); + $enable_vtiger_integration = ereg_replace("[^0-9]","",$enable_vtiger_integration); + $qc_features_active = ereg_replace("[^0-9]","",$qc_features_active); + $outbound_autodial_active = ereg_replace("[^0-9]","",$outbound_autodial_active); + $download_lists = ereg_replace("[^0-9]","",$download_lists); + $caller_id_number = ereg_replace("[^0-9]","",$caller_id_number); + $outbound_calls_per_second = ereg_replace("[^0-9]","",$outbound_calls_per_second); + $manager_shift_enforcement_override = ereg_replace("[^0-9]","",$manager_shift_enforcement_override); + $export_reports = ereg_replace("[^0-9]","",$export_reports); + $delete_from_dnc = ereg_replace("[^0-9]","",$delete_from_dnc); + $menu_timeout = ereg_replace("[^0-9]","",$menu_timeout); + $menu_time_check = ereg_replace("[^0-9]","",$menu_time_check); + $track_in_vdac = ereg_replace("[^0-9]","",$track_in_vdac); + $menu_repeat = ereg_replace("[^0-9]","",$menu_repeat); + $agentonly_callback_campaign_lock = ereg_replace("[^0-9]","",$agentonly_callback_campaign_lock); + $sounds_central_control_active = ereg_replace("[^0-9]","",$sounds_central_control_active); + $user_territories_active = ereg_replace("[^0-9]","",$user_territories_active); + $vicidial_recording_limit = ereg_replace("[^0-9]","",$vicidial_recording_limit); + $allow_custom_dialplan = ereg_replace("[^0-9]","",$allow_custom_dialplan); + $phone_ring_timeout = ereg_replace("[^0-9]","",$phone_ring_timeout); + $enable_tts_integration = ereg_replace("[^0-9]","",$enable_tts_integration); + $allow_alerts = ereg_replace("[^0-9]","",$allow_alerts); + $vicidial_balance_rank = ereg_replace("[^0-9]","",$vicidial_balance_rank); + $rank = ereg_replace("[^0-9]","",$rank); + $enable_second_webform = ereg_replace("[^0-9]","",$enable_second_webform); + $campaign_cid_override = ereg_replace("[^0-9]","",$campaign_cid_override); + $agent_choose_territories = ereg_replace("[^0-9]","",$agent_choose_territories); + $timer_action_seconds = ereg_replace("[^0-9]","",$timer_action_seconds); + + $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); + + ### DIGITS and COLONS + $shift_length = ereg_replace("[^\:0-9]","",$shift_length); + + ### DIGITS and HASHES and STARS + $survey_dtmf_digits = ereg_replace("[^\#\*0-9]","",$survey_dtmf_digits); + $survey_ni_digit = ereg_replace("[^\#\*0-9]","",$survey_ni_digit); + + ### DIGITS and DASHES + $group_rank = ereg_replace("[^-0-9]","",$group_rank); + $campaign_rank = ereg_replace("[^-0-9]","",$campaign_rank); + $queue_priority = ereg_replace("[^-0-9]","",$queue_priority); + + ### DIGITS and NEWLINES + $phone_numbers = ereg_replace("[^X\n0-9]","",$phone_numbers); + + ### Y or N ONLY ### + $allow_closers = ereg_replace("[^NY]","",$allow_closers); + $reset_hopper = ereg_replace("[^NY]","",$reset_hopper); + $amd_send_to_vmx = ereg_replace("[^NY]","",$amd_send_to_vmx); + $alt_number_dialing = ereg_replace("[^NY]","",$alt_number_dialing); + $selectable = ereg_replace("[^NY]","",$selectable); + $reset_list = ereg_replace("[^NY]","",$reset_list); + $fronter_display = ereg_replace("[^NY]","",$fronter_display); + $omit_phone_code = ereg_replace("[^NY]","",$omit_phone_code); + $available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tally); + $sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); + $vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active); + $vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); + $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); + $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); + $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); + $human_answered = ereg_replace("[^NY]","",$human_answered); + $tovdad_display = ereg_replace("[^NY]","",$tovdad_display); + $campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); + $display_queue_count = ereg_replace("[^NY]","",$display_queue_count); + $qc_show_recording = ereg_replace("[^NY]","",$qc_show_recording); + $sale_category = ereg_replace("[^NY]","",$sale_category); + $dead_lead_category = ereg_replace("[^NY]","",$dead_lead_category); + $agent_extended_alt_dial = ereg_replace("[^NY]","",$agent_extended_alt_dial); + $play_place_in_line = ereg_replace("[^NY]","",$play_place_in_line); + $play_estimate_hold_time = ereg_replace("[^NY]","",$play_estimate_hold_time); + $no_delay_call_route = ereg_replace("[^NY]","",$no_delay_call_route); + $did_active = ereg_replace("[^NY]","",$did_active); + $active_asterisk_server = ereg_replace("[^NY]","",$active_asterisk_server); + $generate_vicidial_conf = ereg_replace("[^NY]","",$generate_vicidial_conf); + $rebuild_conf_files = ereg_replace("[^NY]","",$rebuild_conf_files); + $agent_allow_group_alias = ereg_replace("[^NY]","",$agent_allow_group_alias); + $vtiger_status_call = ereg_replace("[^NY]","",$vtiger_status_call); + $sale = ereg_replace("[^NY]","",$sale); + $dnc = ereg_replace("[^NY]","",$dnc); + $customer_contact = ereg_replace("[^NY]","",$customer_contact); + $not_interested = ereg_replace("[^NY]","",$not_interested); + $unworkable = ereg_replace("[^NY]","",$unworkable); + $sounds_update = ereg_replace("[^NY]","",$sounds_update); + $carrier_logging_active = ereg_replace("[^NY]","",$carrier_logging_active); + $agent_status_view_time = ereg_replace("[^NY]","",$agent_status_view_time); + $no_hopper_dialing = ereg_replace("[^NY]","",$no_hopper_dialing); + $agent_display_dialable_leads = ereg_replace("[^NY]","",$agent_display_dialable_leads); + $random = ereg_replace("[^NY]","",$random); + $rebuild_music_on_hold = ereg_replace("[^NY]","",$rebuild_music_on_hold); + $active_agent_login_server = ereg_replace("[^NY]","",$active_agent_login_server); + $agent_select_territories = ereg_replace("[^NY]","",$agent_select_territories); + $delete_vm_after_email = ereg_replace("[^NY]","",$delete_vm_after_email); + $crm_popup_login = ereg_replace("[^NY]","",$crm_popup_login); + + $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); + $active = ereg_replace("[^0-9NY]","",$active); + + + ### ALPHA-NUMERIC ONLY ### + $script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id); + $agent_script_override = ereg_replace("[^0-9a-zA-Z]","",$agent_script_override); + $campaign_script = ereg_replace("[^0-9a-zA-Z]","",$campaign_script); + $submit = ereg_replace("[^0-9a-zA-Z]","",$submit); + $campaign_cid = ereg_replace("[^0-9a-zA-Z]","",$campaign_cid); + $get_call_launch = ereg_replace("[^0-9a-zA-Z]","",$get_call_launch); + $campaign_recording = ereg_replace("[^0-9a-zA-Z]","",$campaign_recording); + $ADD = ereg_replace("[^0-9a-zA-Z]","",$ADD); + $dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix); + $state_call_time_state = ereg_replace("[^0-9a-zA-Z]","",$state_call_time_state); + $scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); + $concurrent_transfers = ereg_replace("[^0-9a-zA-Z]","",$concurrent_transfers); + $billable = ereg_replace("[^0-9a-zA-Z]","",$billable); + $pause_code = ereg_replace("[^0-9a-zA-Z]","",$pause_code); + $vicidial_recording_override = ereg_replace("[^0-9a-zA-Z]","",$vicidial_recording_override); + $ingroup_recording_override = ereg_replace("[^0-9a-zA-Z]","",$ingroup_recording_override); + $queuemetrics_log_id = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_log_id); + $after_hours_exten = ereg_replace("[^0-9a-zA-Z]","",$after_hours_exten); + $after_hours_voicemail = ereg_replace("[^0-9a-zA-Z]","",$after_hours_voicemail); + $qc_script = ereg_replace("[^0-9a-zA-Z]","",$qc_script); + $code = ereg_replace("[^0-9a-zA-Z]","",$code); + $survey_no_response_action = ereg_replace("[^0-9a-zA-Z]","",$survey_no_response_action); + $survey_ni_status = ereg_replace("[^0-9a-zA-Z]","",$survey_ni_status); + $qc_get_record_launch = ereg_replace("[^0-9a-zA-Z]","",$qc_get_record_launch); + $agent_pause_codes_active = ereg_replace("[^0-9a-zA-Z]","",$agent_pause_codes_active); + $three_way_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$three_way_dial_prefix); + $shift_enforcement = ereg_replace("[^0-9a-zA-Z]","",$shift_enforcement); + $agent_shift_enforcement_override = ereg_replace("[^0-9a-zA-Z]","",$agent_shift_enforcement_override); + $survey_third_status = ereg_replace("[^0-9a-zA-Z]","",$survey_third_status); + $survey_fourth_status = ereg_replace("[^0-9a-zA-Z]","",$survey_fourth_status); + $sounds_web_directory = ereg_replace("[^0-9a-zA-Z]","",$sounds_web_directory); + $disable_alter_custphone = ereg_replace("[^0-9a-zA-Z]","",$disable_alter_custphone); + $view_calls_in_queue = ereg_replace("[^0-9a-zA-Z]","",$view_calls_in_queue); + $view_calls_in_queue_launch = ereg_replace("[^0-9a-zA-Z]","",$view_calls_in_queue_launch); + $grab_calls_in_queue = ereg_replace("[^0-9a-zA-Z]","",$grab_calls_in_queue); + $call_requeue_button = ereg_replace("[^0-9a-zA-Z]","",$call_requeue_button); + $pause_after_each_call = ereg_replace("[^0-9a-zA-Z]","",$pause_after_each_call); + $use_internal_dnc = ereg_replace("[^0-9a-zA-Z]","",$use_internal_dnc); + $use_campaign_dnc = ereg_replace("[^0-9a-zA-Z]","",$use_campaign_dnc); + $voicemail_id = ereg_replace("[^0-9a-zA-Z]","",$voicemail_id); + $status_id = ereg_replace("[^0-9a-zA-Z]","",$status_id); + + ### DIGITS and Dots + $server_ip = ereg_replace("[^\.0-9]","",$server_ip); + $auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); + $adaptive_maximum_level = ereg_replace("[^\.0-9]","",$adaptive_maximum_level); + $phone_ip = ereg_replace("[^\.0-9]","",$phone_ip); + $old_server_ip = ereg_replace("[^\.0-9]","",$old_server_ip); + $computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); + $queuemetrics_server_ip = ereg_replace("[^\.0-9]","",$queuemetrics_server_ip); + $vtiger_server_ip = ereg_replace("[^\.0-9]","",$vtiger_server_ip); + $active_voicemail_server = ereg_replace("[^\.0-9]","",$active_voicemail_server); + $auto_dial_limit = ereg_replace("[^\.0-9]","",$auto_dial_limit); + $adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage); + $drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time); + + ### ALPHA-NUMERIC and spaces and hash and star and comma + $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); + $xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_b_dtmf); + $xferconf_c_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_c_dtmf); + $xferconf_d_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_d_dtmf); + $xferconf_e_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_e_dtmf); + $survey_third_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_digit); + $survey_fourth_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_digit); + $survey_third_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_exten); + $survey_fourth_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_exten); + + ### ALPHACAPS-NUMERIC + $xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); + $xferconf_b_number = ereg_replace("[^0-9A-Z]","",$xferconf_b_number); + + ### ALPHA-NUMERIC and underscore and dash + $agi_output = ereg_replace("[^-_0-9a-zA-Z]","",$agi_output); + $ASTmgrSECRET = ereg_replace("[^-_0-9a-zA-Z]","",$ASTmgrSECRET); + $ASTmgrUSERNAME = ereg_replace("[^-_0-9a-zA-Z]","",$ASTmgrUSERNAME); + $ASTmgrUSERNAMElisten = ereg_replace("[^-_0-9a-zA-Z]","",$ASTmgrUSERNAMElisten); + $ASTmgrUSERNAMEsend = ereg_replace("[^-_0-9a-zA-Z]","",$ASTmgrUSERNAMEsend); + $ASTmgrUSERNAMEupdate = ereg_replace("[^-_0-9a-zA-Z]","",$ASTmgrUSERNAMEupdate); + $call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id); + $campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$campaign_id); + $CoNfIrM = ereg_replace("[^-_0-9a-zA-Z]","",$CoNfIrM); + $DBX_database = ereg_replace("[^-_0-9a-zA-Z]","",$DBX_database); + $DBX_pass = ereg_replace("[^-_0-9a-zA-Z]","",$DBX_pass); + $DBX_user = ereg_replace("[^-_0-9a-zA-Z]","",$DBX_user); + $DBY_database = ereg_replace("[^-_0-9a-zA-Z]","",$DBY_database); + $DBY_pass = ereg_replace("[^-_0-9a-zA-Z]","",$DBY_pass); + $DBY_user = ereg_replace("[^-_0-9a-zA-Z]","",$DBY_user); + $dial_method = ereg_replace("[^-_0-9a-zA-Z]","",$dial_method); + $dial_status_a = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status_a); + $dial_status_b = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status_b); + $dial_status_c = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status_c); + $dial_status_d = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status_d); + $dial_status_e = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status_e); + $ext_context = ereg_replace("[^-_0-9a-zA-Z]","",$ext_context); + $group_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_id); + $lead_filter_id = ereg_replace("[^-_0-9a-zA-Z]","",$lead_filter_id); + $local_call_time = ereg_replace("[^-_0-9a-zA-Z]","",$local_call_time); + $login = ereg_replace("[^-_0-9a-zA-Z]","",$login); + $login_campaign = ereg_replace("[^-_0-9a-zA-Z]","",$login_campaign); + $login_pass = ereg_replace("[^-_0-9a-zA-Z]","",$login_pass); + $login_user = ereg_replace("[^-_0-9a-zA-Z]","",$login_user); + $next_agent_call = ereg_replace("[^-_0-9a-zA-Z]","",$next_agent_call); + $old_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$old_campaign_id); + $old_server_id = ereg_replace("[^-_0-9a-zA-Z]","",$old_server_id); + $OLDuser_group = ereg_replace("[^-_0-9a-zA-Z]","",$OLDuser_group); + $park_file_name = ereg_replace("[^-_0-9a-zA-Z]","",$park_file_name); + $pass = ereg_replace("[^-_0-9a-zA-Z]","",$pass); + $phone_login = ereg_replace("[^-_0-9a-zA-Z]","",$phone_login); + $phone_pass = ereg_replace("[^-_0-9a-zA-Z]","",$phone_pass); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $protocol = ereg_replace("[^-_0-9a-zA-Z]","",$protocol); + $server_id = ereg_replace("[^-_0-9a-zA-Z]","",$server_id); + $stage = ereg_replace("[^-_0-9a-zA-Z]","",$stage); + $state_rule = ereg_replace("[^-_0-9a-zA-Z]","",$state_rule); + $trunk_restriction = ereg_replace("[^-_0-9a-zA-Z]","",$trunk_restriction); + $user = ereg_replace("[^-_0-9a-zA-Z]","",$user); + $user_group = ereg_replace("[^-_0-9a-zA-Z]","",$user_group); + $VICIDIAL_park_on_filename = ereg_replace("[^-_0-9a-zA-Z]","",$VICIDIAL_park_on_filename); + $auto_alt_dial = ereg_replace("[^-_0-9a-zA-Z]","",$auto_alt_dial); + $dial_status = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status); + $queuemetrics_eq_prepend = ereg_replace("[^-_0-9a-zA-Z]","",$queuemetrics_eq_prepend); + $vicidial_agent_disable = ereg_replace("[^-_0-9a-zA-Z]","",$vicidial_agent_disable); + $alter_custdata_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custdata_override); + $list_order_mix = ereg_replace("[^-_0-9a-zA-Z]","",$list_order_mix); + $vcl_id = ereg_replace("[^-_0-9a-zA-Z]","",$vcl_id); + $mix_method = ereg_replace("[^-_0-9a-zA-Z]","",$mix_method); + $category = ereg_replace("[^-_0-9a-zA-Z]","",$category); + $vsc_id = ereg_replace("[^-_0-9a-zA-Z]","",$vsc_id); + $moh_context = ereg_replace("[^-_0-9a-zA-Z]","",$moh_context); + $source_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$source_campaign_id); + $source_user_id = ereg_replace("[^-_0-9a-zA-Z]","",$source_user_id); + $source_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$source_group_id); + $default_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$default_xfer_group); + $drop_exten = ereg_replace("[^-_0-9a-zA-Z]","",$drop_exten); + $safe_harbor_exten = ereg_replace("[^-_0-9a-zA-Z]","",$safe_harbor_exten); + $drop_action = ereg_replace("[^-_0-9a-zA-Z]","",$drop_action); + $drop_inbound_group = ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group); + $afterhours_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$afterhours_xfer_group); + $after_hours_action = ereg_replace("[^-_0-9a-zA-Z]","",$after_hours_action); + $alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$alias_id); + $shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$shift_id); + $qc_shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$qc_shift_id); + $survey_first_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_first_audio_file); + $survey_opt_in_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_opt_in_audio_file); + $survey_ni_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_ni_audio_file); + $survey_method = ereg_replace("[^-_0-9a-zA-Z]","",$survey_method); + $alter_custphone_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custphone_override); + $manual_dial_filter = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_filter); + $agent_clipboard_copy = ereg_replace("[^-_0-9a-zA-Z]","",$agent_clipboard_copy); + $hold_time_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option); + $hold_time_option_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_xfer_group); + $hold_recall_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$hold_recall_xfer_group); + $play_welcome_message = ereg_replace("[^-_0-9a-zA-Z]","",$play_welcome_message); + $did_route = ereg_replace("[^-_0-9a-zA-Z]","",$did_route); + $user_unavailable_action = ereg_replace("[^-_0-9a-zA-Z]","",$user_unavailable_action); + $user_route_settings_ingroup = ereg_replace("[^-_0-9a-zA-Z]","",$user_route_settings_ingroup); + $call_handle_method = ereg_replace("[^-_0-9a-zA-Z]","",$call_handle_method); + $agent_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$agent_search_method); + $hold_time_option_voicemail = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_voicemail); + $exten_context = ereg_replace("[^-_0-9a-zA-Z]","",$exten_context); + $three_way_call_cid = ereg_replace("[^-_0-9a-zA-Z]","",$three_way_call_cid); + $web_form_target = ereg_replace("[^-_0-9a-zA-Z]","",$web_form_target); + $recording_web_link = ereg_replace("[^-_0-9a-zA-Z]","",$recording_web_link); + $vtiger_search_category = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_category); + $vtiger_create_call_record = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_create_call_record); + $vtiger_create_lead_record = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_create_lead_record); + $vtiger_screen_login = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_screen_login); + $cpd_amd_action = ereg_replace("[^-_0-9a-zA-Z]","",$cpd_amd_action); + $template_id = ereg_replace("[^-_0-9a-zA-Z]","",$template_id); + $carrier_id = ereg_replace("[^-_0-9a-zA-Z]","",$carrier_id); + $group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id); + $default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias); + $vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead); + $survey_third_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_third_audio_file); + $survey_fourth_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_fourth_audio_file); + $menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$menu_id); + $source_menu = ereg_replace("[^-_0-9a-zA-Z]","",$source_menu); + $call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id); + $phone_context = ereg_replace("[^-_0-9a-zA-Z]","",$phone_context); + $conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret); + $tracking_group = ereg_replace("[^-_0-9a-zA-Z]","",$tracking_group); + $no_agent_no_queue = ereg_replace("[^-_0-9a-zA-Z]","",$no_agent_no_queue); + $no_agent_action = ereg_replace("[^-_0-9a-zA-Z]","",$no_agent_action); + $quick_transfer_button = ereg_replace("[^-_0-9a-zA-Z]","",$quick_transfer_button); + $prepopulate_transfer_preset = ereg_replace("[^-_0-9a-zA-Z]","",$prepopulate_transfer_preset); + $tts_id = ereg_replace("[^-_0-9a-zA-Z]","",$tts_id); + $drop_rate_group = ereg_replace("[^-_0-9a-zA-Z]","",$drop_rate_group); + $agent_dial_owner_only = ereg_replace("[^-_0-9a-zA-Z]","",$agent_dial_owner_only); + $reset_time = ereg_replace("[^-_0-9a-zA-Z]","",$reset_time); + $moh_id = ereg_replace("[^-_0-9a-zA-Z]","",$moh_id); + $drop_inbound_group_override = ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group_override); + $timer_action = ereg_replace("[^-_0-9a-zA-Z]","",$timer_action); + + ### ALPHA-NUMERIC and underscore and dash and slash and dot + $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); + $menu_timeout_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_timeout_prompt); + $menu_invalid_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_invalid_prompt); + $after_hours_message_filename = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$after_hours_message_filename); + $welcome_message_filename = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$welcome_message_filename); + $onhold_prompt_filename = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$onhold_prompt_filename); + $hold_time_option_callback_filename = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$hold_time_option_callback_filename); + $agent_alert_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$agent_alert_exten); + $filename = ereg_replace("[^-\/\._0-9a-zA-Z]","",$filename); + $am_message_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten); + $am_message_exten_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten_override); + + ### ALPHA-NUMERIC and underscore and dash and comma + $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); + $forced_timeclock_login = ereg_replace("[^-\,\_0-9a-zA-Z]","",$forced_timeclock_login); + + ### ALPHA-NUMERIC and dots + $sounds_web_server = ereg_replace("[^\.0-9a-zA-Z]","",$sounds_web_server); + ### ALPHA-NUMERIC and spaces + $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); + ### ALPHA-NUMERIC and hash + $group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); + ### ALPHA-NUMERIC and hash and star and dot and underscore + $hold_time_option_exten = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$hold_time_option_exten); + $did_pattern = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$did_pattern); + $voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$voicemail_ext); + $phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone); + $phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone_code); + + ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores + $adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); + $adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); + $asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); + $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); + $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); + $campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); + $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); + $ingroup_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$ingroup_rec_filename); + $company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); + $full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); + $fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); + $group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); + $HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); + $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); + $lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); + $list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); + $local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); + $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); + $picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); + $script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); + $script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); + $server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); + $status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); + $status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); + $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); + $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); + $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); + $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); + $vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); + $vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); + $vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); + $code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$code_name); + $alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name); + $shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name); + $did_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$did_description); + $alt_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alt_server_ip); + $template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name); + $carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name); + $group_alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_alias_name); + $caller_id_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$caller_id_name); + $user_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$user_code); + $territory = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$territory); + $tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name); + $moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name); + $timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message); + + ### ALPHA-NUMERIC and underscore and dash and slash and at and dot + $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); + $client_browser = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$client_browser); + $DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); + $DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); + $dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); + $extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); + $install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); + $old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); + $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); + $queuemetrics_dbname = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_dbname); + $queuemetrics_login = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_login); + $queuemetrics_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_pass); + $email = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$email); + $vtiger_dbname = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$vtiger_dbname); + $vtiger_login = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$vtiger_login); + $vtiger_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$vtiger_pass); + $custom_one = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_one); + $custom_two = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_two); + $custom_three = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_three); + $custom_four = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_four); + $custom_five = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + + ### NUMERIC and comma and pipe + $waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options); + + ### value cleaning + $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); + + ### ALPHA-NUMERIC and underscore and dash and slash and at and space and colon + $vdc_header_date_format = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vdc_header_date_format); + $vdc_customer_date_format = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vdc_customer_date_format); + $menu_name = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$menu_name); + + ### ALPHA-NUMERIC and underscore and dash and at and space and parantheses + $vdc_header_phone_format = ereg_replace("[^- \(\)\_0-9a-zA-Z]","",$vdc_header_phone_format); + + ### remove semi-colons ### + $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); + $list_mix_container = ereg_replace(";","",$list_mix_container); + $survey_response_digit_map = ereg_replace(";","",$survey_response_digit_map); + $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir); + $conf_override = ereg_replace(";","",$conf_override); + $template_contents = ereg_replace(";","",$template_contents); + $registration_string = ereg_replace(";","",$registration_string); + $account_entry = ereg_replace(";","",$account_entry); + $account_entry = ereg_replace("\r","",$account_entry); + $globals_string = ereg_replace(";","",$globals_string); + $dialplan_entry = ereg_replace(";","",$dialplan_entry); + $dialplan_entry = ereg_replace("\r","",$dialplan_entry); + $custom_dialplan_entry = ereg_replace("\\\\","",$custom_dialplan_entry); + $custom_dialplan_entry = ereg_replace(";","",$custom_dialplan_entry); + $custom_dialplan_entry = ereg_replace("\r","",$custom_dialplan_entry); + $tts_text = ereg_replace("\\\\","",$tts_text); + $tts_text = ereg_replace(";","",$tts_text); + $tts_text = ereg_replace("\r","",$tts_text); + $tts_text = ereg_replace("\"","",$tts_text); + $carrier_description = ereg_replace("\\\\","",$carrier_description); + $carrier_description = ereg_replace(";","",$carrier_description); + $carrier_description = ereg_replace("\r","",$carrier_description); + $carrier_description = ereg_replace("\"","",$carrier_description); + + + ### VARIABLES TO BE mysql_real_escape_string ### + # $web_form_address + # $queuemetrics_url + # $admin_home_url + # $qc_web_form_address + # $vtiger_url + # $web_form_address_two + # $crm_login_address + # $start_call_url + # $dispo_call_url + + ### VARIABLES not filtered at all ### + # $script_text + + } # end of non_latin +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + + + +##### END VARIABLE FILTERING FOR SECURITY ##### + + +# ViciDial database administration +# admin.php +# +# CHANGELOG: +# 50315-1110 - Added Custom Campaign Statuses +# 50317-1438 - Added Fronter Display var to inbound groups +# 50322-1355 - Added custom callerID per campaign +# 50517-1356 - Added user_groups sections and user_group to vicidial_users +# 50517-1440 - Added ability to logout (must click OK with empty user/pass) +# 50602-1622 - Added lead loader pages to load new files into vicidial_list +# 50620-1351 - Added custom vdad transfer AGI extension per campaign +# 50810-1414 - modified in groups to kick out spaces and dashes +# 50908-2136 - Added Custom Campaign HotKeys +# 50914-0950 - Fixed user search by user_group +# 50926-1358 - Modified to allow for language translation +# 50926-1615 - Added WeBRooTWritablE write controls +# 51020-1008 - Added editable web address and park ext - NEW dial campaigns +# 51020-1056 - Added fields and help for campaign recording control +# 51123-1335 - Altered code to function in php globals=off +# 51208-1038 - Added user_level changes, function controls and default user phones +# 51208-1556 - Added deletion of users/lists/campaigns/in groups/remote agents +# 51213-1706 - Added add/delete/modify vicidial scripts +# 51214-1737 - Added preview of vicidial script in popup window +# 51219-1225 - Added campaign and ingroups script selector and get_call_launch field +# 51222-1055 - Added am_message_exten to campaigns to allow for AM Message button +# 51222-1125 - Fixed new vicidial_campaigns default values not being assigned bug +# 51222-1156 - Added LOG OUT ALL AGENTS ON THIS CAMPAIGN button to campaign screen +# 60204-0659 - Fixed hopper reset bug +# 60207-1413 - Added AMD send to voicemail extension and xfer-conf dtmf presets +# 60213-1100 - Added several vicidial_users permissions fields +# 60215-1319 - Added On-hold CallBacks display and links +# 60227-1226 - Fixed vicidial_inbound_groups insert bug +# 60413-1308 - Fixed list display to have 1 row/status: count and time zone tables +# - Added status name in selected dial statuses in campaign screen +# 60417-1416 - Added vicidial_lead_filters sections +# - Changed the header links to color-coded sectional with sublinks below +# - Added filter name and script name to campaign and in-group modify sections +# - Added callback and alt dial options to campaigns section +# - Added callback, alt dial and other options to users section +# 60419-1628 - Alter Callbacks display to include status and LIVE listings, reordered +# 60421-1441 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60425-2355 - Added agent options to vicidial_users, reformatted user page +# 60502-1627 - Added drop_call_seconds and safe_harbor_ fields to campaign screen +# 60503-1228 - Added drop_call_seconds and drop_ fields to inbound groups screen +# 60505-1117 - Added initial framework for new local_call_times tables and definitions +# 60506-1033 - More revisions to the local_call_time section +# 60508-1354 - Finished call_times and state_call_times sections +# - Added modify/delete options for call_times +# 60509-1311 - Functionalize campaign dialable leads calculation +# - Change state_call_times selection from call_times to only allow one per state +# - Added dialable leads count popup to campaign screen if auto-calc is disabled +# - Added test dialable leads count popup to filter screen +# 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen +# 60608-1401 - Added allowable inbound_groups checkboxes to CLOSER campaign detail screen +# 60609-1051 - Added add-to-dnc in LISTS section +# 60613-1415 - Added lead recycling options to campaign detail screen +# 60619-1523 - Added variable filtering to eliminate SQL injection attack threat +# 60622-1216 - Fixed HotKey addition form issues and variable filtering +# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug and filter_sql bug +# 60808-1147 - Changed filtering for and added instructions for consutative transfers +# 60816-1552 - Added allcalls_delay start delay for recordings in vicidial.php +# 60817-2226 - Fixed bug that would not allow lead recycling of non-selectable statuses +# 60821-1543 - Added option to Omit Phone Code while dialing in vicidial +# 60821-1625 - Added ALLFORCE recording option for campaign_recording +# 60823-1154 - Added fields for adaptive dialing +# 60824-1326 - Added adaptive_latest_target_gmt for ADAPT_TAPERED dial method +# 60825-1205 - Added adaptive_intensity for ADAPT_ dial methods +# 60828-1019 - Changed adaptive_latest_target_gmt to adaptive_latest_server_time +# 60828-1115 - Added adaptive_dl_diff_target and changed intensity dropdown +# 60927-1246 - Added astguiclient/admin.php functions under SERVERS tab +# 61002-1402 - Added fields for vicidial balance trunk controls +# 61003-1123 - Added functions for vicidial_server_trunks records +# 61109-1022 - Added Emergency VDAC Jam Clear function to Campaign Detail screen +# 61110-1502 - Add ability to select NONE in dial statuses, new list_id must not be < 100 +# 61122-1228 - Added user group campaign restrictions +# 61122-1535 - Changed script_text to unfiltered and added more variables to SCRIPTS +# 61129-1028 - Added headers to Users and Phones with clickable order-by titles +# 70108-1405 - Added ADAPT OVERRIDE to allow for forced dial_level changes in ADAPT dial methods +# - Screen width definable at top of script, merged server_stats into this script +# 70109-1638 - Added ALTPH2 and ADDR3 hotkey options for alt number dialing with HotKeys +# 70109-1716 - Added concurrent_transfers option to vicidial_campaigns +# 70115-1152 - Aded (CLOSER|BLEND|INBND|_C$|_B$|_I$) options for CLOSER-type campaigns +# 70115-1532 - Added auto_alt_dial field to campaign screen for auto-dialing of alt numbers +# 70116-1200 - Added auto_alt_dial_status functionality to campaign screen +# 70117-1235 - Added header formatting variables at top of script +# - Moved Call Times and Phones/Server functions to Admin section +# 70118-1706 - Added new user group displays and links +# 70123-1519 - Added user permission settings for all sections +# 70124-1346 - Fixed spelling errors and formatting consistency +# 70202-1120 - Added agent_pause_codes section to campaigns +# 70205-1204 - Added memo, last dialed, timestamp and stats-refresh fields to vicidial_campaigns/lists +# 70206-1323 - Added user setting for vicidial_recording_override +# 70212-1412 - Added system settings section +# 70214-1226 - Added QueueMetrics Log ID field to system settings section +# 70219-1102 - Changed campaign dial statuses to be one string allowing for high limit +# 70223-0957 - Added queuemetrics_eq_prepend for custom ENTERQUEUE prepending of a field +# 70302-1111 - Fixed small bug in dialable leads calculation +# 70314-1133 - Added insert selection on script forms +# 70319-1423 - Added Alter Customer Data and agent disable display functions +# 70319-1625 - Added option to allow agents to login to outbound campaigns with no leads in the hopper +# 70322-1455 - Added sipsak messages parameters +# 70402-1157 - Added HOME link and entry to system_settings table, added QM link on reports section +# 70516-1628 - Started reformatting campaigns to use submenus to break up options +# 70529-1653 - Added help for list mix +# 70530-1354 - Added human_answered field to statuses, added system status modification +# 70530-1714 - Added lists for all campaign subsections +# 70531-1631 - Development on List mix admin interface +# 70601-1629 - More development on List mix admin interface, formatting, and added some javascript +# 70602-1300 - More development on List mix admin interface, more javascript +# 70608-1459 - Added option to set LIVE Callbacks to INACTIVE after one month +# 70612-1451 - Added Callback INACTIVE link for after one week, sort by user/group/entrydate +# 70614-0231 - Added Status Categories, ability to Modify Statuses, moved system statuses to sub-section +# 70623-1008 - List Mix section now allows modification of list mix entries +# 70629-1721 - List Mix section adding and removing of list entries active +# 70706-1636 - List Mix section cleanup and more error-checking +# 70908-0941 - Added agc logile enable system_settings +# 71020-1934 - Added inbound groups options: on-hold music, messages, call_times +# 71022-1343 - Added inbound group ranks for users +# 71029-1710 - Added option for campaign to be inbound and/or blended with no restrictions on the campaign_id name +# - Added 5th NEW and 6th NEW to the dial order options +# 71030-2010 - Added Manual Dial List ID field to campaigns table +# 71103-2207 - Added inbound_group_rank and fewest_calls to the inbound groups call order options +# 71113-1521 - Added campaign_rank to agent options +# - Added ability to Copy a campaign's setting to a new campaign +# 71113-2225 - Added ability to copy user and in-group settings to new users and in-groups +# 71116-0942 - Added campaign_rank and fewest_calls as methods for agent call routing +# 71122-1135 - Added default transfer group for campaigns and inbound groups +# 71125-1751 - Added allowable transfer groups to campaign detail screen +# 80107-1204 - Started framework for new QC section +# 80112-0242 - Added more options for lead order +# 80211-1901 - Added DB Schema Version to system settings display +# 80224-1334 - Added Queue Priority to in-groups and campaigns +# 80302-0232 - added drop_action and transfer to in-group for both in-groups and outbound +# 80310-1504 - added QC settings section to campaign screen +# 80317-2037 - Added Recording override settings to in-groups +# 80414-1505 - More work on QC, added vicidial_qc_codes +# 80424-0442 - Added non_latin system_settings lookup at top to override dbconnect setting +# 80505-0333 - Added phones_alias sections to allow for load-balanced-phone-logins +# 80512-1529 - Added auto-generate of User ID feature +# 80515-1345 - Added Shifts sub-section to Admin section +# 80528-0001 - Added campaign survey sub-section +# 80528-1102 - Added user timeclock edit options +# 80608-1304 - Changed add-to-DNC to allow for multiple entries per submission +# 80625-0032 - Added time/phone display format options to system settings +# 80703-0124 - Added alter cust phone and api settings +# 80715-1130 - Added Recycle leads limit count +# 80719-1351 - Changed QC settings in campaigns and In-Groups +# 80809-2305 - Added Sale and Dead Lead categories to status categories page +# 80815-1036 - Added manual dial filter to capaigns +# 80823-2124 - Added copy to clipboard campaign option +# 80829-2359 - Added EXTENDED auto_alt_dial options +# 80831-0406 - Added agent screen extended alt-dial option to campaigns +# 80909-0553 - Added campaign-specific DNC list option and add +# 81002-1101 - Added more in-group options and new DID section and user options +# 81007-0936 - Added three_way_call_cid option to campaigns +# 81012-1725 - Added INBOUND_MAN dial method allowing for manual list dialing with inbound calls +# 81030-0348 - Added campaign pause code force option +# 81030-2228 - Fixed DIDs creation issue +# 81103-1408 - Added 3way call dial prefix option +# 81107-1551 - Added Stats Percent of Calls Answered Within X seconds fields to in-groups +# 81118-0933 - Changed lists listing with links and more options +# 81119-0715 - Added ability to bulk enable/disable lists from modify campaign screen +# 81209-1538 - Added web_form_target to campaign screen +# 81210-1430 - Added http server IP and recording link options to servers +# 81222-0500 - Reformatted all listings to same format changed to field selects instead of * +# 81228-2300 - Added fields for vtiger integration and active vicidial_user display +# 90101-1216 - Added options for user synchronization with vtiger +# 90112-0335 - Added vtiger_create_lead_record and vtiger_create_lead_record options +# 90115-0502 - Activated AGENT DID routing option +# 90126-2256 - Added vtiger_screen_login campaign option and user agent alert option +# 90201-1503 - Added option to disable the viewing of inactive QC features +# 90202-0112 - Added option to disable outbound autodialing(or list dialing) +# 90202-0444 - Added cpd_amd_action option for processing of AMD messages +# 90209-1339 - Added download_lists option to allow downloading of lists +# 90210-1042 - Added options for auto-generation of asterisk conf files +# 90301-2026 - Added Vtiger group synchronization +# 90302-2046 - Changed Section heading to be on the left side of the screen +# 90303-0631 - Added web vars to agent campaign and in-group settings +# 90303-2047 - Added group aliases and default group aliases +# 90306-1214 - Added shift enforcement and server/system calls per second options +# 90308-0956 - Added server statistics +# 90309-0059 - Changed logging to admin_server_log +# 90310-2203 - Added export_reports option for call activity report data exports +# 90315-1010 - Changed revision for new trunk 2.2.0 +# 90320-0424 - Fixed several small bugs conf records group alias and permissions +# 90322-0122 - Added ability to delete from the DNC lists +# 90322-1105 - Added new status settings and vtiger options +# 90409-2133 - Fixed special characters in SCRIPTS +# 90413-0755 - Fixed filter and script slashes issues +# 90417-0211 - Fixed filter and script slashes issues +# 90422-0613 - Added user_code, territory and email to vicidial_users +# 90429-0542 - Added 3rd&4th options to SURVEY campaigns +# 90430-0154 - Added RANDOM and LAST CALL TIME options to lead order for campaigns +# 90504-0901 - Added Call Menu feature, changed script to use long PHP tags +# 90511-0910 - Added agentonly_callback_campaign_lock to system_settings +# 90512-0440 - Added sounds settings to system_settings table +# 90514-0607 - Added select prompts from list in call menu and in-group screens +# 90521-0029 - Added user territories enable option +# 90522-0506 - Security fix for logins when using non-latin setting +# 90524-2307 - Changed Reports screen layout +# 90528-2055 - Added ViciDial recording limit field in servers and phone_context to phones +# 90530-1206 - Changed List Mix to allow for 40 mixes +# 90531-1802 - Added auto-generated options for users, campaigns, in-groups, etc..., added option to HIDE custphone +# 90531-2339 - Added Dynamic options for Call Menu +# 90605-0248 - Added carrier_logging_active servers option +# 90607-1716 - Changed drop percent limit to allow for 0.1 steps under 3% +# 90608-0944 - Added Drop Lockout Time feature to Campaign Detail Modification screen +# 90612-0909 - Added audio prompt selection feature to survey screen +# 90614-0827 - Added In-Group routing to Call Menu screen, Added pull-down Call Menu option to DID screen +# 90617-0733 - Added phone ring timeout and call menu custom dialplan entries +# 90621-0821 - Added phone Conf File Secret field to use a separate password from the user interface for a phone +# 90621-1220 - Added Call Menu logging tracking_group +# 90627-0547 - Added no-agent-no-queue options +# 90627-2333 - Added default transfer button and prepopulate preset options +# 90628-0924 - Added Text To Speech(TTS) fields +# 90628-2213 - Added Multi-campaign drop rate groups +# 90705-0926 - Added User Group agent view options +# 90710-1528 - Added Agent view and grab queue calls and every call pause options +# 90717-0646 - Added dialed_label and dialed_number to script variables +# 90721-1350 - Added RANK and OWNER as list order options and list screen display tables +# 90722-1235 - Added list reset time and campaign no hopper dialing, agent dial owner only options +# 90726-0153 - Added allow_alerts for users to disable agent browser alerts +# 90729-0555 - Added agent_display_dialable_leads and vicidial_balance_rank options +# 90808-0300 - Added longest_wait_time option for agent call routing +# 90827-1552 - Added agent_script_override option for lists +# 90830-2217 - Added Music On Hold section +# 90904-1536 - Added moh chooser option, timezone list ordering +# 90908-1207 - Added cross-listing linking for DIDs, CallMenus and In-groups +# 90916-1105 - Added second web form to ingroups and campaigns and added audio choose for answering machine message and waitforsilence_options +# 90917-1108 - Added Extra Voicemail boxes config in Admin section +# 90919-2251 - Removed all SELECT STAR instances in the code, code cleanup to conform to standard +# 90924-1645 - Added list_id overrides for cid, am_message and drop in-group +# 90930-2107 - Added agent territory selection options for ViciDial agents +# 91026-1050 - Added AREACODE DNC option for campaigns +# 91031-1232 - Added carrier_description field, campaigns links from in-group screen, server links on reports page, agent ranks listing active only +# 91121-0334 - Limited list called count display to 100+ +# 91125-0628 - Added conf_secret for servers +# 91204-1652 - Added recording_filename and recording_id as script variables +# 91205-2231 - Added delete_vm_after_email voicemail option to phones and extra voicemail sections +# 91210-2038 - Added better logging of Campaign emergency logout +# 91211-1359 - Added custom user fields and campaign CRM login fields +# 91219-0719 - Changed some field backgrounds in the Campaign Modification screens +# 91223-1031 - Added VIDPROMPT options for in-group routing in DIDs +# 91228-1837 - Added timer action settings to in-groups and campaigns +# 100103-0727 - Added Start/Dispo call url, 3/4/5 conf number presets, Lists conf-number overrides +# 100104-1454 - Fixed in-group/campaign copy duplication issue +# 100116-0718 - Added presets to script select list +# 100319-1708 - Changed user/pass for users to 20 characters in length, highlighted conf file secret in phones +# 100413-2328 - several small fixes, logging, removal of old SIP/IAX monitor/barge links +# +# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time + +$admin_version = '2.2.0-236'; +$build = '100413-2328'; + +$STARTtime = date("U"); +$SQLdate = date("Y-m-d H:i:s"); +$REPORTdate = date("Y-m-d"); +$MT[0]=''; +$US='_'; +$active_lists=0; +$inactive_lists=0; + +$month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); +$past_month_date = date("Y-m-d H:i:s",$month_old); +$week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); +$past_week_date = date("Y-m-d H:i:s",$week_old); + +$dtmf[0]='0'; $dtmf_key[0]='0'; +$dtmf[1]='1'; $dtmf_key[1]='1'; +$dtmf[2]='2'; $dtmf_key[2]='2'; +$dtmf[3]='3'; $dtmf_key[3]='3'; +$dtmf[4]='4'; $dtmf_key[4]='4'; +$dtmf[5]='5'; $dtmf_key[5]='5'; +$dtmf[6]='6'; $dtmf_key[6]='6'; +$dtmf[7]='7'; $dtmf_key[7]='7'; +$dtmf[8]='8'; $dtmf_key[8]='8'; +$dtmf[9]='9'; $dtmf_key[9]='9'; +$dtmf[10]='HASH'; $dtmf_key[10]='#'; +$dtmf[11]='STAR'; $dtmf_key[11]='*'; +$dtmf[12]='A'; $dtmf_key[12]='A'; +$dtmf[13]='B'; $dtmf_key[13]='B'; +$dtmf[14]='C'; $dtmf_key[14]='C'; +$dtmf[15]='D'; $dtmf_key[15]='D'; +$dtmf[16]='TIMECHECK'; $dtmf_key[16]='TIMECHECK'; +$dtmf[17]='TIMEOUT'; $dtmf_key[17]='TIMEOUT'; +$dtmf[18]='INVALID'; $dtmf_key[18]='INVALID'; + +if ($force_logout) + { + if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + } + echo "Voce efetuou logout. Obrigado\n"; + exit; + } + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $SSauto_dial_limit = $row[1]; + $SSuser_territories_active = $row[2]; + $SSallow_custom_dialplan = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); + fclose($fp); + } + } + else + { + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + } + } + +###################################################################################################### +###################################################################################################### +####### Header settings +###################################################################################################### +###################################################################################################### + + +header ("Content-type: text/html; charset=utf-8"); +echo "\n"; +echo "\n"; +echo "\n"; +echo "ADMINISTRATION: "; + +if (!isset($ADD)) {$ADD=0;} + +if ($ADD=="1") {$hh='users'; echo "Incluir Usuário";} +if ($ADD=="1A") {$hh='users'; echo "Copiar Usuário";} +if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Incluir Campanha";} +if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copiar Campanha";} +if ($ADD==111) {$hh='lists'; echo "Incluir Lista";} +if ($ADD==121) {$hh='lists'; echo "Novo Bloqueio";} +if ($ADD==1111) {$hh='ingroups'; echo "Incluir Grupo de Entrada";} +if ($ADD==1211) {$hh='ingroups'; echo "Copiar Grupo de Entrada";} +if ($ADD==1311) {$hh='ingroups'; echo "IncluirDID";} +if ($ADD==1411) {$hh='ingroups'; echo "CopiarDID";} +if ($ADD==1511) {$hh='ingroups'; echo "Incluir Menu de Chamada";} +if ($ADD==1611) {$hh='ingroups'; echo "Copiar Menu de Chamada";} +if ($ADD==11111) {$hh='remoteagent'; echo "Incluir Usuário Remoto";} +if ($ADD==111111) {$hh='usergroups'; echo "Incluir Grupo de Usuários";} +if ($ADD==1111111) {$hh='scripts'; echo "Incluir Script";} +if ($ADD==11111111) {$hh='filters'; echo "Incluir Novo Filtro";} +if ($ADD==111111111) {$hh='admin'; $sh='times'; echo "Novo Horário de Cham.";} +if ($ADD==131111111) {$hh='admin'; $sh='shifts'; echo "Incluir Turno";} +if ($ADD==1111111111) {$hh='admin'; $sh='times'; echo "Novo Horário de Cham. por Estado";} +if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "NOVO RAMAL";} +if ($ADD==12111111111) {$hh='admin'; $sh='phones'; echo "INCLUIR ALIAS DE RAMAL";} +if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "INCLUIR ALIAS DE GRUPO";} +if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "NOVO SERVIDOR";} +if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "INCLUIR TEMPLATE CONF";} +if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "Incluir Operadora";} +if ($ADD==151111111111) {$hh='admin'; $sh='tts'; echo "ADD NEW TTS ENTRADA";} +if ($ADD==161111111111) {$hh='admin'; $sh='moh'; echo "ADD NEW MUSIC EN ESPERA DE ENTRADA";} +if ($ADD==171111111111) {$hh='admin'; $sh='vm'; echo "ADD NEW contestador";} +if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "NOVA CONFERÊNCIA";} +if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} +if ($ADD=='2') {$hh='users'; echo "Novo usuário";} +if ($ADD=='2A') {$hh='users'; echo "Inclusão de Usuário Copiado";} +if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "Inclusão de Campanha Copiada";} +if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "Nova Campanha";} +if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "Novo Status de Campanha";} +if ($ADD==23) {$hh='campaigns'; $sh='hotkey'; echo "New Campanha HotKey Addition";} +if ($ADD==25) {$hh='campaigns'; $sh='recycle'; echo "Nova Reciclagem de registros";} +if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Novo Status de Disc. Alt.";} +if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Novo Código de Pausa";} +if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Status de Discagem Adicionado";} +if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Mesclagem de Listas Incluído";} +if ($ADD==211) {$hh='lists'; echo "Nova Lista";} +if ($ADD==2111) {$hh='ingroups'; echo "Novo Grupo de Entrada";} +if ($ADD==2011) {$hh='ingroups'; echo "Inclusão de Grupo de Entrada Copiada";} +if ($ADD==2311) {$hh='ingroups'; echo "Incluir DDR";} +if ($ADD==2411) {$hh='ingroups'; echo "Inclusão de DDR por cópia";} +if ($ADD==2511) {$hh='ingroups'; echo "Novo Menu de Chamada";} +if ($ADD==2611) {$hh='ingroups'; echo "Novo Menu de Chamada";} +if ($ADD==21111) {$hh='remoteagent'; echo "Novo Agente Remoto";} +if ($ADD==211111) {$hh='usergroups'; echo "Novo Grupo de Usuários";} +if ($ADD==2111111) {$hh='scripts'; echo "Novo Script";} +if ($ADD==21111111) {$hh='filters'; echo "Novo Filtro";} +if ($ADD==211111111) {$hh='admin'; $sh='times'; echo "Nova Inclusão de Horário de Cham.";} +if ($ADD==231111111) {$hh='admin'; $sh='shifts'; echo "Inclusão de Turno";} +if ($ADD==2111111111) {$hh='admin'; $sh='times'; echo "Nova Inclusão de Hor. de Cham. por Estado";} +if ($ADD==21111111111) {$hh='admin'; $sh='phones'; echo "INCLUINDO RAMAL";} +if ($ADD==22111111111) {$hh='admin'; $sh='phones'; echo "INCLUINDO ALIAS DE RAMAL";} +if ($ADD==23111111111) {$hh='admin'; $sh='phones'; echo "INCLUINDO ALIAS DE GRUPO";} +if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADICIONANDO SERVIDOR";} +if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADICIONANDO TRUNK DO SERVIDOR VICIDIAL";} +if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "INCLUINDO TEMPLATE CONF";} +if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "INCLUIR OPERADORA";} +if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "AGREGAR NUEVO TTS ENTRADA";} +if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "ADDING NEW MUSIC EN ESPERA DE ENTRADA";} +if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "AGREGAR NUEVO contestador";} +if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADICIONANDO CONFERÊNCIA";} +if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} +if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "INCLUINDO STATUS DE SISTEMA DO VICIDIAL";} +if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "INCLUIR CATEGORIA DE STATUS";} +if ($ADD==241111111111111) {$hh='admin'; $sh='status'; echo "INCLUINDO CÓDIGO DE STATUS DE CQ";} +if ($ADD==3) {$hh='users'; echo "Alterar Usuário";} +if ($ADD==30) {$hh='campaigns'; echo "Campanha não permitida";} +if ($ADD==31) + { + $hh='campaigns'; $sh='detail'; echo "Alterar Campanha - Detalhes - $campaign_id"; + if ($SUB==22) {echo " - Status";} + if ($SUB==23) {echo " - Atalhos";} + if ($SUB==25) {echo " -Reciclagem de RegistrosEntries";} + if ($SUB==26) {echo " - Discar Num. Alt. Status";} + if ($SUB==27) {echo " - Agent Códigos de Pausa";} + if ($SUB==28) {echo " - QC";} + if ($SUB==29) {echo " - Mesclagem de Listaes";} + if ($SUB=='20A') {echo " - Pesquisa";} + } +if ($ADD==34) + { + $hh='campaigns'; $sh='basic'; echo "Alterar Campanha - Visão Básica - $campaign_id"; + if ($SUB==22) {echo " - Status";} + if ($SUB==23) {echo " - Atalhos";} + if ($SUB==25) {echo " -Reciclagem de RegistrosEntries";} + if ($SUB==26) {echo " - Discar Num. Alt. Status";} + if ($SUB==27) {echo " - Agent Códigos de Pausa";} + if ($SUB==28) {echo " - QC";} + if ($SUB==29) {echo " - Mesclagem de Listaes";} + if ($SUB=='20A') {echo " - Pesquisa";} + } +if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Status da Campanha";} +if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Atalhos da Campanha";} +if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "Reciclagem de Registros da Campanha";} +if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Status de Disc. Alt. da Campanha";} +if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Códigos de Pausa de Agente da Campanha";} +if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Status de Discagem da Campanha";} +if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Mesclagem de Listas";} +if ($ADD==311) {$hh='lists'; echo "Alterar Lista";} +if ($ADD==3111) {$hh='ingroups'; echo "Alterar Groupo de Entrada";} +if ($ADD==3311) {$hh='ingroups'; echo "AlterarDID";} +if ($ADD==3511) {$hh='ingroups'; echo "Alterar Menu de Chamada";} +if ($ADD==31111) {$hh='remoteagent'; echo "Alterar Agentes Remotos";} +if ($ADD==311111) {$hh='usergroups'; echo "Alterar Grupos de Usuários";} +if ($ADD==3111111) {$hh='scripts'; echo "Alterar Script";} +if ($ADD==31111111) {$hh='filters'; echo "Alterar Filtro";} +if ($ADD==311111111) {$hh='admin'; $sh='times'; echo "Alterar um Hor. de Cham.";} +if ($ADD==321111111) {$hh='admin'; $sh='times'; echo "Alterar as configurações de horário de chamada por estado";} +if ($ADD==331111111) {$hh='admin'; $sh='shifts'; echo "Alterar Turno";} +if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Alterar um horário de chamada por estado";} +if ($ADD==31111111111) {$hh='admin'; $sh='phones'; echo "ALTERAR RAMAL";} +if ($ADD==32111111111) {$hh='admin'; $sh='phones'; echo "ALTERAR ALIAS DE RAMAL";} +if ($ADD==33111111111) {$hh='admin'; $sh='phones'; echo "ALTERAR ALIAS DE GRUPO";} +if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "ALTERAR SERVIDOR";} +if ($ADD==331111111111) {$hh='admin'; $sh='templates'; echo "ALTERAR TEMPLATE CONF";} +if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "ALTERAR OPERADORA";} +if ($ADD==351111111111) {$hh='admin'; $sh='tts'; echo "MODIFICAR TTS ENTRADA";} +if ($ADD==361111111111) {$hh='admin'; $sh='moh'; echo "MODIFICAR MÚSICA EN ESPERA DE ENTRADA";} +if ($ADD==371111111111) {$hh='admin'; $sh='vm'; echo "MODIFICAR contestador";} +if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "ALTERAR CONFERÊNCIA";} +if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} +if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "ALTERAR CONFIG. DE SISTEMA DO VICIDIAL";} +if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "ALTERAR STATUS DE SISTEMA DO VICIDIAL";} +if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "ALTERAR CATEGORIA DE STATUS";} +if ($ADD==341111111111111) {$hh='admin'; $sh='status'; echo "ALTERAR CÓDIGO DE STATUS DE CQ";} +if ($ADD=="4A") {$hh='users'; echo "Alterar Usuário - Admin";} +if ($ADD=="4B") {$hh='users'; echo "Alterar Usuário - Admin";} +if ($ADD==4) {$hh='users'; echo "Alterar Usuário";} +if ($ADD==41) {$hh='campaigns'; $sh='detail'; echo "Alterar Campanha";} +if ($ADD==42) {$hh='campaigns'; $sh='status'; echo "Alterar Campanha Status";} +if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Alterar Campanha HotKey";} +if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Alterar Campanha - Visão Básica";} +if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Alterar Reciclagem de registros";} +if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Alterar Código de Pausa";} +if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Alterar Configurações de CQ";} +if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Alterar Mesclagem de Listas";} +if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Alterar Campanha de Pesquisa";} +if ($ADD==411) {$hh='lists'; echo "Alterar Lista";} +if ($ADD==4111) {$hh='ingroups'; echo "Alterar Groupo de Entrada";} +if ($ADD==4311) {$hh='ingroups'; echo "AlterarDID";} +if ($ADD==4511) {$hh='ingroups'; echo "Alterar Menu de Chamada";} +if ($ADD==41111) {$hh='remoteagent'; echo "Alterar Agentes Remotos";} +if ($ADD==411111) {$hh='usergroups'; echo "Alterar Grupos de Usuários";} +if ($ADD==4111111) {$hh='scripts'; echo "Alterar Script";} +if ($ADD==41111111) {$hh='filters'; echo "Alterar Filtro";} +if ($ADD==411111111) {$hh='admin'; $sh='times'; echo "Alterar um Hor. de Cham.";} +if ($ADD==431111111) {$hh='admin'; $sh='shifts'; echo "Alterar Turno";} +if ($ADD==4111111111) {$hh='admin'; $sh='times'; echo "Alterar um horário de chamada por estado";} +if ($ADD==41111111111) {$hh='admin'; $sh='phones'; echo "ALTERAR RAMAL";} +if ($ADD==42111111111) {$hh='admin'; $sh='phones'; echo "ALTERAR ALIAS DE RAMAL";} +if ($ADD==43111111111) {$hh='admin'; $sh='phones'; echo "ALTERAR ALIAS DE GRUPO";} +if ($ADD==411111111111) {$hh='admin'; $sh='server'; echo "ALTERAR SERVIDOR";} +if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "ALTERAR TRUNK DO SERVIDOR VICIDIAL";} +if ($ADD==431111111111) {$hh='admin'; $sh='templates'; echo "ALTERAR TEMPLATE CONF";} +if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "ALTERAR OPERADORA";} +if ($ADD==451111111111) {$hh='admin'; $sh='tts'; echo "MODIFICAR TTS ENTRADA";} +if ($ADD==461111111111) {$hh='admin'; $sh='moh'; echo "MODIFICAR MÚSICA EN ESPERA DE ENTRADA";} +if ($ADD==471111111111) {$hh='admin'; $sh='vm'; echo "MODIFICAR contestador";} +if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "ALTERAR CONFERÊNCIA";} +if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} +if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "ALTERAR CONFIG. DE SISTEMA DO VICIDIAL";} +if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "ALTERAR STATUS DE SISTEMA DO VICIDIAL";} +if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "ALTERAR CATEGORIA DE STATUS";} +if ($ADD==441111111111111) {$hh='admin'; $sh='status'; echo "ALTERAR CÓDIGO DE STATUS DE CQ";} +if ($ADD==5) {$hh='users'; echo "RemoverUsuário";} +if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "RemoverCampanha";} +if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Efetuar Saída dos Agentes";} +if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "Limpador de emergência para VDAC";} +if ($ADD==511) {$hh='lists'; echo "RemoverList";} +if ($ADD==5111) {$hh='ingroups'; echo "RemoverIn-Group";} +if ($ADD==5311) {$hh='ingroups'; echo "RemoverDID";} +if ($ADD==5511) {$hh='ingroups'; echo "Remover Menu de Chamada";} +if ($ADD==51111) {$hh='remoteagent'; echo "Apagar Usuários Remotos";} +if ($ADD==511111) {$hh='usergroups'; echo "Apagar Usuários Group";} +if ($ADD==5111111) {$hh='scripts'; echo "Apagar Scripts";} +if ($ADD==51111111) {$hh='filters'; echo "Apagar Filtro";} +if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "RemoverCall Time";} +if ($ADD==531111111) {$hh='admin'; $sh='shifts'; echo "Remover Turno";} +if ($ADD==5111111111) {$hh='admin'; $sh='times'; echo "Apagar Hor. de Cham. por Estado";} +if ($ADD==51111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} +if ($ADD==52111111111) {$hh='admin'; $sh='phones'; echo "REMOVER ALIAS DE RAMAL";} +if ($ADD==53111111111) {$hh='admin'; $sh='phones'; echo "REMOVER ALIAS DE GRUPO";} +if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} +if ($ADD==531111111111) {$hh='admin'; $sh='templates'; echo "REMOVER TEMPLATE CONF";} +if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "REMOVER OPERADORA";} +if ($ADD==551111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ENTRADA";} +if ($ADD==561111111111) {$hh='admin'; $sh='moh'; echo "DELETE MÚSICA EN ESPERA DE ENTRADA";} +if ($ADD==571111111111) {$hh='admin'; $sh='vm'; echo "DELETE contestador";} +if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} +if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} +if ($ADD==6) {$hh='users'; echo "RemoverUsuário";} +if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "RemoverCampanha";} +if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Efetuar Saída dos Agentes";} +if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "Limpador de emergência para VDAC";} +if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "Remover Reciclagem de Registros";} +if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Remover Status de Disc. Alt.";} +if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Apagar Código de Pausa";} +if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Status de Discagem Removido";} +if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Listas de Campanha Removida";} +if ($ADD==611) {$hh='lists'; echo "RemoverList";} +if ($ADD==6111) {$hh='ingroups'; echo "RemoverIn-Group";} +if ($ADD==6311) {$hh='ingroups'; echo "RemoverDID";} +if ($ADD==6511) {$hh='ingroups'; echo "Remover Menu de Chamada";} +if ($ADD==61111) {$hh='remoteagent'; echo "Apagar Usuários Remotos";} +if ($ADD==611111) {$hh='usergroups'; echo "Apagar Usuários Group";} +if ($ADD==6111111) {$hh='scripts'; echo "Apagar Scripts";} +if ($ADD==61111111) {$hh='filters'; echo "Apagar Filtro";} +if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "RemoverCall Time";} +if ($ADD==631111111) {$hh='admin'; $sh='shifts'; echo "Remover Turno";} +if ($ADD==6111111111) {$hh='admin'; $sh='times'; echo "Apagar Hor. de Cham. por Estado";} +if ($ADD==61111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} +if ($ADD==62111111111) {$hh='admin'; $sh='phones'; echo "REMOVER ALIAS DE RAMAL";} +if ($ADD==63111111111) {$hh='admin'; $sh='phones'; echo "REMOVER ALIAS DE GRUPO";} +if ($ADD==611111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} +if ($ADD==621111111111) {$hh='admin'; $sh='server'; echo "REMOVER TRUNK DO SERVIDOR VICIDIAL";} +if ($ADD==631111111111) {$hh='admin'; $sh='templates'; echo "REMOVER TEMPLATE CONF";} +if ($ADD==641111111111) {$hh='admin'; $sh='carriers'; echo "REMOVER OPERADORA";} +if ($ADD==651111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ENTRADA";} +if ($ADD==661111111111) {$hh='admin'; $sh='moh'; echo "DELETE MÚSICA EN ESPERA DE ENTRADA";} +if ($ADD==671111111111) {$hh='admin'; $sh='vm'; echo "DELETE contestador";} +if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} +if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} +if ($ADD==73) {$hh='campaigns'; echo "Total de Registros Discáveis";} +if ($ADD==7111111) {$hh='scripts'; echo "Pré-Visualizar Script";} +if ($ADD==700000000000000) {$hh='reports'; echo "VICIDIAL LOG DE ALT. ADMIN";} +if ($ADD==710000000000000) {$hh='reports'; echo "VICIDIAL LOG DE ALT. DO USUÁRIO ADMIN";} +if ($ADD==720000000000000) {$hh='reports'; echo "VICIDIAL LOG DE ALT. DA SEÇÃO ADMIN";} +if ($ADD==730000000000000) {$hh='reports'; echo "VICIDIAL LOG DE ALT. DE DETALHES ADMIN";} +if ($ADD==0) {$hh='users'; echo "Lista de Usuários";} +if ($ADD==8) {$hh='users'; echo "Chamadas Agendadas deste Agente";} +if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "Chamadas Agendadas nesta Campanha";} +if ($ADD==811) {$hh='lists'; echo "Chamadas Agendadas nesta Lista";} +if ($ADD==8111) {$hh='usergroups'; echo "Agendamentos do Grupo de Usuários";} +if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campanhas";} +if ($ADD==100) {$hh='lists'; echo "Listas";} +if ($ADD==1000) {$hh='ingroups'; echo "Groupos de Entrada";} +if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} +if ($ADD==1500) {$hh='ingroups'; echo "Menus de Chamada";} +if ($ADD==10000) {$hh='remoteagent'; echo "Agentes Remotos";} +if ($ADD==100000) {$hh='usergroups'; echo "Grupos de Usuário";} +if ($ADD==1000000) {$hh='scripts'; echo "Scripts";} +if ($ADD==10000000) {$hh='filters'; echo "Filtros";} +if ($ADD==100000000) {$hh='admin'; $sh='times'; echo "Horários de Cham.";} +if ($ADD==130000000) {$hh='admin'; $sh='shifts'; echo "Turnos";} +if ($ADD==1000000000) {$hh='admin'; $sh='times'; echo "Horários de Chamada por Estado";} +if ($ADD==10000000000) {$hh='admin'; $sh='phones'; echo "LISTA DE RAMAIS";} +if ($ADD==12000000000) {$hh='admin'; $sh='phones'; echo "LISTA DE ALIAS DE RAMAL";} +if ($ADD==13000000000) {$hh='admin'; $sh='phones'; echo "LISTA DE ALIAS DE GRUPOS";} +if ($ADD==100000000000) {$hh='admin'; $sh='server'; echo "LISTA DE SERVIDORES";} +if ($ADD==130000000000) {$hh='admin'; $sh='templates'; echo "LISTA DE TEMPLATES CONF";} +if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "LISTA DE OPERADORAS";} +if ($ADD==150000000000) {$hh='admin'; $sh='tts'; echo "TTS LISTA INSCRITOS";} +if ($ADD==160000000000) {$hh='admin'; $sh='moh'; echo "MÚSICA EN ESPERA LISTA DE ENTRADA";} +if ($ADD==170000000000) {$hh='admin'; $sh='vm'; echo "LISTA DE CORREO DE VOZ CAJAS";} +if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "LISTA DE CONFERÊNCIAS";} +if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL LISTA DE CONFERÊNCIAS";} +if ($ADD==550) {$hh='users'; echo "Formulário de Pesquisa";} +if ($ADD==551) {$hh='users'; echo "PESQUISAR RAMAIS";} +if ($ADD==660) {$hh='users'; echo "RESULTADOS DA PESQUISA";} +if ($ADD==661) {$hh='users'; echo "RESULTADO DA PESQUISA DE RAMAIS";} +if ($ADD==99999) {$hh='users'; echo "AJUDA";} +if ($ADD==999999) {$hh='reports'; echo "RELATÓRIOS";} + +if ( ($ADD>9) && ($ADD < 99998) ) + { + ##### get scripts listing for dynamic pulldown + $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $rslt=mysql_query($stmt, $link); + $scripts_to_print = mysql_num_rows($rslt); + $scripts_list="<option value=\"\">NONE</option>\n"; + + $o=0; + while ($scripts_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $scripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $scriptname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + + ##### get filters listing for dynamic pulldown + $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; + $rslt=mysql_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + $filters_list="<option value=\"\">NONE</option>\n"; + + $o=0; + while ($filters_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $filters_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $filtername_list["$rowx[0]"] = "$rowx[1]"; + $filtersql_list["$rowx[0]"] = "$rowx[2]"; + $o++; + } + + ##### get call_times listing for dynamic pulldown + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; + $rslt=mysql_query($stmt, $link); + $times_to_print = mysql_num_rows($rslt); + + $o=0; + while ($times_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $call_times_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $call_timename_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + } + +if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) + { + ##### get server listing for dynamic pulldown + $stmt="SELECT server_ip,server_description from servers order by server_ip"; + $rslt=mysql_query($stmt, $link); + $servers_to_print = mysql_num_rows($rslt); + $servers_list=''; + + $o=0; + while ($servers_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + + ##### BEGIN get campaigns listing for rankings ##### + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + $campaigns_list=''; + $campaigns_value=''; + $RANKcampaigns_list="<tr><td>CAMPANHA</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + + $o=0; + while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $campaign_id_values[$o] = $rowx[0]; + $campaign_name_values[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + $group_web_vars=''; + $campaign_web=''; + $stmt="SELECT campaign_rank,calls_today,group_web_vars from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $SELECT_campaign_rank = $row[0]; + $calls_today = $row[1]; + $group_web_vars = $row[2]; + } + else + {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + $stmt_grp_values=''; + if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} + elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} + if (isset($_GET["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_GET["WEB_$campaign_id_values[$o]"];} + elseif (isset($_POST["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_POST["WEB_$campaign_id_values[$o]"];} + if ($non_latin < 1) + { + $campaign_rank = ereg_replace("[^-\_0-9]","",$campaign_rank); + $campaign_web = preg_replace("/;|\"|\'/","",$campaign_web); + } + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + else + { + $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; + $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + + $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + else {$campaign_rank = $SELECT_campaign_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + # disable non user-group allowable campaign ranks + $stmt="SELECT user_group from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Ruser_group = $row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_campaigns = $row[0]; + $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); + $UGcampaigns = explode(" ", $allowed_campaigns); + + $p=0; $RANK_camp_active=0; $CR_disabled = ''; + if (eregi('-ALL-CAMPANHAS-',$allowed_campaigns)) + {$RANK_camp_active++;} + else + { + $UGcampaign_ct = count($UGcampaigns); + while ($p < $UGcampaign_ct) + { + if ($campaign_id_values[$o] == $UGcampaigns[$p]) + {$RANK_camp_active++;} + $p++; + } + } + if ($RANK_camp_active < 1) {$CR_disabled = 'DISABLED';} + + $RANKcampaigns_list .= "<tr $bgcolor><td>"; + $campaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] <BR>\n"; + $RANKcampaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] </td>"; + $RANKcampaigns_list .= "<td>     <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; + $h="9"; + while ($h>=-9) + { + $RANKcampaigns_list .= "<option value=\"$h\""; + if ($h==$campaign_rank) + {$RANKcampaigns_list .= " SELECTED";} + $RANKcampaigns_list .= ">$h</option>"; + $h--; + } + if ( (strlen($campaign_web) < 1) and (strlen($group_web_vars) > 0) ) + {$campaign_web=$group_web_vars;} + $RANKcampaigns_list .= "</select></td>\n"; + $RANKcampaigns_list .= "<td align=right>     $calls_today</td>\n"; + $RANKcampaigns_list .= "<td>     <input type=text size=25 maxlength=255 name=WEB_$campaign_id_values[$o] value=\"$campaign_web\"></td></tr>\n"; + $o++; + } + ##### END get campaigns listing for rankings ##### + + + ##### BEGIN get inbound groups listing for checkboxes ##### + $xfer_groupsSQL=''; + if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and (eregi('list_activation', $stage))) ) + { + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); + $groups = explode(" ", $closer_campaigns); + $xfer_groups = $row[1]; + $xfer_groups = preg_replace("/ -$/","",$xfer_groups); + $XFERgroups = explode(" ", $xfer_groups); + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; + } + if ($ADD==41) + { + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + $xfer_groups .= " $XFERgroups[$p]"; + $p++; + } + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; + } + + if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) + { + $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); + $groups = explode(" ", $closer_campaigns); + } + + if ($ADD==3) + { + $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); + $groups = explode(" ", $closer_campaigns); + } + + $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; +# $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $rslt=mysql_query($stmt, $link); + $groups_to_print = mysql_num_rows($rslt); + $groups_list=''; + $groups_value=''; + $XFERgroups_list=''; + $RANKgroups_list="<tr><td>ENTRANTE GROUP</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; + + $o=0; + while ($groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $group_id_values[$o] = $rowx[0]; + $group_name_values[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($groups_to_print > $o) + { + $group_web_vars=''; + $group_web=''; + $stmt="SELECT group_rank,calls_today,group_web_vars from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $SELECT_group_rank = $row[0]; + $calls_today = $row[1]; + $group_web_vars = $row[2]; + } + else + {$calls_today=0; $SELECT_group_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$group_id_values[$o]"])) {$group_rank=$_GET["RANK_$group_id_values[$o]"];} + elseif (isset($_POST["RANK_$group_id_values[$o]"])) {$group_rank=$_POST["RANK_$group_id_values[$o]"];} + if (isset($_GET["WEB_$group_id_values[$o]"])) {$group_web=$_GET["WEB_$group_id_values[$o]"];} + elseif (isset($_POST["WEB_$group_id_values[$o]"])) {$group_web=$_POST["WEB_$group_id_values[$o]"];} + + if ($non_latin < 1) + { + $group_rank = ereg_replace("[^-\_0-9]","",$group_rank); + $group_web = preg_replace("/;|\"|\'/","",$group_web); + } + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + else + { + $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; + $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + + $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; + } + else {$group_rank = $SELECT_group_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $XFERgroups_list .= "<input type=\"checkbox\" name=\"XFERgroups[]\" value=\"$group_id_values[$o]\""; + $RANKgroups_list .= "<tr $bgcolor><td><input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $p=0; + $group_ct = count($groups); + while ($p < $group_ct) + { + if ($group_id_values[$o] == $groups[$p]) + { + $groups_list .= " CHECKED"; + $RANKgroups_list .= " CHECKED"; + $groups_value .= " $group_id_values[$o]"; + } + $p++; + } + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + if ($group_id_values[$o] == $XFERgroups[$p]) + { + $XFERgroups_list .= " CHECKED"; + $XFERgroups_value .= " $group_id_values[$o]"; + } + $p++; + } + $stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VIG_priority = $row[0]; + + $groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] - $VIG_priority <BR>\n"; + $XFERgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $RANKgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] </td>"; + $RANKgroups_list .= "<td>     <select size=1 name=RANK_$group_id_values[$o]>\n"; + $h="9"; + while ($h>=-9) + { + $RANKgroups_list .= "<option value=\"$h\""; + if ($h==$group_rank) + {$RANKgroups_list .= " SELECTED";} + $RANKgroups_list .= ">$h</option>"; + $h--; + } + if ( (strlen($group_web) < 1) and (strlen($group_web_vars) > 0) ) + {$group_web=$group_web_vars;} + $RANKgroups_list .= "</select></td>\n"; + $RANKgroups_list .= "<td align=right>     $calls_today</td>\n"; + $RANKgroups_list .= "<td>     <input type=text size=25 maxlength=255 name=WEB_$group_id_values[$o] value=\"$group_web\"></td></tr>\n"; + $o++; + } + if (strlen($groups_value)>2) {$groups_value .= " -";} + if (strlen($XFERgroups_value)>2) {$XFERgroups_value .= " -";} + } + ##### END get inbound groups listing for checkboxes ##### + + +##### BEGIN get campaigns listing for checkboxes ##### +if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($ADD==611111) ) + { + if ( ($ADD==211111) or ($ADD==311111) or ($ADD==511111) or ($ADD==611111) ) + { + $stmt="SELECT allowed_campaigns,qc_allowed_campaigns,qc_allowed_inbound_groups from vicidial_user_groups where user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_campaigns = $row[0]; + $qc_allowed_campaigns = $row[1]; + $qc_allowed_inbound_groups = $row[2]; + $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); + $campaigns = explode(" ", $allowed_campaigns); + $qc_allowed_campaigns = preg_replace("/ -$/","",$qc_allowed_campaigns); + $qc_campaigns = explode(" ", $qc_allowed_campaigns); + $qc_allowed_inbound_groups = preg_replace("/ -$/","",$qc_allowed_inbound_groups); + $qc_groups = explode(" ", $qc_allowed_inbound_groups); + } + + $campaigns_value=''; + $campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPANHAS-"'; + $qc_campaigns_value=''; + $qc_campaigns_list='<B><input type="checkbox" name="qc_campaigns[]" value="-ALL-CAMPANHAS-"'; + $qc_groups_value=''; + $qc_groups_list='<B><input type="checkbox" name="qc_groups[]" value="-ALL-GROUPS-"'; + $p=0; + while ($p<2000) + { + if (eregi('ALL-CAMPANHAS',$campaigns[$p])) + { + $campaigns_list.=" CHECKED"; + $campaigns_value .= " -ALL-CAMPANHAS-"; + } + if (eregi('ALL-CAMPANHAS',$qc_campaigns[$p])) + { + $qc_campaigns_list.=" CHECKED"; + $qc_campaigns_value .= " -ALL-CAMPANHAS-"; + } + if (eregi('ALL-GROUPS',$qc_groups[$p])) + { + $qc_groups_list.=" CHECKED"; + $qc_groups_value .= " -ALL-GROUPS-"; + } + $p++; + } + $campaigns_list.="> ALL-CAMPANHAS - USUÁRIOS PODEM VER QUALQUER CAMPANHA</B><BR>\n"; + $qc_campaigns_list.="> ALL-CAMPANHAS - USUÁRIOS PODEM FAZER CQ EM QUALQUER CAMPANHA</B><BR>\n"; + $qc_groups_list.="> ALL-GROUPS - USUÁRIOS PODEM FAZER CQ EM QUALQUER GRUPO DE ENTRADA</B><BR>\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaign_id_value = $rowx[0]; + $campaign_name_value = $rowx[1]; + $campaigns_list .= "<input type=\"checkbox\" name=\"campaigns[]\" value=\"$campaign_id_value\""; + $qc_campaigns_list .= "<input type=\"checkbox\" name=\"qc_campaigns[]\" value=\"$campaign_id_value\""; + $p=0; + while ($p<1000) + { + if ( ($campaign_id_value == $campaigns[$p]) and (strlen($campaign_id_value) > 1) ) + { + # echo "<!-- X $p|$campaign_id_value|$campaigns[$p]| -->"; + $campaigns_list .= " CHECKED"; + $campaigns_value .= " $campaign_id_value"; + } + if ($campaign_id_value == $qc_campaigns[$p]) + { + $qc_campaigns_list .= " CHECKED"; + $qc_campaigns_value .= " $campaign_id_value"; + } + # echo "<!-- O $p|$campaign_id_value|$campaigns[$p]| -->"; + $p++; + } + $campaigns_list .= "> $campaign_id_value - $campaign_name_value<BR>\n"; + $qc_campaigns_list .= "> $campaign_id_value - $campaign_name_value<BR>\n"; + $o++; + } + + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $rslt=mysql_query($stmt, $link); + $groups_to_print = mysql_num_rows($rslt); + + $o=0; + while ($groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $group_id_value = $rowx[0]; + $group_name_value = $rowx[1]; + $qc_groups_list .= "<input type=\"checkbox\" name=\"qc_groups[]\" value=\"$group_id_value\""; + $p=0; + while ($p<2000) + { + if ( ($group_id_value == $qc_groups[$p]) and (strlen($group_id_value) > 1) ) + { + $qc_groups_list .= " CHECKED"; + $qc_groups_value .= " $group_id_value"; + } + $p++; + } + $qc_groups_list .= "> $group_id_value - $group_name_value<BR>\n"; + $o++; + } + + if (strlen($campaigns_value)>2) {$campaigns_value .= " -";} + if (strlen($qc_campaigns_value)>2) {$qc_campaigns_value .= " -";} + if (strlen($qc_groups_value)>2) {$qc_groups_value .= " -";} + } + ##### END get campaigns listing for checkboxes ##### + + +if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999) ) ) + { + ##### get server listing for dynamic pulldown + $stmt="SELECT server_ip,server_description from servers order by server_ip"; + $rsltx=mysql_query($stmt, $link); + $servers_to_print = mysql_num_rows($rsltx); + $servers_list=''; + + $o=0; + while ($servers_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $o++; + } + } + + + +$NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AJUDA\" ALIGN=TOP></A>"; + + +###################################################################################################### +###################################################################################################### +####### 9 series, HELP screen +###################################################################################################### +###################################################################################################### + + +###################### +# ADD=99999 display the HELP SCREENS +###################### + +if ($ADD==99999) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "
ADMINISTRATION: AJUDA


\n"; + + ?> + VICIDIAL_USUÁRIOS TABELA

+ +
+ ID de Usuário - Este campo é onde deve ser colocado o ID de usuário do VICIDIAL, pode ter até 8 caracteres de comprimento, Deve ter pelo menos 2 caracteres de comprimento. + +
+
+
+ Senha - Este campo é onde deve ser configurada a senha do usuário do VICIDIAL. Deve ter pelo menos 2 caracteres de comprimento. + +
+
+
+ Nome completo - Neste campo é configurado o Nome completo do usuário do VICIDIAL. Deve ter no mínimo 2 caracteres de comprimento. + +
+
+
+ Nível de usuário - Neste menu deve ser selecionado o nível do usuário do VICIDIAL. Deve ser pelo menos 1 para acessar o VICIDIAL, deve ser maior que 2 para acessar como finalizador, deve ser nível 8 ou maior para acessar a tela de admin. + +
+
+
+ Grupo de usuário - Este menu é onde você seleciona o grupo de usuários do VICIDIAL ao qual esse usuário pertence. Isto ainda não faz restrições, é usado somente para subdividir usuários e permitir futuras funcionalidades baseadas nele. + +
+
+
+ Login do Ramal - Aqui é onde você pode configurar um valor padrão para o login do ramal, usado quando o usuário loga no vicidial.php. Este valor será colocado no campo de login do ramal automaticamente quando o usuário loga na campanha no vicidial pela tela do vicidial.php. + +
+
+
+ Senha do Ramal- Aqui é onde fica configurada a senha padrão para o ramal quando o usuário loga no vicidial.php. Este valor será colocado automaticamente no campo da senha, quando o usuário faz logon na campanha pela tela vicidial.php. + +
+
+
+ Ativo - Este campo define se o usuário está ativo no sistema e pode usar os recursos do VICIDIAL. O padrão é Y + +
+
+
+ Email, Código do Usuário e Território - Estes são campos opcionais. + +
+
+
+ Atalhos Ativos - Esta opção quando configurada, permite ao usuário usar atalhos de teclado para classificação da chamada vicidial.php. + +
+
+
+ Agente Escolhe Grupos de Entrada - Esta opção com valor 1, permite ao usuário escolher os grupos de entrada que quer receber chamadas quando fazem sogon em uma campanha CLOSER ou ENTRANTE. Caso contrário, o Gerente vai precisar configurar isto na tela de detalhes do cadastro de usuários no site admin. + +
+
+
+ Agente Elija territorios - Esta opción si se establece en 1 permite al usuario elegir los territorios que van a recibir llamadas de los usuarios cuando ingresan a un manual o campaña ENTRANTE_MAN. De lo contrario el usuario será configurado para utilizar todos los territorios que se establecen a pertenecer a los territorios de usuario administrativos sección. + +
+
+
+ Scheduled Callbacks - Esta opción permite que un agente a disposición de una llamada como CALLBK y elegir la fecha y hora en que el plomo se vuelva a activar. + +
+
+
+ Chamada Agendada por Agente - Permite que um agente configure uma chamada agendada com fidelização, assim ela retorna somente para ele. Isso também permite ao agente ver a sua lista de agendamentos e os chamar qualquer hora que desejem. + +
+
+
+ Agente com Chamada Manual- Permite que um agente manualmente adicione um novo registro ao sistema e comande a discagem. Isso também permite que seja comandado a discagem de qualquer número na tela do vicidial e a coloque na sua sessão. Use esta opção com cautela. + +
+
+
+ Gravação do Vicidial - Esta opção previne um agente de fazer qualquer gravação após ter entrado no vicidial. Esta opção deve estar ligada para que o vicidial grave as chamadas da campanha . + +
+
+
+ Transferências Vicidial - Esta opção pode previnir que um agente abra a sessão de transferência/conferência do vicidial. Se estiver desabilitada, o agente não poderá transferir ou incluir um terceiro na chamada. + + 0) + { + ?> +
+
+
+ Padrão Mesclado para Finalizador - Esta opção simplesmente marca ou nao o checkbox de Mesclado(blended) no login da campanha Finalizador (closer). + + +
+
+
+ Sobrepor Config. de Gravação do VICIDIAL - Esta opção irá sobrepor qualquer configuração de gravação que esteja na campanha. DISABLED não irá sobrepor a configuração da campanha. NEVER irá desabilitar a gravação no client. ONDEMAND é o padrão e permite ao agente iniciar e parar a gravação conforme necessário. ALLCALLS irá iniciar a gravação no client quando uma chamada é enviada ao agente. ALLFORCE irá iniciar a gravação no client quando uma chamada é enviada para o agente, sem dar a opção de parar a gravação, Para ALLCALLS e ALLFORCE existe uma opção para atrasar a gravação e evitar gravações curtas demais e evitar carga no sistema. + +
+
+
+ Sobrepor Controle de Turno do Agente - Esta configuração irá sobrepor qualquer configuração feita no grupo do agente para controle de turno. DISABLED irá usár a configuração do grupo. OFF não irá forçar turnos. START irá somente forçar o horário de login do turno mas não terá efeito sobre horário acima do final do turno se o usuário ainda estiver logado. ALL irá forçar o inicio do turno e irá fazer logout do agente caso passe do final do horário do turno. O padrão é DISABLED. + +
+
+
+ Alerta Ativo - Este campo mostra se o agente tem alertas pelo browser habilitados para quando chamadas entram na sessão do usuário. O padrão é 0 para Não. + +
+
+
+ Permitir Alertas - Este campo le da la capacidad para permitir navegador agente de alertas para ser habilitado por el agente para cuando las llamadas entran en su período de sesiones vicidial.php. Por defecto es 0 para el NO. + +
+
+
+ Rankings da Campanha - Nessa sessão você define o ranking que cada agente terá em cada campanha. Esses rankings podem ser usados para permitir roteamento preferencial de chamadas quando o campo Próximo Agente está como campaign_rank. Também nesta seção estão as variáveis WEB para caba campanha. Elas permitem cada agente ter variáveis diferentes que podem ser adicionadas a URL do WEB FORM ou do SCRIPT, simplestemnte colocando --A--web_vars--B-- da mesma forma que faria com qualquer outro campo + +
+
+
+ Grupos de entrada - Aqui é selecionado o grupo de entrada do qual você quer receber chamadas se você selecionou uma campanha CLOSER(finalização). Você também poderá configurar o ranking, ou nível de conhecimento, nessa sessão para cada grupo de entrada, assim como será capaz de ver o número de chamadas recebidas por cada grupo de entrada por agente específico. Também nessa sessão está a possibilidade de atribuir um ranking do agente para cada Grupo de Entrada. Esses rankings podem ser usados para roteamento preferencial quando essa opção está selecionada na tela de Grupos de Entrada. Também nesta seção estão as variáveis WEB para caba campanha. Elas permitem cada agente ter variáveis diferentes que podem ser adicionadas a URL do WEB FORM ou do SCRIPT, simplestemnte colocando --A--web_vars--B-- da mesma forma que faria com qualquer outro campo + +
+
+
+ Sobrepor Permissão de Alteração-<\/B> Esta opção irá sobrepor qualquer opção na campanha para alterar dados do cliente. NOT_ACTIVE irá usar qualquer configuração presente na campanha. ALLOW_ALTER irá sempre permitir alteração no registro do cliente, não importando a configuração da campanha. O padrão é NOT_ACTIVE. + +
+
+
+ Sobrepor Permissão de Alter. de Telefone- Esta opção irá sobrepor qualquer configuração na campanha sobre alterar o telefone do cliente. NOT_ACTIVE irá usar a configuração presente na campanha. ALLOW_ALTER irá sempre permitir que o agente altere o telefone do cliente, não importando a configuração da campanha. O padrão é NOT_ACTIVE. + +
+
+
+ Los campos de usuario personalizada - Estos cinco campos se puede utilizar para diversos fines, y que se puede rellenar en el formulario web y direcciones de secuencias de comandos como user_custom_one y así sucesivamente. + +
+
+
+ Alterar Opções da Interface do Agente - Esta opção quando configurada como 1 permite ao usuário administrativo modificar a interface do agente no admin.php. + +
+
+
+ Apagar Usuários - Esta opção quando habilitada permite que o usuário apaga outros usuários de igual ou menor nível do sistema. + +
+
+
+ Apagar Grupos de Usuários - Esta opção, quando habilitada, permite que este usuário apague grupos de usuário do sistema. + +
+
+
+ Apagar Listas - Esta opção, quando habilitada, permite ao usuário apagar listas do vicidial. + +
+
+
+ Apagar Campanhas - Esta opção, quando habilitada, permite ao usuário apagar campanhas do vicidial. + +
+
+
+ Apagar Grupos de Entrada- Esta opção, quando habilitada, permite ao usuário apagar Grupos de entrada do sistema. + +
+
+
+ Apagar Agentes Remotos - Esta opção quando comfigurada como 1, permite ao usuário apagar agentes remotos do sistema. + + 0) + { + ?> +
+
+
+ Carregar Registros - Esta opção, quando configurada como 1, permite ao usuário carregar novos registros de clientes na tabela vicidial_list atravéz do carregador de arquivos no client web. + + +
+
+
+ Detalhes da Campanha- Esta opção, quando configurada como 1, permite ao usuário ver e modificar os detalhes da campanha . + +
+
+
+ Acesso AGC Admin- Esta opção, quando configurada como 1, permite o usuário efetuar logon nas páginas de admin do astGUIclient. + +
+
+
+ Apagar Fones no AGC- Esta opção, quando configurada como 1, permite ao usuário apagar registros de fone nas paginas de admin do astGUIclient. + +
+
+
+ Apagar Scripts - Esta opção, quando configurada como 1, permite o usuário apagar scripts de campanha na tela de configuração do script. + +
+
+
+ Modificar Registros - Esta opção quando configurada permite ao usuário modificar registros na página de pesquisa do site admin. + +
+
+
+ Trocar Campanha do Agente - Esta opção quando configurada, permite ao usuário trocar a campanha em que um agente está logado no sistema sem que haja necessidade de sair do sistema. + + 0) + { + ?> +
+
+
+ Apagar Filtros - Esta opção permite que o usuário possa apagar filtros de registro no sistema vicidial. + + +
+
+
+ Remover Horários de Chamada - Esta opção permite ao usuário apagar registros de horários de chamada e chamadas por estado do sistema. + +
+
+
+ Alterar Horários de Chamada - Esta opção permite ao usuário visualizar e alterar os registros de horários e estados de ligação. O usuário não precisa desta opção habilitada se for somente alterar as opções de horário na tela de configuração de campanha. + +
+
+
+ Alterar Sessões - Estas opções permitem ao usuário visualizar e alterar registros de cada sessão. Se configurado como 0, o usuário será capaz de ver a lista de sessões, mas não poderá ver os detalhes nem alterar os registros da sessão. + +
+
+
+ Visualizar Relatórios - Esta opção permite ao usuário visualizar os relatórios VICIDIAL. + + 0) + { + ?> +
+
+
+ CQ Habilitado - Esta opção permite ao usuário logar na tela de agente de Controle de Qualidade. + +
+
+
+ Nível de usuário CQ - Esta configuração define qual é o nível do usuário do Controle de Qualidade. Isso irá ditar o nível de funcionalidade desse agente na seção de CQ:
+ 1 - Não Modificar Nada
+ 2 - Não Modificar Nada Exceto Status
+ 3 - Modificar Todos Campos
+ 4 - Verificar primeiro nível de CQ
+ 5 - Vizualizar Estatísticas de CQ
+ 6 - Capacidade de Alterar Registros Finalizados
+ 7 - Nível Gerente
+ +
+
+
+ Registro Passou no CQ - Esta opção permite ao agente especificar que um registro passou no primeiro nível de Controle de Qualidade após revisar o registro. + +
+
+
+ Finalizado no CQ - Esta opção permite ao agente especificar que um registro finalizou o segundo nível de Controle de Qualidade após revisar o registro. + +
+
+
+ Confirmado no CQ - Esta opção permite ao agente especificar que um registro foi Confirmado no Controle de Qualidade. E não poderá ser alterado por ninguém. + + +
+
+
+ Incluir Registro de Ponto - Esta opção permite ao usuário adicionar registros de log ao Relógio de Ponto. + +
+
+
+ Alterar Registro de Log do Ponto - Esta opção permite ao usuário alterar os registros do log do Relógio de ponto. + +
+
+
+ Remover Registro de Log do Ponto - Esta opção permite ao usuário remover registros do log do relógio de ponto. + +
+
+
+ Agente para Acesso ao API - Esta opção permite esta conta ser usada com comandos de API. + +
+
+
+ Sobrepor Controle de Turno do Gerente - Esta configuração quando 1 irá permitir ao gerente entrar com suas credenciais na tela do agente para sobrepor o controle do turno caso o agente esteja tentando logar fora do horário determinado para seu turno. O padrão é 0. + +
+
+
+ Download Listas - Esta configuração quando 1 permite aoa gerente clicar no download da lista na parte inferior da tela de alteração de listas para exportar o conteúdo da lista para um arquivo em formato de texto. O padrão é 0. + +
+
+
+ Exportar Relatórios - Esta configuração quando configurada como 1 irá permitir ao gerente acessar o ítem de exportação de relatórios na tela de relatórios. O padrão é 0 +:
call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner + +
+
+
+ Remover da Lista de Bloqueio - Esta configuração quando 1 permite que o gerente remova números de telefone da lista de bloqueio no sistema VICIDIAL . + + + + + + +



+ + VICIDIAL_CAMPANHAS TABELA

+
+
+ ID da Campanha - Este é o nome curto para a campanha, não é editável após cadastrado, não pode conter espaços e deve ter entre 2 e 8 caracteres de comprimentoh. + +
+
+
+ Nome da Campanha- Esta é a descrição da campanha, deve ter entre 6 e 40 caracteres de comprimento. + +
+
+
+ Descrição da Campanha - Este é um campo de texto para a campanha, é opicional e pode ter no máximo 255 caracteres de comprimento. + +
+
+
+ Data de Alteração da Campanha - Esta é a última vez que a configuração desta campanha foi alterada. + +
+
+
+ Data do Último Login na Campanha - É a data da última vez que um agente logou nesta campanha. + +
+
+
+ Última fecha de convocatoria de la Campaña - Esta es la última vez que una llamada fue manejado por un agente registrado en esta campaña. + +
+
+
+ Atualizar Estat. da Campanha - Este checkbox irá permitir que você force uma atualizaão das estatísticas, mesmo se a campanha não estiver ativa. + +
+
+
+ Ativo - Aqui é onde você configura a campanha coma Ativa ou Inativa. Se Inativa, ninguem pode entrar nela. + +
+
+
+ Exten do Estacionamento - Aqui é onde você pode customizar a musica em espera para o VICIDIAL. Tenha certeza que a extensão existe no extensions.conf e que aponta para o nome de arquivo abaixo. + +
+
+
+ Nome do arquivo de Estacionamento - Aqui é onde você pode customizar a musica em espera para o VICIDIAL. Tenha certeza que o nome do arquivo tem 10 ou menos caracteres de comprimento e que o arquivo está na pasta /var/lib/asterisk/sounds . + +
+
+
+ Formulário Web - Aqui é onde você configura a página web customizada que é aberta quando o usuário clica no botão WEB FORM. Para personalizar a string de pesquisa do formulário web, simplesmente inicie o formulário web com VAR e então a URL que você quer usar, substituindo as variáveis com os nomes de variável que você quer usar --A--phone_number--B-- da mesma forma que na seção SCRIPTS. + +
+
+
+ Target do Form. Web- Esta configuração é onde você coloca o frame da página que o formulário web irá ser aberto quando o usuário clica no botão WEB FORM. O padrão é _blank. + +
+
+
+ Permitir Finalizadores - Aqui é onde você pode configurar se os usuários dessa campanha poderão ter a opção de enviar a chamada para um finalizador. + +
+
+
+ Grupo de Transf. Padrão - Este campo é o Grupo de Entrada padrão que será automaticamente selecionado quando um agente seleciona transferência-conferência na tela do agente. + +
+
+
+ Grupos de Transferência Permitidos - Nessa lista você pode selecionar grupos para os quais os agentes nessa campanha podem transferir chamadas. Permitir Finalizadores (closers) deve estar habilitado para que esta opção seja mostrada. + + 0) + { + ?> +
+
+
+ Permitir Entrantes e Blended - Aqui é onde se configura se o usuário desta campanha irá ter a opção de receber chamadas entrantes nesta campanha. Se você quiser mesclar entrantes e saintes, deve estar configurado como Y. Se você quer apenas fazer chamadas saintes nesta campnaha, configure como N. O padrão é N. + +
+
+
+ Status da Discagem - Aqui é onde você configura os status que você deseja discar nas listas ativas para a campanha abaixo. Para adicionar outro status de discagem, selecione-o na lista e clique ADD. Para remover um dos status, clique no link REMOVE ao lado do status que você quer remover. + +
+
+
+ Ordem da Lista - Este menu é onde você seleciona como os registros nos status selecionados acima serão colocados no hopper: +
  - DOWN: selecione o primeiro registro carregado na tabela vicidial_list +
  - UP: selecione o último registro carregado na tabela vicidial_list +
  - UP PHONE: seleciona o número de telefone mais alto e desce até o fim +
  - DOWN PHONE: seleciona o telefone mais baixo e sube até o topo +
  - UP LAST NAME: inicia com sobrenomes iniciando em Z e desce até o fim +
  - DOWN LAST NAME: inicia com sobrenomes iniciando em A e sobe até o inicio +
  - UP COUNT: inicia com registros mais chamados e vai até o fim +
  - DOWN COUNT: inicia com registros menos chamados e vai até o começo +
  - DOWN COUNT 2nd NEW: inicia com registros menos chamados e vai até o começo inserindo registros NOVOS intercalados - Não deve ter selecionado NOVOS nos status de discagem +
  - DOWN COUNT 3nd NEW: inicia com registros menos chamados e vai até o começo inserindo um registro NOVO a cada três registros - Não deve ter NOVOS selecionado nos status de discagem +
  - DOWN COUNT 4th NEW: inicia com registros menos chamados e vai até o começo inserindo um registro novo a cada quatro registros - Não deve ter NOVOS selecionado nos status de discagem +
  - RANDOM: Aleatoriamente pega um registro entre os status e listas definidas +
  - HORA DA ÚLTIMA CHAMADA PARA CIMA: Ordena os registros pela chamada mais recente +
  - HORA DA ÚLTIMA CHAMADA PARA BAIXO: Ordena os registros pela chamada mais antiga +
  - UP RANK: Comienza con la más alta categoría y se abre camino hacia abajo +
  - DOWN RANK: Comienza con el rango más bajo y se abre camino hasta +
  - UP OWNER: Comienza con los propietarios de inicio con Z y obras de su camino hacia abajo +
  - DOWN OWNER: Comienza con los propietarios empiezan con la letra y se abre camino hasta +
  - UP TIMEZONE: Comienza con las zonas horarias del Este y del Oeste de obras +
  - DOWN TIMEZONE: Comienza con las zonas horarias occidental y oriental de obras + +
+
+
+ Nível de Hopper - Aqui é onde fica configurado quantos registros o VDhopper mantém na tabela vicidial_hopper para esta campanha. Se estiver rodando VDhopper a cada minuto, tenha a garantia que é acima do número de registros discados por minuto. + +
+
+
+ Filtro de Registros - Este é um método de filtrar os registros usando um fragmento de uma query SQL. Use este recurso com cuidado, é fácil parar de discar acidentalmente com uma pequena alteração no comando SQL. O padrão é NONE. + +
+
+
+ Tiempo de caída de bloqueo - Este es un número de horas que DROP abandonar pide se le impida que se está marcando, para establecer inhabilitar a 0. Esta opción es muy útil en países como el Reino Unido, donde existen normas que impiden la tentativa de llamar a los clientes dentro de las 72 horas de abandono, o DROP. Por defecto es 0. + +
+
+
+ Força Limpeza do Hopper - Isto permite que você limpe o conteúdo do hopper a partir do comando enviar da página. O hopper deve ser preenchido assim que o script do VDhopper for executado. + +
+
+
+ Método de discagem - Esta é a definição de como a discagem deve ser feita. Se MANUAL então o níver de discagem automática ficará travado em 0 a não ser que o método seja alterado. Se RATIO então a discagem será feita baseada na quantidade de agentes livres. ADAPT_HARD_LIMIT irá discar preditivamente até o nível de chamadas derrubadas e não discará agressivamente após o nível ter sido alcançado até que abaixe novamente. ADAPT_TAPERED permite se passar do nível de derrubadas na primeira metade do turno, conforme definido no horário de campanha, e fica menos agressivo conforme o turno avança. ADAPT_AVERAGE tenta manter uma média no percentual de derrubadas não impondo limites e não sendo tão agressivo como os outros dois métodos. Você não pode mudar o nível de discagem automática se você usar alguns dos métodos ADAPT. Somente o Discador pode mudar o nível no modo preditivo. ENTRANTE_MAN permite ao agente fazer chamadas manuais a partir de uma campanha enquanto está disponível para receber chamadas entrantes, entre as chamadas manuais. + +
+
+
+ Nível de Discagem Automática - Aqui deve ser configurado quantas linhas o VICIDIAL deve usar por agente ativo. Zero(0) significa que o discador automático está desligado e os agentes devem clicar para discar cada número. Caso contrário o VICIDIAL irá manter discando na quantidade de linhas igual ao número de agentes livres multiplicado pelo valor deste campo. O checkbox SOBREPOR APAPT permite que você force um nível de discagem mesmo que o método seja um dos ADAPT. Isto é útil quando existe uma mudança grande na qualidade dos registros e você quer mudar manualmente o nível. + +
+
+
+ Somente Lista Autom. - Este campo quando configurado como Y não considera a quantidade de chamadas entrantes nem em fila de espera para calcular a quantidade de chamadas para discagem automática. O padrão é N. + +
+
+
+ Percentual Limite de Derrubadas (drop) - Este campo é onde você configura o limite em percentual das chamadas derrubadas quando usamos um dos métodos preditivos(ADAPT), não válido para métodos MANUAL ou RATIO. + +
+
+
+ Nível Máximo de Adapt - Este campo é onde você configura o limite máximo da quantidade de linhas a usar por usuário quando usando um método preditivo (ADAPT), não válido para MANUAL ou RATIO. Este número pode ser maior que o nível de discagem automática se o seu hardware permitir. O valor deve ser um número positivo maior que 1 e pode ter casas decimáis. O padrão é 3.0. + +
+
+
+ Horário Final do Servidor - Este campo só é usado pelo método ADAPT_TAPERED. Você deve entrar com a hora e o minuto em que vai parar de fazer chamadas para esta campanha, 2100 significa que você vai parar de discar esta campanha as 21 horas. Isto permite ao algoritmo do método Tapered decidir quanto agressivo deve ser e quanto tempo tem até o horário de parar. + +
+
+
+ Modificador de Intensidade - Este campo é usado para ajustar a intensidade preditiva para cima ou para baixo. Quanto mais alto(positivo) o valor selecionado, mais o discador vai aumentar o ritmo de chamadas quando aumentar a velocidade e mais lento será para o discador diminuir a velocidade. Quanto mais negativo for o número que você selecionou, mais devagar o discador irá aumentar o ritmo quando precisar, e mais rápido diminuirá a velocidade quando precisar diminuir o ritmo. O padrão é 0. Este campo não é usado pelos métodos MANUAL ou RATIO. . + +
+
+
+ Alvo da Diferença de Nível - Este campo é usado para definir se você quer alcançar um número específico de agentes esperando chamadas ou chamadas esperando agentes. Por exemplo: se você gostaria de sempre ter em média um agente livre para receber chamadas imediatamente, você configura como -1, se você gostaria que sempre houvesse uma chamada esperando por agente, você configura como 1. O padrão é 0. Este campo não é usado pelos métodos MANUAL e RATIO. + +
+
+
+ Transferências Simultâneas - Esta configuração é usada para definir o número de chamadas que podem ser enviadas para agentes ao mesmo tempo. É recomendado que esta configuração seja deixada em AUTO. Este campo não é usado pelo método MANUAL de discagem. + +
+
+
+ Prioridade da Fila - Valor utilizado para definir a ordem na qual as chamadas dessa campanha de saída devem ser respondidas em relação as chamadas entrantes desta campanha em modo blended. + +
+
+
+ Varias campañas Drop Rate Grupo - Esta característica le permite establecer una campaña como miembro de una campaña de la velocidad de descenso del Grupo, o un grupo de campañas cuyas llamadas contestadas y llamadas Humanos Drop para todas las campañas en el grupo se combinarán en un porcentaje de caída compartida, o tasa de abandono. Esto le permite ejecutar varias campañas a la vez y más fácil de controlar su tasa de caída. Esto es particularmente útil en el Reino Unido, donde las regulaciones lo permiten esta disminución método del tipo de cálculo con la campaña de la agrupación por la misma empresa, incluso si hay varias campañas que la empresa está ejecutando en el mismo día. Para habilitar esta para una campaña, sólo tienes que seleccionar un grupo de la lista. Hay 10 grupos definidos en el sistema por defecto, puede ponerse en contacto con el administrador del sistema para añadir más. Desactivado por defecto. + +
+
+
+ Auto Discar Alternativo - Esta configuração é usada para automaticamente discar números alternativos enquanto os métodos RATIO e ADAPT são usados e não há contato no telefone principal para um registro com status NA, B, DC e N. Esta configuração não é usada pelo método MANUAL de discagem. EXTENDIDOS são números alternativos que são carregados no sistema fora da tela padrão de informações sobre registros. Usando EXTENDED você pode ter centenas de números de telefone para um único registro de cliente. + +
+
+
+ Tempo excedido de discagem - Se configurado, as chamadas que normalmente seriam desligadas após o tempo definido no extensions.conf serão desligadas no tempo configurado aqui, caso este valor seja menor do que o do extensions.conf. Isso permite que rapidamente sejam alterados os timeouts por campanha e que a configuração seja igual para todos os servidores. Se você está recebendo muitas chamadas de secretária eletrônica ou correio de voz, pode tentar mudar esse valor para valores entre 21 e 26 e verifique se melhora. + +
+
+
+ Extensão VDAD da Campanha - Este campo permite personalizar a extensão de transferência do VDAD. Isso permite que você use métodos de controle da chamada dependendo da sua campanha + - 8364 - mesma que 8368 + - 8365 - Irá enviar a chamada somente para o servidor no qual o agente está logado + - 8366 - Utilizado somente para campanhas de pressione-1 e pesquisa + - 8367 - Irá tentar enviar a chamada para um agente no servidor local, então irá procurar em outros servidores + - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on + - 8369 - Usado para detecção de secretária eletrônica, após a detecção segue o mesmo caminho da 8368 + - 8373 - Usado para detecção de secretária eletrônica, após a detecção segue o mesmo caminho da 8366 + +
+
+
+ Mensagem na Secretária Eletrônica - Este campo es para entrar en el sistema para jugar cuando el agente recibe un contestador automático y hace clic en el botón Responder a máquina contestadora en el marco de conferencias de transferencia. Debe establecer que esto sea un archivo de audio en la tienda de audio o un sistema TTS TTS si está habilitada en su sistema de. + +
+
+
+ Opciones WaitForSilence - Si Wait For silencio es deseada en las llamadas que se detectan como Contestadoras entonces este campo tiene esas opciones. Hay dos opciones separadas por una coma, la primera opción es el tiempo para detectar silencio en milisegundos y la segunda opción es para cuántas veces se detecta que antes de reproducir el mensaje. Por defecto está vacío para discapacitados. Un valor estándar para este sería esperar 2 segundos de silencio en dos ocasiones: 2000,2 + +
+
+
+ AMD envia para exten correio de voz- Este menu permite definir se uma mensagem deve ser deixada na secretária eletrônica quando é detectada. A chamada irá imediatamente ser direcionada para a extensão se o AMD estiver ativo e determinar que é uma secretária eletrônica. + +
+
+
+ Ação CPD AMD - Se você estiver usando o software de Detecção Sangoma ParaXip Call Progress então você deve habilitar esta configuração para DISPO que irá finalizar a chamada como AA e desligar se a chamada estiver sendo processada e ainda não foi enviada para um agente ou MESSAGE que irá enviar a chamada para o campo definido como Mensagem de Secretária Eletrônica para esta Campanha. O padrão é DISABLED. + +
+
+
+ Discagem para Número Alt. - Permite que um agente manualmente disque para o telefone alternativo ou campo address3 após o número principal tenha sido discado. + +
+
+
+ Segundos para derrubar chamada - Número de segundos entre o atendimento pelo cliente até a chamada ser considerada um DROP (derrubada), só se aplica a chamadas saintes. + +
+
+
+ Ação de Drop - Este menu permite que você escolha o que acontece com uma chamada quando esta ficou esperando mais que o tempo configurado no campo Tempo Limite de Drop. HANGUP irá simplesmente desligar a chamada, MESSAGE irá enviar a chamada para Extensão de Drop que você definiu abaixo, VOICEMAIL irá enviar a chamada para a caixa de voicemail que você definiu abaixo e IN_GROUP irá enviar a chamada para o grupo de entrada que você define abaixo + +
+
+
+ Exten do Porto Seguro - Esta é a extensão do plano de discagem designada para o porto seguro, deve tocar o arquivo de mensagem localizado no seu servidor. + +
+
+
+ Correio de Voz - Se configurado, as chamadas que normalmente seriam derrubadas por falta de agente, serão transferidas para esse Correio de Voz, irão ouvir uma mensagem e poderão gravar um recado. + +
+
+
+ Grupo de Transferência de Drop - Caso a Ação de Drop esteja configurada como IN_GROUP, a chamada será enviada para esse Grupo de Entrada após o tempo limite. + +
+
+
+ Permitir Logar sem Registro no Hopper - Quando Y, permite agentes logarem na campanha mesmo que não existam registros carregados no hopper para esta campanha. Esta funcionalidade não é necessária em campanha de Finalização(CLOSER). O padrão é N. + +
+
+
+ N marcado Hopper - Si esta opción está activada, la tolva no se ejecutará para esta campaña. Esta opción sólo está disponible cuando el método de línea se establece en Manual o ENTRANTE_MAN. Se recomienda que no habilite esta opción si usted tiene una base de datos de plomo muy grande, más de 100.000 clientes potenciales. Con n marcado Hopper, las características siguientes no funcionan: reciclaje de plomo, auto-alt-marcación, la mezcla lista, lista de pedido con X NEW. Si desea utilizar único dueño de marcado no debe tener marcado Hopper habilitado. Por defecto es n para discapacitados. + +
+
+
+ Único propietario de marcado - Si esta opción está activada, el agente sólo recibirá las pistas que están dentro de los parámetros de la propiedad. Si esto se establece a usuario entonces el agente debe ser definida por el usuario en la base de datos como el propietario de este lugar. Si esto se establece en territorio que entonces el dueño de la iniciativa debe coincidir con el territorio que figuran en la pantalla de modificación del usuario de este agente. Si esto se establece a USER_GROUP entonces el dueño de la iniciativa debe coincidir con el grupo de usuarios que el agente es un miembro de. Para que esta característica funcione el método de línea se debe establecer en Manual o ENTRANTE_MAN marcado Hopper y no debe estar activado. El valor predeterminado es NINGUNO para discapacitados. + + 0) + { + ?> +
+
+
+ Agente Seleccione territorios - Si esta opción está activada y el agente pertenece a al menos un territorio, el agente tendrá la opción de selección de territorios a los cables de línea. El agente podrá ver una lista de los territorios disponibles a inicio de sesión y tendrán la capacidad de volver a la lista territorio cuando se detuvo a cambiar sus territorios. Para esta función a la labor del único dueño de marcado opción debe configurarse con el territorio y territorios de usuario debe estar habilitado en la configuración del sistema. + + +
+
+
+ Ordem de Mesclagem - Sobrepõe a ordem nos campos Ordem de Registros e Status de Discagem. . + +
+
+
+ ID da Mescl. de Lista - ID da mesclagem de listas. Deve ter entre 2 e 20 caracteres de comprimento sem espaços ou pontos. + +
+
+
+ Nome da Mescl. de Lista - nombre descriptivo de la mezcla dela lista. Debe ser a partir de 2-50 caracteres en longitud. + +
+
+
+ Detalhes da Mescl. de Lista - Composição da Mesclagem de listas. Contém o ID, ordem, percentuais, e status que montam essa Mesclagem. Os percentuais devem sempre somar 100, e as listas devem estar ativas e configuradas na campanha em que a mesclagem vai ser configurada. + +
+
+
+ Método de Mesclagem - O método de Mesclagem de todos os ítens da lista. EVEN_MIX mistura os registros de cada parte intercalados com as outras partes, por exemplo: 1,2,3,1,2,3,1,2,3. IN_ORDER irá colocar os registros na ordem que estão listados na tela de detalhes 1,1,1,2,2,2,3,3,3. RANDOM irá colocar em ordem randômica: 1,3,2,1,1,3,2,1,3. O padrão é IN_ORDER. + +
+
+
+ Discagem Extendida na tela do Agente - Este recurso permite ao agente acessar a lista extendida de telefones alternativos para o registro, além dos campos Alt Phone e Address3, que podem ser usados no vicidial para números de telefone além do telefone principal do cliente. Os números extendidos podem ser discados automaticamente usando-se o recurso Auto-Alt-Dial nas config. da campanha, mas habilitar isso na tela do Agente irá permitir ao agente ligar para estes números a partir da tela e também alterar essas informações. + +
+
+
+ Primeiro Audio da Pesquisa - Este é o nome do arquivo de audio que é tocado assim que o cliente atende o telefone em uma campanha de pesquisa. + +
+
+
+ Digitos DTMF da Pesquisa - Este campo é onde você define os digitos que um cliente pode digitar como opção para campanha de pesquisa. Digitos válidos são 0123456789*#. Todas as opções, com exceção de Not Interested, Terceiro e Quarto dígito, irão mover a chamada para o método de Pesquisa(Pesquisa). + +
+
+
+ Digito de Não Interessado - Este campo é onde você define qual digito o cliente aperta para dizer que não está interessado. + +
+
+
+ Status de Não Interessado - Este campo é onde você seleciona o status a ser usado para Não Interessado. Se o DNC for usado e a campanha estiver configurada para Bloquear DNC então o número do telefone irá automaticamente para a lista de Não Ligar do VICIDIAL.e possivelmente a lista específica de bloqueio. + +
+
+
+ Arquivo de Aceito - Este é o arquivo de audio que é tocado quando o cliente aceita participar da pesquisa, não respondeu "não interessado" e não respondeu, se a opção de ação sem resposta for OPTOUT. Após esse arquivo de audio ser tocado, a ação do método de pesquisa é realizada + +
+
+
+ Arquivo de Não Interessado - Este é o nome do arquivo de audio que é tocado quando o cliente desistiu da pesquisa, não aceitou a pesquisa ou não respondeu, caso a ação para sem resposta seja OPTIN. Após este arquivo de audio ser tocado, a chamada será desligada. + +
+
+
+ Método de Pesquisa - Esta opção define o que acontece com uma chamada após o cliente ter aceitado a pesquisa. AGENT_XFER irá enviar a chamada para o próximo agente disponível. VOICEMAIL irá enviar a chamada para o voicemail especificado no campo Correio de Voz. EXTENSION irá enviar o cliente para uma extensão definida no campo Extensão de Transf. HANGUP irá desligar o cliente. CAMPREC_60_WAV irá enviar o cliente para que grave uma resposta, esta gravação ficará na pasta com o nome da campanha, dentro do diretório de gravações da Campanha de Pesquisa + +
+
+
+ Ação p/ Sem Resposta - Aqui é definido o que acontece se não há resposta para a pergunta da pesquisa. OPTIN só irá enviar a chamada para o método de pesquisa se o cliente apertar algum digito DTMF. OPTOUT irá enviar o cliente para o método mesmo que ele não pressione um dígito. + +
+
+
+ Mapa de Digitos de Resposta - Aqui você pode definir uma descrição para representar cada dígito que o cliente pode selecionar + +
+
+
+ Extensão de Transfer. - Se o método de pesquisa selecionado for EXTENSION o cliente será transferido para esta extensão do plano de discagem. + +
+
+
+ Diretório de Gravação - Se o método de pesquisa selecionado for CAMPREC_60_WAV então o cliente poderá gravar uma mensagem que será colocada no diretório com o nome da campanha, dentro deste diretório + +
+
+
+ Terceiro Dígito - Isto permite que exista um terceiro caminho se o terceiro dígito conforme definido por este campo for pressionado pelo cliente. + +
+
+
+ Quarto Dígito - Isto permite que exista um quarto caminho se o quarto digito conforme digitado neste campo for digitado pelo cliente. + +
+
+
+ Terceiro Arquivo de Audio - Este é o terceiro arquivo de audio a ser tocado assim que seja selecionado pelo cliente a terceira opção. + +
+
+
+ Terceiro Status - Este é o terceiro status usado para a chamada assim que o cliente escolhe a terceira opção. + +
+
+
+ Terceira Extensão - Esta é a terceira extensão usada pela chamada assim que é selecionada pelo cliente a terceira opção. O padrão é 8300 que imediatamente desliga a chamada após a mensagem de audio é reproduzida. + +
+
+
+ Agente de pantalla Dialable Leads - Esta opción se mostrará si está habilitado el número de derivaciones dialable disponibles en la campaña en la pantalla del agente. Este segundo número se actualiza en el sistema una vez por minuto y se actualiza en la pantalla del agente por cada par de. + + + +
+
+
+ Próximo Agente - Isto determina qual agente recebe a próxima chamada disponível: +
  - random: ordena por um número randômico de atualizações na tabela vicidial_live_agents +
  - oldest_call_start: ordena pela última vez que um agente recebeu uma chamada. Resulta nos agentes recebendo uma média igual de chamadas. +
  - oldest_call_finish: ordena pela última vez que um agente finalizou uma chamada. Também conhecido como agente que está mais tempo esperando cliente, recebe a primeira chamada. +
  - overall_user_level: ordena pelo nível do usuário do agente conforme definido na tabela vicidial_users, um valor mais alto irá receber mais chamadas. +
  - campaign_rank: ordena pelo ranking dado para o agente na campanha. Mais alto para Mais baixo. +
  - fewest_calls: ordena pelo número de chamadas recebidas por um agente para o grupo de entrada específico. Menor qtd de chamadas primeiro. +
  - longest_wait_time: pedidos por la cantidad de tiempo que el agente ha estado activamente la espera de una llamada de. + +
+
+
+ Horário de chamada local - Aqui é onde se configura o horário que se deseja discar, conforme determinação do horário no local para o qual está se discando. Isto é controlado por código de área e é ajustado para o horário de verão caso esteja em vigor. A recomendação para os EUA é de empresa para empresa, das 9:00 as 17:00 e da empresa para consumidor, das 9:00 as 21:00. + +
+
+
+ Prefixo de Discagem - Este campo permite que facilmente configuremos o caminho de discagem sem precisar alteração de configurações de servidor e sem precisar recarregar o Asterisk. O padrão é 9 baseado em 91NXXNXXXXXX no plano de discagem - extensions.conf. + +
+
+
+ Omitir o Código do Telefone - Este campo permite que você deixe o campo código do telefone de fora quando discando pelo VICIDIAL. Por exemplo se você estiver discando dentro do Reino Unido você teria 44 como seu código do telefone nos registros, mas você só quer discar 10 digitos no seu plano de discagem para fazer a chamada, ao invés de 44 mais 10 digitos. Padrão é N. + +
+
+
+ CallerID da Campanha- Este campo permite que seja enviado um número customizado de CallerID nas chamadas saintes. Este número irá ser mostrado no Identificador da pessoa que você está chamando. O padrão é UNKNOWN. Se você está usando T1 ou E1 para discar esta opção está disponível apenas se estiver usando PRIs - ISDN T1 ou E1 - que tenham o recurso de customizar o callerID habilitados, isso nao irá funcionar em circuitos RBS (Robbed-bit Service). Isto também funciona na maioria dos provedores SIP ou IAX que permitem customizar callerID. O callerID customizado se aplica apenas a chamadas feitas por campanhas VICIDIAL diretamente, qualquer chamadas de terceiros ou transferências nao receberá o callerID customizado. ATENÇÃO: algumas vezes colocando-se UNKNOWN ou PRIVATE neste campo pode causar que seja enviado o callerID da sua operadora. Você pode testar isso colocando 00000000000 no campo callerid se você nao quer enviar seu CallerID . + +
+
+
+ Extensão de Gravação - Este campo permite que se use uma extensão de gravação customizada com o VICIDIAL. Isto permite que sejas usadas extensões diferentes dependendo de quanto tempo máximo você quer permitir uma gravação e que tipo de codec você quer usar. A extensão padrão é 8309 a qual, se você seguiu os exemplos do SCRATCH_INSTALL irá gravar as chamadas no formato WAV até uma hora. Outra opção incluida nos exemplos é 8310 que irá gravar no formato GSM até uma hora. + +
+
+
+ Gravação da Campanha - Este menu permite que você escolha o nível de gravação permitido para esta campanha. NEVER irá desabilitar a gravação no client. ONDEMAND é o padrão e permite ao agente iniciar e parar a gravação conforme necessário. ALLCALLS irá iniciar a gravação assim que uma chamada for enviada para o client. ALLFORCE irá iniciar gravação no client assim que uma chamada for enviada ao agente e não dando opção ao agente de parar a gravação. Para ALLCALLS e ALLFORCE existe uma opção para usar o atraso de gravação para evitar gravações curtas e reduzir carga no servidor. + +
+
+
+ Nome do Arquivo de Gravação - Este campo permite que seja customizado o nome do arquivo de gravação quando a configuração de gravação da campanha esteja em ONDEMAND ou ALLCALLS. As variáveis permitidas sao CAMPANHA CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. O padrão é FULLDATE_AGENTE e se parece assim: 20051020-103108-6666. Outro exemplo é CAMPANHA_TINYDATE_CUSTPHONE que se parece assim: TESTCAMP_51020103108_312551212. 50 char max. + +
+
+
+ Atraso de Gravação - Somente para gravações ALLCALLS e ALLFORCE. Esta configuração irá atrasar a gravação da chamada o tempo em segundos especificado no campo. O padrão é 0. + +
+
+
+ Script da Campanha - Este menu permite que seja escolhido um script que irá aparecer na tela do agente para essa campanha. Selecione NONE para não mostrar scripts para esta campanha. + +
+
+
+ Abrir com Chamada - Este menu permite que seja escolhido se você deseja abrir automaticamente a pagina web em uma janela separada, abrir a aba SCRIPT ou nao fazer nada quando uma chamada é enviada ao agente para esta campanha. + +
+
+
+ Xfer-Conf DTMF - Estos cuatro campos permiten que usted tenga dos conjuntos de transferencia de la Conferencia y presets DTMF. Cuando se carga la llamada o de la campaña, la secuencia de comandos vicidial.php mostrará dos botones en el marco de la transferencia de conferencias y rellenará de forma automática el número a marcar y el enviar los campos DTMF cuando se presiona. Si desea permitir Consultivo transferencias, un Fronter a una mayor, que el agente utiliza la casilla de consulta, que no funciona por falta de terceros Vicidial llamadas de consulta. Para aquellos que sólo tienen el agente, haga clic en el dial con el botón del cliente. Entonces, el agente puede dejar-3way-CALL y pasar a la siguiente llamada. Si desea permitir la transferencia ciega de los clientes a una secuencia de comandos AGI Vicidial para el registro o un IVR, a continuación, AXFER lugar en el número a marcar el terreno. También puede especificar una extensión personalizada después de la AXFER, por ejemplo, si usted quiere hacer una llamada a un IVR especiales que se han fijado a la extensión 83900 pondrías AXFER83900 en el número a marcar el terreno. + +
+
+
+ Rápida transferencia Button - Esta opción agrega un botón de la transferencia rápida a la pantalla por debajo de la agente de transferencia de botón Conf. que permitirá la transferencia de un solo clic ciego de llamadas a los seleccionados en Grupo o un número. IN_GROUP enviará pide al Grupo de Xfer predeterminado para esta campaña, o en grupo-si hay una llamada entrante. Las opciones predeterminadas enviará las llamadas a los preset seleccionado. Por defecto es n para discapacitados. + +
+
+
+ Transferencia de rellenar previamente Preset - Esta opción le proporcione el número telefónico al campo en el marco de la Conferencia de transferencia de la pantalla si el agente definido. Por defecto es n para discapacitados. + +
+
+
+ Temporizador de Acción de - Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. + +
+
+
+ Temporizador de mensaje de acción - Este es el mensaje que aparece en la pantalla del agente en el momento de la acción del temporizador se dispara. + +
+
+
+ Temporizador Segundos Acción - Esta es la cantidad de tiempo después de la llamada se conecta a los clientes que se desencadena la acción del temporizador. El valor predeterminado es -1, que también está inactivo. + +
+
+
+ Chamadas Agendadas - Permite um agente classificar uma chamada como CALLBK e escolher uma data e hora na qual deseja que o registro seja discado. + +
+
+
+ Segundos de Pós Atendimento - Quantidade de segundos para forçar o agente esperar antes de permitir que ele receba ou faça outra chamada. O timer inicia assim que o agente desliga a chamada com o cliente, ou em caso de chamada a número alternativo, quando termina o trabalho com um registro. Valor padrão é 0 segundos. Se o timer acabar antes que o agente tenha finalizado a chamada, o agente não receberá novo registro até que finalize o atual. + +
+
+
+ Mensagem de Pós Atendimento - É uma mensagem específica da campanha a ser mostrada na tela de pós atendimento se o tempo de pós atendimento for configurado. + +
+
+
+ Usar Lista de Bloqueio Interna - Define se esta campanha deve filtrar registros levando em conta a lista de bloqueio interna. Se estiver configurada como Y, o hopper irá procurar cada número na lista de bloqueio antes de carregar. Se o número estiver na lista de bloqueio, o registro de chamada será alterado para o status DNCL assim não será chamado. Padrão é N. La opción codigoDeArea es como la opción-y, excepto que se utiliza para filtrar también un código de área en toda América del Norte desde que se está marcando, en este caso mediante la entrada en la lista 201XXXXXXX DNC podría bloquear todas las llamadas a los 201 codigoDeArea si está habilitada. + +
+
+
+ Usar Lista de Bloqueio - Este recurso define se a campanha deve filtrar registros usando a lista de Bloqueio que é específica para esta campanha. Se configurado como Y, o hopper irá procurar cada número na lista específica de Bloqueio antes de colocar o número na lista do hopper. Se estiver em uma lista específica de Bloqueio, então ele irá alterar o status do registro para DNCC para que este registro não seja discado. O padrão é N La opción codigoDeArea es como la opción-y, excepto que se utiliza para filtrar también un código de área en toda América del Norte desde que se está marcando, en este caso mediante la entrada en la lista 201XXXXXXX DNC podría bloquear todas las llamadas a los 201 codigoDeArea si está habilitada. + +
+
+
+ Grupos De entrada Permitidos - For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound-outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups. + +
+
+
+ Códigos de Pausa do Agente Ativos - Permite aos agentes selecionar códigos de pausa quando eles clicam o botão pausa no vicidial.php. Códigos de pausa são definidos por campanha no final da página de detalhes da campanha e são guardados na tabela vicidial_agent_log. O padrão é N. FORCE irá forçar o agente escolher um código de pausa se eles clicar no botão pausa. + +
+
+
+ Desabilitar Alteração nos Dados do Cliente - Quando configurada como Y, não permite ao usuário alterar registros de cliente quando o Agente finaliza a chamada. O padrão é N. + +
+
+
+ Desab. Alterar Telefone do Cliente - Se configurado como Y, não altera o telefone do cliente quando um agente finaliza a chamada. O padrão é Y. Utilice la opción Ocultar para eliminar completamente el número de teléfono del cliente de la pantalla del agente de. + +
+
+
+ Mostrar Contagem da Fila ao Agente - Quando configurada como Y, quando um cliente está esperando um agente, será demonstrado na tela do agente a quantidade de clientes em espera. O padrão é Y. + +
+
+
+ ID da Lista Manual - O list_id padrão para ser usado quando um agente faz uma chamada manual e novos registros são criados na vicidial_list. O padrão é 999. O campo pode receber somente digitos. + +
+
+
+ Filtro de Discagem Manual - Permite que você filtre as chamadas que os agentes fazem no modo manual de discagem para esta campanha por uma combinação dos seguintes: DNC - para tirar, CAMPANHALISTAS - o número deve estar nas lístas para a campanha, NONE - sem filtros na discagem manual ou lista de discagem rápida . + +
+
+
+ Cópia p/ Área de Transf. do Agente - ESTE RECURSO SÓ FUNCIONA NO INTERNET EXPLORER. Este recurso permite que você escolha um campo que será copiado para a área de transferência do agente quando uma chamada é enviada ao agente. Um uso comum para este recurso é permitir fácil uso do comando "colar" para números do cliente ou números de telefone em aplicativos cliente no computador do agente. + +
+
+
+ CallerID de Chamada a 3 - Isso define o que é enviado como número do CallerID em chamadas a 3 realizadas pelo agente. CAMPANHA usa o CallerID customizado da campanha, CUSTOMER usa o número do cliente que está ativo na tela do agente e AGENT_PHONE usa o callerID do ramal que o agente está logado. AGENT_CHOOSE permite que o agente escolha qual CallerID usar em chamadas a 3 a partir de uma lista de opções + +
+
+
+ Prefixo para Chamadas a 3 - Isso define o que será usado como prefixo de discagem nas chamadas a 3, o padrão é vazio, então o prefixo da campanha é usado, uma alternativa para se ouvir tocar é 88. + + 0) + { + ?> +
+
+
+ CQ Ativado - Configurando este campo como Y permite que os recursos de Controle de Qualidade do agente funcionem. O padrão é N. + +
+
+
+ Status de CQ - Esta área é onde você escolhe quais status de registro devem passar pelo Controle de Qualidade. Selecione o status que você quer que o CQ revise. + +
+
+
+ Turno de CQ- Este é o controle de tempo usado para trazer registros de uma campanha para o CQ. Os dias da semana são ignorados para esta função. + +
+
+
+ Entrada do Registro de CQ - Isso permite uma das seguintes ações a ser ativada na entrada de um registro de CQ para um agente. + +
+
+
+ Mostrar Gravação do CQ - Permite que uma gravação que está ligada com o registro do CQ seja mostrada na tela do agente de CQ. + +
+
+
+ Endereço WebForm de CQ - Este é o endereço do websitem que o agente de CQ pode entrar quando clicar no botão WEBFORM na tela de CQ. + +
+
+
+ Script CQ - Este é o Script que pode ser usado pelos agentes de CQ na aba SCRIPT na tela de CQ. + + +
+
+
+ Categoria de Pesquisa Vtiger- Se a integração do Vtiger estiver habilitada no sistema então esta configuração irá definir onde a página vtiger_search.php irá pesquisar o número do telefone que foi digitado. Existem 4 opções que podem ser usadas nesse campo: LEAD- Esta opção irá pesquisar apenas nos registros do Vtiger, ACCOUNT- Esta opção irá pesquisar nas contas do Vtiger e todos os contatos e sub-contatos para o número do telefone, VENDOR- Esta opção irá apenas pesquisar nos vendedores do Vtiger, ACCTID- Esta opção funciona somente para contas e irá pegar o campo vendor_lead_code no vicidial e tentará procurar no ID da conta do Vtiger. Se nao tiver sucesso irá tentar outros métodos listados que você selecionou. Múltiplas opções podem ser usadas para pesquisa, mas em bases de dados grandes não é recomendado. O padrão é LEAD. UNIFIED_CONTACT-Esta opción se utiliza la versión beta 5.1.0 Vtiger función para buscar por número de teléfono y acceder a la página de búsqueda en Vtiger. + +
+
+
+ Pesquisar contas Mortas no Vtiger - Se a integração com o Vtiger estiver habilitada nas confifurações do sistema então esta configuração define se contas apagadas serão pesquisadas quando o agente clica em WEB FORM para procurar no sistema Vtiger. DISABLED- registros apagados não serão pesquisados, ASK- registros apagados serão pesquisados e a página de pesquisa do vtiger irá perguntar ao agente se ele quer ativar a conta no Vtiger, RESURRECT- irá automaticamente ativar a conta e levar o agente para a tela da conta sem atrasos após clicar em WEB FORM. O padrão é DISABLED. + +
+
+
+ Vtiger Cria Registro de Chamada - Se a integração com Vtiger estiver habilitada, esta configuração define se um registro de atividade do Vtiger é gravado quando o agente entra na página de pesquisa do vtiger (vtiger_search). O padrão é Y. A opção DISPO irá criar um registro de chamada para a conta Vtiger sem que o agente precise ir para a página da conta no Vtiger através do botão WEB FORM. + +
+
+
+ Criar Registro de Tel. no Vtiger- Se a integração com o Vtiger estiver habilitada no sistema e a Categoria de Pesquisa no Vtiger incluir LEAD, esta configuração define se um novo registro da chamada do Vtiger é criado quando o agente entra na página de pesquisa do vtiger e o registro não é encontrado para que se tenha um número de telefone. O padrão é Y. + +
+
+
+ Tela de Login do Vtiger - Se a integração do Vtiger estiver habilitada então esta configuração irá definir se o usuário será logado automaticamente na interface do Vtiger quando entra no VICIDIAL. O padrão é Y. A opção NEW_WINDOW irá abrir uma nova janela ao efetuar login na tela do agente do VICIDIAL. + +
+
+
+ Status da Chamada no Vtiger - Se a integração com o Vtiger estiver habilitada nas configurações do sistema então esta configuração irá definir se o status da conta no Vtiger irá ser atualizada com o status da chamada no VICIDIAL depois que ela foi finalizada. O padrão é N. + +
+
+
+ CRM Popup Login - Si se establece en Y, la Dirección de Popup CRM se utiliza para abrir una nueva ventana de inicio de sesión agente a esta campaña. Por defecto es n. + +
+
+
+ CRM Dirección Popup - La dirección en Internet de una página de acceso de CRM, puede tener las variables de población como la dirección de formulario web, con el VAR en el frente y con la opción - A - user_custom_one - B - para definir variables. + +
+
+
+ Iniciar llamada URL - Esta web dirección URL no es visto por el agente, sino que es llamado cada vez que una llamada se envía a un agente si se poblaron. Utiliza las mismas variables que los campos de formulario web y scripts. Esta URL no puede ser una ruta relativa. La URL de inicio no funciona para las llamadas de marcación manual. Por defecto está en blanco. + +
+
+
+ Dispo Call URL - Esta web dirección URL no es visto por el agente, sino que es llamado cada vez que una llamada es dispositioned por un agente, si se poblaron. Utiliza las mismas variables que los campos de formulario web y scripts. dispo y talk_time son las variables que puede utilizar para recuperar el agente definido por la disposición de la llamada y el tiempo de conversación real en segundos de la llamada. Esta URL no puede ser una ruta relativa. Por defecto está en blanco. + +
+
+
+ Alias de Grupo Permitidas - Se você quer permitir seus agentes a usarem alias de grupo então você deve configurar como Y. Alias de grupo são explicados melhor na seção Admin, eles permitem que os agentes usem CallerIDs diferentes para chamadas manuais que realizam. O padrão é N. + +
+
+
+ Alias de Grupo Padrão - Se você permitiu Alias de Grupo então este é o alias de grupo que será selecionado como padrão quando o agente escolhe usar um alias de grupo em uma chamada manual. O padrão é NONE ou vazio. + +
+
+
+ Agente Pide Ver en cola - Si se pone a nada, pero NINGUNO, los agentes podrán consultar los detalles de las llamadas que están esperando en la cola en la pantalla de su agente. Si se establece en un valor de número, las llamadas que aparecerá será limitada al número seleccionado. El valor predeterminado es NINGUNO. + +
+
+
+ Ver las llamadas en cola de lanzamiento - Este ajuste, si en AUTO tendrá las convocatorias en el marco de la cola aparecen en inicio de sesión por el agente en la pantalla del agente. El valor predeterminado es MANUAL. + +
+
+
+ Agente Pide Agarre en cola - Esta opción si se define Y permitirá que el agente para seleccionar la llamada que desea tomar de las llamadas en la pantalla de la cola haciendo clic en él durante la pausa. Los agentes sólo podrán coger las llamadas entrantes o las llamadas transferidas, las llamadas no de salida. Por defecto es n. + +
+
+
+ Agente de Call Re-Cola Button - Esta opción si se define Y agregará un botón Re-cliente de la cola a la pantalla del agente, permite a las agencias para enviar la llamada en una cola de AGENTDIRECT que está reservado para el único agente. Por defecto es n. + +
+
+
+ Agente de pausa después de cada llamada - Esta opción si se define como Y hará una pausa en el agente después de cada llamada automáticamente. Por defecto es n. + + + + + +



+ + VICIDIAL_LISTAS TABELA

+
+
+ ID da Lista - Este é o nome numérico da lista, não é editável após a confirmação do cadastro, deve conter somente numeros e deve ter entre 2 e 8 caracteres de comprimento. Must be a number greater than 100. + +
+
+
+ Nome da Lista - Esta é a descrição da lista, deve ter entre 2 e 20 caracteres de comprimento. + +
+
+
+ Descrição da List - É um campo texto para descrião da lista, é opicional. + +
+
+
+ Data de Alteração da Lista - Esta é a última vez que as configurações da lista foram modificadas. + +
+
+
+ Data da Última Chamada da Lista - É a data em que o último registro da lista foi discado. + +
+
+
+ Campanha - Este é a campanha que esta lista pertence. Uma lista só pode ser discada por uma campanha de cada vez. + +
+
+
+ Ativo - Indica se a lista é para ser discada ou não. + +
+
+
+ Zerar Status de chamada dos registros desta lista - Zera todos os registros desta lista colocando N para \"not called since last reset"\ e significa que qualquer registro pode ser discado agora se for do status conforme configurado na tela da campanha. + +
+
+
+ Perdí Times - Este campo le permite poner veces, separados por un guión, que esta lista se restablece automáticamente por el sistema. Los tiempos deben estar en formato de 24 horas sin puntuacion, por ejemplo 0800-1700 se restablecer la lista de las 8 AM y las 5 PM todos los días. Por defecto está vacío. + +
+
+
+ Agente de secuencias de comandos Reemplazar - Si se establece este campo, esta será la secuencia de comandos que el agente ve en su pantalla en lugar de la secuencia de comandos de campaña cuando la ventaja es de esta lista. Por defecto no se establece. + +
+
+
+ Campaña CID Override - Si se establece este campo, que reemplazarán la campaña CallerID que se establece para las llamadas que se colocan a la cabeza en esta lista. Por defecto no se establece. + +
+
+
+ Contestador automático de mensajes Override - Si se establece este campo, esto anulará el mensaje de contestador automático situado en la campaña para los clientes en esta lista. Por defecto no se establece. +
+
+
+ Drop de entrada Grupo de Override - Si se establece este campo, en este grupo se utilizará para las llamadas salientes dentro de esta lista que la caída de la campaña de salida en lugar de la caída en grupo situado en la pantalla de detalle de la campaña. Por defecto no se establece. + +
+
+
+ Xfer-Conf Número Override - Estos cinco campos permiten reemplazar la transferencia de presets Conferencia número cuando la iniciativa es de esta lista. Por defecto está en blanco. + + +
+
+
+ Lista de Bloqueio do VICIDIAL - Esta lista de bloqueio contém cada registro que foi enviado para um status de Não Ligar no sistema. Através da página: LISTAS - INCLUIR BLOQUEIO você pode manualmente adicionar números para esta lista para que não sejam ligados por campanhas que usam a lista de bloqueio interna. Existe também a opção de incluir registros em listas de bloqueio específicas de campanhas. Si usted tiene la opción de DNC activas de codigoDeArea a continuación, usted también puede usar el código de entradas de la zona este 201XXXXXXX como comodín para bloquear todas las llamadas a los 201 codigoDeArea cuando está activado. + + + +



+ + VICIDIAL_ENTRANTE_GROUPS TABELA

+
+
+ ID do Grupo - Nome curto do grupo de entrada, não é editável após confirmação, não deve conter qualquer espaços e deve ter entre 2 e 20 caracteres de comprimento. + +
+
+
+ Nome do Grupo - Descrição do grupo, deve ter entre 2 e 30 caracteres de comprimento. Não pode incluir os caracteres - + ou espaço . + +
+
+
+ Cor do Grupo - Cor mostrada no aplicativo client do VICIDIAL quando uma chamada entra para este grupo. Deve ser entre 2 e 7 caracteres de comprimento. Se for uma definição de cor em hexadecimal, você deve lembrar de colocar o # no começo ou o VICIDIAL não vai funcionar corretamente. + +
+
+
+ Ativo - Indica se o grupo será mostrado na caixa de seleção quando o agente do VICIDIAL efetua logon . + +
+
+
+ Formulário Web - Endereço customizado para o qual o botão WEB FORM no VICIDIAL leva quando clicado, nas chamadas que entram para este grupo. + +
+
+
+ Próximo Agente - Isto determina qual agente recebe a próxima chamada disponível: +
  - random: ordena por um número randômico de atualizações na tabela vicidial_live_agents +
  - oldest_call_start: ordena pela última vez que um agente recebeu uma chamada. Resulta nos agentes recebendo uma média igual de chamadas. +
  - oldest_call_finish: ordena pela última vez que um agente finalizou uma chamada. Também conhecido como agente que está mais tempo esperando cliente, recebe a primeira chamada. +
  - overall_user_level: ordena pelo nível do usuário do agente conforme definido na tabela vicidial_users, um valor mais alto irá receber mais chamadas. +
  - inbound_group_rank: ordena pelo ranking dado para um agente para um grupo de entrada. Do mais alto para o mais baixo. +
  - fewest_calls: ordena pelo número de chamadas recebidas por um agente para o grupo de entrada específico. Menor qtd de chamadas primeiro. +
  - campaign_rank: ordena pelo ranking dado para o agente na campanha. Mais alto para Mais baixo. +
  - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. +
  - longest_wait_time: pedidos por la cantidad de tiempo que el agente ha estado activamente la espera de una llamada de. +
+ +
+
+
+ Queue Priority - This setting is used to define the order in which the calls from this inbound group should be answered in relation to calls from other inbound groups. + +
+
+ Exibição do Primário - Este campo determina se uma chamada entrante para o agente VICIDIAL deve ter o nome do agente primário, se existir, exibido no campo status da tela quando uma chamada é transferida para o agente. + +
+
+
+ Script da Campanha - Este menu permite que seja escolhido um script que irá aparecer na tela do agente para essa campanha. Selecione NONE para não mostrar scripts para esta campanha. + +
+
+
+ Abrir com Chamada - Este menu permite que seja escolhido se você deseja abrir automaticamente a pagina web em uma janela separada, abrir a aba SCRIPT ou nao fazer nada quando uma chamada é enviada ao agente para esta campanha. + +
+
+
+ Xfer-Conf DTMF - Estos cuatro campos permiten que usted tenga dos conjuntos de transferencia de la Conferencia y presets DTMF. Cuando se carga la llamada o de la campaña, la secuencia de comandos vicidial.php mostrará dos botones en el marco de la transferencia de conferencias y rellenará de forma automática el número a marcar y el enviar los campos DTMF cuando se presiona. Si desea permitir Consultivo transferencias, un Fronter a una mayor, que el agente utiliza la casilla de consulta, que no funciona por falta de terceros Vicidial llamadas de consulta. Para aquellos que sólo tienen el agente, haga clic en el dial con el botón del cliente. Entonces, el agente puede dejar-3way-CALL y pasar a la siguiente llamada. Si desea permitir la transferencia ciega de los clientes a una secuencia de comandos AGI Vicidial para el registro o un IVR, a continuación, AXFER lugar en el número a marcar el terreno. También puede especificar una extensión personalizada después de la AXFER, por ejemplo, si usted quiere hacer una llamada a un IVR especiales que se han fijado a la extensión 83900 pondrías AXFER83900 en el número a marcar el terreno. + +
+
+
+ Temporizador de Acción de - Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. Esta configuración anula la configuración de la campaña. + +
+
+
+ Temporizador de mensaje de acción - Este es el mensaje que aparece en la pantalla del agente en el momento de la acción del temporizador se dispara. + +
+
+
+ Temporizador Segundos Acción - Esta es la cantidad de tiempo después de la llamada se conecta a los clientes que se desencadena la acción del temporizador. El valor predeterminado es -1, que también está inactivo. + +
+
+
+ Tempo Limite de Drop- O número em segundos que uma chamada deve ficar na fila de espera até ser considerada um DROP. + +
+
+
+ Ação de Drop - Este menu permite que você escolha o que acontece com uma chamada quando esta ficou esperando mais que o tempo configurado no campo Tempo Limite de Drop. HANGUP irá simplesmente desligar a chamada, MESSAGE irá enviar a chamada para Extensão de Drop que você definiu abaixo, VOICEMAIL irá enviar a chamada para a caixa de voicemail que você definiu abaixo e IN_GROUP irá enviar a chamada para o grupo de entrada que você define abaixo. + +
+
+
+ Extensão de Drop - Se a Ação de Drop estiver configurada como MESSAGE, este é o número do plano de discagem a ser discado para transferir a chamada após o tempo limite de drop. + +
+
+
+ Correio de Voz - If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. + +
+
+
+ Grupo de Transferência de Drop - Caso a Ação de Drop esteja configurada como IN_GROUP, a chamada será enviada para esse Grupo de Entrada após o tempo limite. + +
+
+
+ Horário de Chamada É a configuração do horário de chamada para ser usado neste grupo de entrada. Lembre-se que o horário é baseado no horário do servidor. Padrão é 24Horas. + +
+
+
+ Ação Fora do Expediente - A ação a ser realizada se o horário for fora do definido no horário de chamada para este grupo de entrada. HANGUP irá imediatamente desligar a chamada, MESSAGE irá tocar o arquivo no campo Arquivo de Mensagem Fora de Expediente, EXTENSION irá enviar a chamada para o extensão do campo Extensão Fora do Expediente no plano de discagem e VOICEMAIL irá enviar a chamada para a caixa de voicemail listada no campo de Correio de Voz Fora do Expediente, IN_GROUP irá enviar a chamada para o grupo de entrada selecionado na lista Grupo de Entrada Fora do Expediente. Padrão é MESSAGE. + +
+
+
+ Arquivo Fora do Expediente - O arquivo de audio localizado no servidor, que deve ser tocado quando a ação estiver configurada como MESSAGE. Padrão é vm-goodbye + +
+
+
+ Extensão Fora do Expediente - Extensão a ser enviada a chamada que entrar se o campo Ação estiver como EXTENSION. O padrão é 8300. + +
+
+
+ Correio de Voz Fora do Expediente- A caixa de VoiceMail a ser enviada a chamada, quando o campo Ação for VOICEMAIL. + +
+
+
+ Grupo de Transferência Fora do Expediente- Se a Ação de Fora do Expediente estiver configurada para IN_GROUP, a chamada irá ser enviada para esse grupo de entrada se ela entrar neste grupo de entrada fora do horário configurado no Horário de Chamadas para este grupo de entrada. + +
+
+
+ N de colas n Agentes - Si este campo está establecido en Y o NO_PAUSED entonces no se pide se pondrá en la cola de este grupo en si no hay agentes conectado y las llamadas se vaya a la agente n Ninguna acción de la cola. La opción NO_PAUSED no se envían también las personas que llaman a la cola si sólo hay una pausa en los agentes en el grupo. Por defecto es n. + +
+
+
+ No No Acción cola de agente - Si está activada ninguna cola Ningún Agente, entonces este campo se define en la llamada pasará si no hay agentes en la A-Group. Por defecto es el mensaje, este reproduce los archivos de sonido en el campo el valor de acción y luego cuelga el. + +
+
+
+ No hay ninguna cola Acción Agente Valor - Este es el valor de la acción anterior. El valor predeterminado es nbdy-avail-to-take-call|vm-goodbye. + +
+
+
+ Arquivo de Mensagem Boasvindas - Arquivo de audio localizado no servidor a ser tocado quando uma chamada entra. Se estiver configurado como ---NONE--- então nenhuma mensagem irá ser tocada. O padrão é ---NONE---. Este campo como con los otros campos de audio en In-grupos, con la excepción del nombre de archivo de alerta de agente, puede tener múltiples archivos de audio reproducido si se pone un tubo de lista separada de los archivos de audio en el campo. + +
+
+
+ Tocar Mensagem de Boas Vindas - Esta configuração seleciona quando tocar mensagens de boas vindas, ALWAYS irá tocar toda vez, NEVER nunca irá tocar, IF_WAIT_ONLY irá somente tocar a mensagem se a chamada não for diretamente para o agente, e YES_UNLESS_NODELAY irá sempre tocar a mensagem a não ser que a configuração de Sem Atraso estiver habilitada. O padrão é ALWAYS. + +
+
+
+ Contexto da Música de Espera- O contexto de Música de Espera a ser usado quando o cliente é colocado em espera. O padrão é default. + +
+
+
+ Arquivo de Mensagem de Espera - Arquivo de audio localizado no servidor a ser tocado em um intervalo regular quando o cliente está em espera. O padrão é generic_hold. Este arquivo de audio deve ter até 9 segundos + +
+
+
+ Intervalo de Anúncio - O tempo em segundos para esperar até tocar a mensagem de Espera. O padrão é 60. Para desabilitar a Mensagem em Espera, configuro o intervalo como 0. + +
+
+
+ Tocar Posição na Fila - Isto define se o cliente irá ouvir seu lugar na fila de atendimento quando entram na fila e também periodicamente. O padrão é N. + +
+
+
+ Tocar Tempo Estimado - Isto define se o cliente irá ouvir o tempo estimado de espera antes de ser transferido para um agente. O padrão é N. Se o cliente está em espera e ouve o tempo estimado de atendimento, o tempo mínimo que será tocado é de 15 segundos. + +
+
+
+ Opção de Tempo de Espera - Permite que você especifique uma rota para a chamada caso o tempo de espera esteja superior a quantidade de segundos configurada abaixo. O padrão é NONE. + +
+
+
+ Tempo de Opção de Espera - Se a opção de tempo de espera estiver configurado para um valor diferente de NONE, este número em segundos de tempo estimado de atendimento irá acionar esta opção de espera. O padrão é 360 segundos. + +
+
+
+ Extensão de Opção de Tempo - Se a Opção de Tempo de Espera estiver como EXTENSION, esta extensão do plano de discagem será usada para enviar a chamada quando o tempo de espera superar a configuração de tempo de espera. + +
+
+
+ VoiceMail da Opção de Espera - Se a Opção de Espera estiver como VOICEMAIL, esta é a caixa de voicemail que a chamada será direcionada, caso o tempo de espera exceda o tempo configurado na opção de tempo. + +
+
+
+ Gr. de Entr. da Opção de Espera - Se a Opção de Espera for IN_GROUP, este grupo de entrada será usado para transferir a chamada que entrar e o tempo de espera estimado for maior que o tempo da opção.. + +
+
+
+ Arquivo de Agendamento da Espera - Se a configuração de Opção de Tempo de Espera estiver como CALLERID_CALLBACK, esse arquivo será tocado e então a chamada será considerada com status de novo para a lista abaixo se o tempo estimado de espera exceder o tempo configurado. + +
+
+
+ ID da Lista de Agendamento de Espera - Se a Opção de Tempo de Espera estiver como CALLERID_CALLBACK, esta é a ID da lista na qual a chamada é adicionada como novo registro caso o tempo de chamada exceda o tempo definido na configuração . + +
+
+
+ Agente de Alerta Nombre de archivo - El archivo de audio a jugar a un agente de anunciar que una llamada está llegando a su agente. Para no utilizar esta función establezca este valor por defecto es a X. Ding. + +
+
+
+ Atraso de Alerta ao Agente - O tempo em milisegundos para esperar antes de enviar a chamada para o agente após tocar na extensão do agente. O padrão é 1000. + +
+
+
+ Grupo de Transf. Padrão - Este campo é o Grupo de Entrada padrão que será automaticamente selecionado quando um agente seleciona transferência-conferência na tela do agente. + +
+
+
+ Sobreposição de Gravação de Entrada - Este campo permite a sobreposição da configuração da gravação na campanha. Esta configuração pode ser sobreposta pela configuração de sobreposição de gravação do usuário. DISABLED não irá sobrepor a configuração da campanha. NEVER irá desabilitar a gravação no client. ONDEMAND é o padrão e permite ao agente iniciar e finalizar a gravação conforme necessário. ALLCALLS irá iniciar a gravação no client quando uma chamada é enviada ao agente. ALLFORCE irá iniciar gravação no client sempre que uma ligação é enviada ao agente sem dar opção ao agente de parar a gravação. + +
+
+
+ Nome do Arquivo de Gravação de Entrada- Este campo irá sobrepor o perfil de nome de arquivo de gravação da campanha, a não ser que esteja configurado como NONE. As variáveis permitidas são: CAMPANHA CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. O padrão é FULLDATE_AGENTE e irá ficar assim: 20051020-103108_6666. Outro exemplo é CAMPANHA_TINYDATE_CUSTPHONE que irá ficar assim: TESTCAMP_51020103108_3125551212. 50 caracteres no máximo. Padrão é NONE. + + 0) + { + ?> +
+
+
+ CQ Ativado - Configurando este campo como Y permite que os recursos de Controle de Qualidade do agente funcionem. O padrão é N. + +
+
+
+ Status de CQ - Esta área é onde você escolhe quais status de registro devem passar pelo Controle de Qualidade. Selecione o status que você quer que o CQ revise. + +
+
+
+ Turno de CQ - Este é o turno usado pelo CQ para trazer registros de CQ para um grupo de entrada. Os dias da semana são ignorados para estas funções. + +
+
+
+ Entrada do Registro de CQ - Isso permite uma das seguintes ações a ser ativada na entrada de um registro de CQ para um agente. + +
+
+
+ Mostrar Gravação do CQ - Permite que uma gravação que está ligada com o registro do CQ seja mostrada na tela do agente de CQ. + +
+
+
+ Endereço WebForm de CQ - Este é o endereço do websitem que o agente de CQ pode entrar quando clicar no botão WEBFORM na tela de CQ. + +
+
+
+ Script CQ - Este é o Script que pode ser usado pelos agentes de CQ na aba SCRIPT na tela de CQ. + + +
+
+
+ Grupo de Rechamada de Espera- Se um cliente liga de volta para este grupo de entrada mais de uma vez e esta config. estiver como NONE, então a chamada é automaticamente desviada para o Grupo de Entrada selecionado neste campo. O padrão é NONE. + +
+
+
+ Rotear Sem Atraso - Configurando como Y irá remover qualquer tempo de espera ou anuncios de audio e irá tentar enviar a chamada direto para o agente. Não sobrepõe mensagem de boas vindas e anuncios da fila de espera. O padrão é N. + +
+
+
+ Percentual Estatístico de Chamadas Atendidas em X seg - Este campo permite você configurar o número de segundos que a tela de estatísticas em tempo real demorará para calcular o percentual de chamadas atendidas que foram atendidas antes de X segundos em espera. + +
+
+
+ Iniciar llamada URL - This web URL address is not seen by the agent, but it is called every time a call is sent to an agent if it is populated. Uses the same variables as the web form fields and scripts. Default is blank. + +
+
+
+ Dispo Call URL - This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. Default is blank. + +
+
+
+ Alias de Grupo Padrão - Se você permitium Alias de Grupo para a campanha que o agente está logado, então este é o alias de grupo que é selecionado como padrão em uma chamada vindo deste grupo de entrada quando o agente escolhe um alias de grupo para uma chamada manual. O padrão é NONE ou vazio. + + + + + +



+ + VICIDIAL_ENTRANTE_DIDS TABELA

+
+
+
+ Extensão DDR- Este é o número, extensão ou DDR que irá acionar esta entrada e que você irá rotear no sistema usando este recurso. Existe um DDR padrão reservado que você pode usar que é a palavra -default- sem os traços, que irá permitir que você envie uma chamada que não pertenca a nenhum padrão existente para o DDR padrão. + +
+
+
+ Descrição do DDR - Esta é a descrição do roteamento ao DDR. + +
+
+
+ DDR Ativo - Este é o campo que você configura se o DDR está ativo ou não. O padrão é Y. + +
+
+
+ Rota DDR - Este é o tipo de rota que seu DDR irá usar. EXTEN irá enviar as chamadas para a extensão abaixo, VOICEMAIL irá enviar as chamadas para uma caixa de voicemail digitada abaixo, AGENTE irá enviar as chamadas para um agente do VICIDIAL se ele estiver logado no sistema, PHONE irá enviar a chamada para um ramal configurado abaixo, IN_GROUP irá enviar as chamadas diretamente para um grupo de entrada especificado abaixo. O padrão é EXTEN. MENU irá enviar a chamada para o menu determinado. + +
+
+
+ Extensão - Se EXTEN for selecionado como rota, então este é a extensão do plano de discagem que as chamadas serão enviadas. O padrão é 999811112, sem-serviço. + +
+
+
+ Contexto da Extensão - Se EXTEN estiver selecionado como Rota do DDR, então este é o contexto do plano de discagem para o qual as chamadas serão enviadas. O padrão é default. + +
+
+
+ Caixa de VoiceMail - Se VOICEMAIL estiver selecionado como rota de DDR, então esta é a caixa de voicemail que a chamada deve ser enviada. O padrão é vazio. + +
+
+
+ Extensão do Ramal - Se PHONE estiver selecionado na rota DDR, então esta é a extensão do ramal que as chamadas serão enviadas. + +
+
+
+ IP do Servidor do Ramal - Se PHONE estiver selecionado como rota DDR, então este é o IP do servidor do ramal que as chamadas devem ser enviadas. + +
+
+
+ Menu - Se CALLMENU estiver selecionado como Rota de DDR, então este é o Menu para o qual a chamada será transferida. + +
+
+
+ Usuário do Agente - Se AGENTE estiver selecionado como rota DDR, então este é o agente do vicidial que as chamadas devem ser enviadas. + +
+
+
+ Ação p/ Usuário não Dispon. - Se AGENTE estiver selecionado como rota de DDR, e o usuário não estiver logado ou disponível, então esta é a rota que as chamadas serão direcionadas. + +
+
+
+ Config. de Grupo de Entr. do Agente - Se AGENTE estiver selecionado como roda DDR, então este é o grupo de entrada que irá ser usado para configurações de fila na qual o cliente ficará esperando para ser direcionado ao agente. O padrão é AGENTDIRECT. + +
+
+
+ ID do Grupo de Entr. - Se IN_GROUP estiver selecionado como rota de DDR, então este é o grupo de entrada a ser enviadas as chamadas. + +
+
+
+ In-Group Call Handle Method - IN_GROUP Si se selecciona como la Ruta de DID, entonces este es el llamado método de control utilizado para estas llamadas. Cid agregar un registro de conducir nuevo con cada llamada mediante la CallerID como el número de teléfono, CIDLOOKUP intentará buscar el número de teléfono por el CallerID en todo el sistema, CIDLOOKUPRL intentará buscar el número de teléfono por el CallerID en una sola lista especificada , CIDLOOKUPRC intentará buscar el número de teléfono por el CallerID en todas las listas que pertenecen a la campaña especificada, más cerca se especifica para Vicidial Closer llamadas, ANI añadirá un nuevo registro de conducir con cada llamada mediante la ANI como el número de teléfono, ANILOOKUP intentará buscar el número de teléfono de la ANI en todo el sistema, ANILOOKUPRL intentará buscar el número de teléfono de la ANI en una sola lista especificada, XDIGITID pedirá la llamada de un código de dos dígitos X antes de la llamada se pondrá en la cola, VIDPROMPT pedirá la persona que llama por su número de identificación y creará un registro de conducir nuevo con el CallerID como el número de teléfono y el ID como el identificador de proveedor, VIDPROMPTLOOKUP intentará buscar el ID en todo el sistema, VIDPROMPTLOOKUPRL intentará búsqueda del proveedor de identificación de la identificación en una sola lista se especifica, VIDPROMPTLOOKUPRC tratará de buscar el proveedor de identificación de la identificación en todas las listas que pertenecen a la campaña especificado. El valor predeterminado es CID. + +
+
+
+ Método de Busca do Grupo de Entrada - Se IN_GROUP estiver selecionado na rota de DDR, então este é o método de pesquisa do agente a ser usado pelo grupo de entrada, LO é Balanceamento de Carga com Transbordo e irá tentar enviar a chamada para um agente no servidor local antes de tentar enviar para outro servidor, LB é balanceamento de carga e tentará enviar a chamada para o próximo agente não importando o servidor que estiver logado, SO é Somente Servidor e tentará enviar a chamada somente para agentes no mesmo servidor da chamada. O padrão é LB. + +
+
+
+ ID da Lista do Grupo de Entrada- Se IN_GROUP estiver selecionado como rota de DDR, então este é o ID da lista que os registros devem ser pesquisados e onde o novo registro será incluído se necessário. + +
+
+
+ ID da Camp. do Grp. de Entrada- Se IN_GROUP estiver selecionado como rota de DDR, então este é o ID da campanha que os registros devem ser procurados quando o método de pesquisa for CIDLOOKUPRC. + +
+
+
+ Código do Tel. de Entrada - Se IN_GROUP estiver selecionado como rota de DDR, então este é o código de telefone usado para um novo registro. + + + + +



+ + VICIDIAL_CALL MENU TABELA

+
+
+ ID do Menu - Este é o ID para este passo do menu de chamadas. Ele irá aparecer como o contexto que é usado no plano de discagem para este menu de chamadas. + +
+
+
+ Nome do Menu - Este campo é o nome descritivo do menu de chamadas. + +
+
+
+ Audio do Menu - Este campo contém o nome do arquivo para o audio que será tocado no inicio do menu. Puede introducir propmts múltiples en este campo y los demás ámbitos del sistema mediante la separación de ellos con un carácter de canalización. + +
+
+
+ Tempo max do menu - Este campo é onde você configura o tempo máximo em segundos que um menu irá aguardar o cliente digitar uma opção em DTMF. Establecer este campo a cero 0 significa que no habrá tiempo de espera después de que el sistema se juega. + +
+
+
+ Audio de tempo excedido do menu - Este campo contém o arquivo de audio a ser tocado caso o tempo máximo de espera tenha sido alcançado. O padrão é NONE para nao tocar audio. + +
+
+
+ Audio de Opção Inválida do menu - Este campo contém o nome do arquivo de audio que será tocado quando o cliente selecionar uma opção inválida. O padrão é NONE que não toca audio quando a opção é inválida. + +
+
+
+ Repetir Menu - Este campo é onde você define o número de vezes que o menu irá tocar depois da primeira vez, se nenhuma opção for escolhida pelo cliente. O padrão é 1 para repetir o menu uma vez. + +
+
+
+ Verif. Horário de Menu - Este campo é onde você seleciona se as chamadas á URA devem ser restritas a horários específicos cadastrados no Cadastro de Horários de Chamada. Se o Horário de chamada estiver vazio, esta configuração será ignorada. O padrão é 0 para desabilitado. + +
+
+
+ ID do Horário de Cham. - Este é o ID do Horário de chamadas que será usado para restringir horários de chamada para este menu, quando a opção estiver habilitada. + +
+
+
+ Rastrear Chamadas no Relat. Tempo-Real - Este campo é onde você seleciona se deseja que as chamadas devem ser rastreadas no relatório de Tempo-Real como uma chamada de URA. O padrão é 1 para ativo. + +
+
+
+ Grupo de seguimiento de - Esta es la identificación que se puede utilizar para rastrear las llamadas a este menú de llamada cuando se mira al Informe de IVR. La lista incluye CALLMENU como predeterminado, así como todos los Grupos de In -. + +
+
+
+ Valor da Opção - Este campo é onde você define a opção de menu, as opções são: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. A opção especial TIMECHECK pode ser usada somente se você habilitou a verificação de horário e existe um horário de chamadas definido para o menu. Para remover uma opção, apenas selecione a rota como REMOVE e a opção será removida quando você clicar no botão enviar. + +
+
+
+ Descrição da Opção - Este campo é onde você descreve a opção, esta descrição será colocada no plano de discagem como um comentário acima da opção. + +
+
+
+ Rota da Opção - + + +
+
+
+ Valor da rota da opção - Este campo é onde você coloca o valor que define para onde, na Opção de Rota selecionada, a chamada deve ser direcionada . + +
+
+
+ Contexto do valor da rota da opção - Este campo é opcional e somente é usado para Rotas do tipo EXTENSION. + +
+
+
+ Custom Dilplan entrada - Este campo le permite entrar en los elementos dialplan que desea para el menú de llamada. + + + + + +



+ + VICIDIAL_REMOTE_AGENTS TABELA

+
+
+ Início do ID do usuário - Esta é a ID inicial que será usada quando um agente remoto for cadastrado no sistema. Se o número de linhas estiver configurado maior que 1, este número é incrementado por um até cada linha ter sua entrada. Tenha certeza que você criou uma nova conta de usuário VICIDIAL com nível 4 ou superior se você quer que eles sejam capazes de usar a página vdremote.php para acesso remoto a esta conta. + +
+
+
+ Número de Linhas - Define quantas entradas de usuários remotos o sistema deve criar, e determina quantas linhas podem ser enviadas com segurança para o número abaixo. + +
+
+
+ IP do Servidor - Um cadastro de agente remoto só funciona em um servidor, aqui é onde você seleciona qual servidor. + +
+
+
+ Extensão Externa - Este é o número para o qual você quer que as chamadas sejam direcionadas. Tenha certeza que é um número completo do plano de discagem e que se você precisa de um 9 no começo, você o coloca aqui. Teste discando o número de um fone no sistema. + +
+
+
+ Status - Aqui é onde você desliga ou liga o agente remoto. Assim que o agente está ativo, o sistema entende que ele pode receber chamadas. Pode demorar até 30 segundos após a mudança do status para Inactive para parar de receber chamadas. + +
+
+
+ Campanha - Aqui é onde você escolhe a campanha que este agente remoto deve ser logado. Chamadas entrantes precisam usar uma campanha CLOSER e selecionar uma campanha entrante abaixo para que você receba chamadas. + +
+
+
+ Grupos de entrada - Aqui é selecionado o grupo de entrada do qual você quer receber chamadas se você selecionou uma campanha CLOSER(finalização). + + +



+ + VICIDIAL_CAMPANHA_LISTAS

+
+
+ As listas dentro desta campanha são listadas aqui, estando ativas ou desativadas será demonstrado por Y ou N e você pode ir para a tela de cadastro de listas clicando no Id na primeira coluna. + + +



+ + VICIDIAL_CAMPANHA_STATUS TABELA

+
+
+ Através do uso de status de campanha customizados, você pode ter status que somente existem para uma campanha específica. Os Status devem ter entre 1 e 8 caracteres de comprimento, a descrição deve ter entre 2-30 caracteres de comprimento e "Selectable" determina se será mostrado no VICIDIAL como um resultado. O campo RESPOSTA HUMANOA(human_answered) é usado quando é calculado o percentual de desligamento(drop), ou índice de abandono. Configurando como Y irá usar este status quando for contar chamadas atendidas por humanos A opção de categoria permite agrupar vários status em uma categoria que podem ser usados para análise estatística. + + + + 0) + { + ?> +



+ + VICIDIAL_CAMPANHA_HOTKEYS TABELA

+
+
+ Através do uso de atalhos de teclado customizados por campanha, agentes que usam o web-client do vicidial podem desligar e classificar uma chamada pressionando uma tecla do teclado. Existem duas opções de atalhos especiais que você pode usar em conjunto com discagem a Telefones Alternativos, ALTPH2 - Discar para o Tel. Alt. e ADDR3----Discagem rápida do endereço 3, permitem ao agente usar o atalho para desligar a chamada, permanecer no mesmo registro e discar outro telefone do mesmo registro. + + + + + +



+ + VICIDIAL_LEAD_RECYCLE TABELA

+
+
+ Through the use of lead recycling, you can call specific statuses of leads again at a specified interval without resetting the entire list. Lead recycling is campaign-specific and does not have to be a selected dialable status in your campaign. The attempt delay field is the number of seconds until the lead can be placed back in the hopper, this number must be at least 120 seconds. The attempt maximum field is the maximum number of times that a lead of this status can be attempted before the list needs to be reset, this number can be from 1 to 10. You can activate and deactivate a lead recycle entry with the provided links. + + + + + +



+ + STATUS DE DISCAGEM ALT.

+
+
+ Se o campo Auto Discar Alternativo estiver marcado, os registros que são finalizados sob estes status terão os números alternativos discados após qualquer um desses status de não atendidos. + + + + + +



+ + VICIDIAL CÓDIGOS DE PAUSA DO AGENTE

+
+
+ Se o Código de Pausa do Agente estiver ativa então os agentes serão capazes de escolher entre esses códigos de pausa quando clicarem no botão PAUSA em suas telas. Esta informação será então gravada na tabela de log do agente. O código de pausa deve conter somente letras e números e deve ser menor que 7 caracteres. O nome do código de pausa não pode ser maior que 30 caracteres. + + + + + +



+ + VICIDIAL_USER_GROUPS TABELA

+
+
+ Grupo de usuário - É o nome curto do grupo de usuários do Vicidial, tente não usar espaços ou caracteres especias neste campo. Máximo de 20 caracteres e mínimo de 2. + +
+
+
+ Nome do Grupo - Esta é a descrição do grupo de usuários do vicidial, máximo de 40 caracteres. + +
+
+
+ Forçar Login no Ponto - Esta opção permite você não deixar um agente entrar na interface de agente do VICIDIAL se ele não estiver logado no sistema de relógio de ponto. O padrão é N. Existe uma opção para isentar usuários admin, níveis 8 e 9. + +
+
+
+ Controle de Turno - Esta configuração permite você restringir logins do agente baseado nos turnos selecionados abaixo. OFF não irá forçar controle de turno. START irá forçar o horário de login mas não terá efeito sobre um agente que está fazendo horário além do limite final e não saiu do sistema. ALL irá forçar o horário de início e fim, retirando o agente do sistema quando o horário do turno estiver terminado. O padrão é OFF + +
+
+
+ Turnos do Grupo - Esta é uma lista selecionável de turnos que podem restringir o login do agente no sistema. + +
+
+
+ Campanhas Permitidas - Esta é uma lista selecionável de campanhas nas quais os membros deste grupo podem se logar. A opção ALL-CAMPANHAS permite aos usuários neste grupo ver e logar em qualquer campanha no sistema. + +
+
+
+ Estado del agente visible Grupos - Esta es una lista seleccionable de grupos de usuarios y las funciones de usuario al que los miembros de este grupo de usuarios pueden ver el estado de las llamadas, así como la transferencia al interior de la pantalla del agente. La opción de grupo permite a los usuarios de este grupo para ver y transferir llamadas a cualquier usuario en el sistema. La campaña-AGENTES opción permite a los usuarios en este grupo para ver y transferir llamadas a cualquier usuario en la campaña que se registran en la. + +
+
+
+ Ver estado del agente de turno - Esta opción define si el agente va a ver la cantidad de tiempo que los usuarios en su barra lateral agente han sido en su estado actual. Por defecto es n sin o con discapacidad. + + 0) + { + ?> +
+
+
+ Campanha com CQ - Esta lista selecionável de campanhas tem os membros para esse grupo de usuários que terão habilitado o controle de qualidade. A opcão ALL-CAMPANHAS permite ao usuário neste grupo fazer controle de qualidade em qualquer campanha do sistema. + +
+
+
+ Permitir CQ de Entrada- Esta é uma lista selecionável de Grupos de Entrada aos quais os membros deste grupo de usuários podem realizar Controle de Qualidade. A opção ALL-GROUPS permite que usuários deste grupo fazer Controle de Qualidade em qualquer grupo do sistema. + + + + + +



+ + VICIDIAL_SCRIPTS TABELA

+
+
+ ID do Script - Este é o nome curto do script Vicidial. É necessário que seja uma identificação única. Tente não usar espaços ou caracteres especias para este campo. Máximo de 10 caracteres, mínimo de 2 caracteres. + +
+
+ Nome do Script - Este é o título do script Vicidial. Este é um resumo curto do script. Máximo de 50 caracteres, mínimo de 2 caracteres. Não devem ser usados espaços ou caracteres especiais de qualquer forma neste campo. + +
+
+ Comentários do Script - Aqui é onde você pode colocar comentários para um Script Vicidial como: -alterado em 23 de Set.-. Máximo 255 caracteres, mínimo de 2 caracteres. + +
+
+ Texto do Script - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?

You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: + +
+ <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> + </iframe> +
+ +
+
+
+ Ativo - Isto determina se o script pode ser selecionado para ser usado na campanha. + + + + + + 0) + { + ?> +



+ + VICIDIAL_LEAD_FILTROS TABELA

+
+
+ ID do filtro - É o nome curto para o filtro de registros. Precisa ser um identificador único. Não use espaços ou caracteres especiais para este campo. Máximo de 10 caracteres e mínimo de 2 caracteres. + +
+
+ Nome do Filtro - É um nome mais descritivo para o filtro. É um resumo da função do filtro. Máximo de 30 caracteres, mínimo de 2 caracteres. + +
+
+ Comentários do Filtro - Aqui é onde são colocados comentários para um Filtro Vicidial como por exemplo -liga para todos os registros da California-. Máximo de 255 caracteres, mínimo de 2 caracteres. + +
+
+ Filtro SQL - É onde colocamos o fragmento da consulta SQL que você deseja usar para filtrar. Não inicie nem termine com AND, isso será adicionado pelo script do hopper automaticamente. Um exemplo de consulta SQL que funcionaría é: called_count \> 4 and called_count \<8 . + + + + + +



+ + VICIDIAL_HORÁRIOS DE CHAMADA TABELA

+
+
+ ID de Horário de Chamada - Este é o nome curto para a definição do tempo de discagem do Vicidial. Precisa ser um identificador único. Não use espaços ou pontos para este campo. Máximo de 10 caracteres e mínimo de 2 caracteres. + +
+
+ Nome do Horário de Chamada - Nome mais descritivo da definição de Horário de Chamada. É um resumo do Horário de Chamada. Máximo de 30 caracteres e mínimo de 2 caracteres. + +
+
+ Comentários do Horário de Chamada - Aqui devem ser colocados os comentários para a definição de Horários de chamada, por ex: "10:00 as 16:00 com chamadas restritas". Máximo de 255 caracteres . + +
+
+ Horário de Início e Fim Padrão - Este é o padrão de horário no qual chamadas são permitidas se o dia de início na semana não estiver definido. 0 é meia noite. Para evitar chamadas a qualquer horário, coloque 2400 no início e 2400 no fim. Para permitir chamadas nas 24 horas do dia, coloque 0 e 2400 nestes campos. + +
+
+ Horários de Início e Fim em dias Úteis - Estes são os horários por dia que podem ser configurados para chamada. As mesmas regras se aplicam conforme os horários de início e fim. + +
+
+ Definição de Horários por Estado - Esta é a lista de horários específica por Estado que deve ser seguida por esta definição de horário. + +
+
+ Estado da definição de horário - Código de duas letras para o estado ao qual esta definição foi configurada. Para que funcione corretamente o horário local da campanha deve ter selecionado o horário local deste estado e os registros de clientes devem ter as mesmas letras de estado. + + + + +



+ + VICIDIAL_SHIFTS TABELA

+
+
+ ID do Turno- Este é o nome curto para uma definicao de Turno. Precisa ser um identificador único. Não usar pontos ou espaços para este campo, máximo de 20 e mínimo de 2 caracteres. + +
+
+ Nome do Turno - Este é um nome mais descritivo da definição do turno. É um resumo da definição do turno. Máximo de 50 caracteres, mínimo de 2 caracteres. + +
+
+ Início do Turno- É o horário que o turno da campanha começa. Deve ter apenas números, 9:30 seria apenas 0930 e 17:00 seria 1700. + +
+
+ Duração do Turno - Este é o tempo em horas e minutos que dura o turno. 8 horas seria 08:00 e 7 horas e 30 minutos seria 7:30. + +
+
+ Dias do Turno - Nesta sessão você deve escolher os dias da semana em que este turno funciona. + + + + + +



+
+ Audio de la tienda - Esta utilidad te permite subir archivos de audio para el servidor de forma que puedan ser distribuidos a todos los servidores de Vicidial en un multi-cluster de servidores. Una nota importante, sólo dos tipos de archivos de audio de trabajo,. Archivos WAV PCM de 16 bits que se 8k y los archivos. GSM que se 8bit 8k. Por favor, verifique que los archivos tienen el formato correcto antes de subirlos aquí. + + + +



+ + VICIDIAL_MUSIC_ON_HOLD TABELA

+
+
+ Música en espera de identificación - Este es el nombre corto de una música en espera de entrada. Esto debe ser un identificador único. No utilice espacios ni puntuacion para este campo. 100 caracteres como máximo, mínimo de 2 caracteres de. + +
+
+ Música en espera Nombre - Este es un nombre más descriptivo de la música en espera de entrada. Este es un breve resumen de la música en espera contexto y se verá como un comentario en el musiconhold archivo vicidial.conf. máximo de 255 caracteres, mínimo de 2 caracteres. + +
+
+ Ativo - Esta opción le permite definir la música en espera la entrada en activo o inactivo. Inactivo eliminará la entrada de los archivos de conf. + +
+
+ Orden aleatorio - Esta opción le permite definir la reproducción de los archivos de audio en un orden aleatorio. Si se establece a N, entonces el orden definido se utilizará. + +
+
+ Filename - Para añadir un nuevo archivo de audio a una música en espera de entrada el primer archivo debe estar en la tienda de audio, puede seleccionar el archivo y haga clic en Enviar para añadirlo a la lista de archivos. Música en espera se actualiza una vez por minuto si se han producido cambios realizados. Cualquier archivo que no figuran en la música en la entrada de reserva que están presentes en la música en la carpeta celebrar serán eliminados. + + + + +



+ + VICIDIAL_TTS_PROMPTS TABELA

+
+
+ TTS ID - Este es el nombre corto de una entrada de TTS. Esto debe ser un identificador único. No utilice espacios ni puntuacion para este campo. caracteres como máximo 50, mínimo de 2 caracteres. + +
+
+ Nombre TTS - Este es un nombre más descriptivo de la entrada TTS. Este es un breve resumen de la definición de TTS. 100 caracteres como máximo, mínimo de 2 caracteres de. + +
+
+ Ativo - Esta opción le permite establecer la entrada de TTS a activos o inactivos. + +
+
+ TTS Texto - Este es el texto real de campo de datos de voz que se envía a Cepstral para la creación del archivo de audio que deben desempeñar para el cliente. Usted puede utilizar Speech Syntesis Markup Language-SSML-en este campo, por ejemplo,, <break time='1000ms'/> de 1 segundo descanso. También puede utilizar varias variables como el nombre, apellido y el título como variables Vicidial tal como lo harías en una secuencia de comandos: - A - first_name - B -. Aquí está una lista de las variables disponibles:lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner + + + + +



+ + VICIDIAL_VOICEMAIL TABELA

+
+
+ ID de correo de voz - Este es el identificador de todos los números de este buzón. Esto no debe ser un duplicado de un mensaje de voz existentes de identificación o la identificación del correo de voz de un teléfono en el sistema, mínimo de 2 caracteres. + +
+
+ Name - Este es el nombre asociado a este buzón de voz. 100 caracteres como máximo, mínimo de 2 caracteres de. + +
+
+ Password - Esta es la contraseña que se utiliza para acceder al buzón de voz cuando se marca para revisar los mensajes máximo 10 caracteres, mínimo de 2 caracteres. + +
+
+ Ativo - Esta opción le permite configurar la casilla de correo de voz activo o inactivo. Si el cuadro está inactivo no se puede dejar mensajes en él y no se puede revisar los mensajes en él. + +
+
+ Email - Este ajuste opcional le permite tener los mensajes de correo de voz enviado a una cuenta de correo electrónico, si su sistema está configurado para enviar correo electrónico. Si este campo está vacío, entonces no los correos electrónicos se envían. + +
+
+ Eliminar correo de voz después del email - Este ajuste opcional le permite tener los mensajes de correo de voz se elimina del sistema después de haber sido enviado por correo electrónico a cabo. Por defecto es n. + + + + + 0) + { + ?> + +



+ + FUNCIONALIDADE DE CARREGADOR DE LISTA DO VICIDIAL

+
+
+ O carregador de registros baseado em Web do VICIDIAL simplesmente recebe um arquivo de registros, de até 8MB, que é delimitado por tab ou pipe e o carrega na tabela vicidial_list. O Carregador permite escolher os campos, e os formatos TXT - Texto Simples, CSV - Separado por Virgulas, e XLS - Excel. O carregador de arquivos não valida dados, mas permite que você verifique duplicidades nele próprio, na campanha ou no sistema inteiro. Também, tenha certeza que você criou a lista em que esses registros serão carregados antes de carregar o arquivo. Aqui está uma lista dos campos e sua ordem correta para o arquivo de registros: +
    +
  1. Código do Vendedor no Registro - é mostrado no campo Vendor ID na tela do agente +
  2. Código Fonte - uso interno, somente para admins e DBAs +
  3. ID da Lista - número da lista em que esses registros vão ser carregados +
  4. Código do Telefone - prefixo do número do telefone - 1 para EUA, 01144 para Reino Unido, 01161 para Australia, 55 para Brasil, etc +
  5. Número do telefone - deve ter pelo menos 8 digitos +
  6. Título - título do cliente(Sr. Sra. Srta., etc...) +
  7. Nome +
  8. Inicial do Meio +
  9. Sobrenome +
  10. Endereço, linha 1 +
  11. Endereço, linha 2 +
  12. Endereço, linha 3 +
  13. Cidade +
  14. Estado - limitado a 2 caracteres +
  15. Província +
  16. CEP +
  17. País +
  18. Sexo +
  19. Data de Nascimento +
  20. Número Alternativo +
  21. Endereço de Email +
  22. Frase de Segurança +
  23. Comentários +
+ +
ATENÇÃO: A funcionalidade de carregar registros usando arquivos EXCEL é permitida por uma série de scripts e precisa estar devidamente configurada no arquivo /etc/astguiclient.conf no servidor web. Também, alguns módulos perl devem ser carregados para que funcione, OLE-Storage_Lite e Spreadsheet-ParseExcel. Você pode verificar erros de tempo de execução neles olhando o arquivo de log do apache. Também, para verificação de duplicados na lista da campanha, a lista com os novos registros precisa existir no sistema antes de iniciar a carga. + + + + +



+ + + + + + + TABELA DE RAMAIS

+
+
+ Número do Ramal - Este campo é onde você coloca o número do ramal conforme aparece no Asterisk sem incluir o protocolo ou a barra no começo. Por exemplo: para o ramal SIP\/test101 o número do ramal seria test101. Também, para os ramais IAX2 tenha certeza de usar o nome completo: IAX2/IAXphone1@IAXphone1 seria IAXphone1@IAXphone1. Para Zap tenha certeza que você usa o canal completo: Zap/25-1 seria 25-1. Outro aviso, tenha certeza que você configura o protocolo abaixo corretamente para seu tipo de telefone. + +
+
+
+ Numero do plano de discagem - Este campo é para o número que você disca para tocar o ramal. Esse número é definido no arquivo extensions.conf do seu servidor Asterisk + +
+
+
+ Caixa Postal - Este campo é para a caixa postal de voz para onde vao as menssagens para o usuário deste ramal. Utilizamos isto para verificar as mensagens e para o usuário utilizar o botão VOICEMAIL no aplicativo astGUIclient. + +
+
+
+ Identificador de Saída - Este campo é onde deve ser colocado o número que você quer que saia no identificador para as ligações de saída feitas pelo astguiclient. Isto não funciona em linhas RTB(non-PRI) T1/E1. + +
+
+
+ Endereço IP do ramal - Este campo é para o endereço IP do ramal se for um ramal VOIP. Este campo é opcional + +
+
+
+ Endereço IP do computador - Este campo é para o endereço IP do computador do usuário. Este campo é opcional + +
+
+
+ IP do Servidor - Este menu é onde você escolhe em qual servidor está o ramal ativo. + +
+
+
+ Login - O login usado pelo usuário do ramal para logar no aplicativo client. + +
+
+
+ Senha - A senha usada pelo usuário do ramal para entrar no aplicativo client. Importante, esta es la única contraseña para la red de interfaz de usuario del agente de teléfono, para cambiar el sip.conf iax.conf o contraseña, o en secreto, para este dispositivo de teléfono que tenga que modificar el campo Archivo Secreto Conf. más abajo en esta página. + +
+
+
+ Status - O status do ramal no sistema, ATIVO e ADMIN permiten que os clientes GUI trabalhem. ADMIN permite o acceso ao Website de administração. Os outros status não permitem o acceso ao GUI ou ao Website de Admin. + +
+
+
+ Conta ativa - Se o ramal está ativado será incluído na lista do cliente GUI. + +
+
+
+ Tipo de Ramal - Somente para informação administrativa. + +
+
+
+ Nome Completo - Usado pelo GUIclient na lista de ramais ativos. + +
+
+
+ Empresa - Somente para informação administrativa. + +
+
+
+ Email do Ramal - Endereço de email associado ao ramal. Isto pode ser usado para configurações de VoiceMail. + +
+
+ Eliminar correo de voz después del email - Este ajuste opcional le permite tener los mensajes de correo de voz se elimina del sistema después de haber sido enviado por correo electrónico a cabo. Por defecto es n. + +
+
+
+ Foto - Ainda não implementado. + +
+
+
+ Novas Mensagens - Número de mensagens novas na conta de correio de voz para esse ramal no servidor Asterisk. + +
+
+
+ Mensagens Antigas - . + +
+
+
+ Protocolo Client - O protocolo que o ramal utiliza para se conectar com o servidor Asterisk: SIP, IAX2, Zap. Também, para os números Externos ou número de discagem rápida que você deseja listar como ramais. + +
+
+
+ GMT Local - A diferença a partir do horário de Greenwich, ou Horário ZULU para o local onde o ramal está localizado. NÃO AJUSTE PARA O HORÁRIO DE VERÃO. É usado pela campanha do VICIDIAL para demonstrar corretamente o horário local e o horário do cliente.. + +
+
+
+ Teléfono Anillo de tiempo de espera - Esta es la cantidad de tiempo, en segundos, que el teléfono sonará en el dialplan antes de enviar la llamada al buzón de voz. El valor predeterminado es 60 segundos. + +
+
+
+ Login de Gerenciamento- Este é o login que o client GUI para esse ramal usará para acessar o Banco de Dados onde os dados do servidor residem . + +
+
+
+ Senha de Gerenciamento - Esta é a senha que o client GUI para esse ramal usará para acessar o Banco de Dados onde os dados do servidor residem. + +
+
+
+ Usuário padrão do VICIDIAL - O valor desse campo será colocado no campo de usuário quando esse ramal entrar no aplicativo astVICIDIAL . + +
+
+
+ Senha padrão VICIDIAL - Este valor de senha será preenchido no campo da senha do usuário quando esse ramal entrar no aplicativo astVICIDIAL . + +
+
+
+ Campanha padrão do VICIDIAL - Este campo deve ser preenchido com o valor padrão para o campo da campanha quando este ramal abrir o aplicativo astVICIDIAL. Deixe em branco para nenhuma campanha. + +
+
+
+ Exten de Estacionamento - Esta é a extensão de estacionamento padrao para o aplicativo client. Verifique se a extensão funciona antes de alterar.. + +
+
+
+ Exten de Conferência - Esta é a extensão padrao para estacionamento da conferência para o aplicativo client. Verifique se a extensão funciona antes de alterar. + +
+
+
+ Extensão de estacionamento do VICIDIAL - Esta é a extensão de estacionamento para o aplicativo client VICIDIAL. Verifique se a extensão funciona antes de alterar. + +
+
+
+ Arquivo do VICIDIAL Park - Este é o nome do arquivo padrao para a extensão de estacionamento do VICIDIAL usado pelo aplicativo cliente. Verifique se um arquivo diferente funciona antes de alterar. Limitado a 10 caracteres. + +
+
+
+ Prefixo do monitor - Este é o prefixo do plano de discagem para monitorar canais automaticamente dentro do aplicativo astGUIclient. Só altere de acordo com os registros de ZapBarge do arquivo extensions.conf. + +
+
+
+ Exten de Gravação - Esta é a extensão do plano de discagem que irá entrar na sala de conferências e gravar a conversa. Normalmente dura por volta de uma hora se nao for cancelada. Verifique no arquivo extensions.conf antes de alterar. + +
+
+
+ Exten principal de VMAIL- Esta é a extensão do plano de discagem que acessa o voicemail. Verifique o arquivo extensions.conf antes de alterar. + +
+
+
+ Descarga Exten de VMAIL - Esta é a extensão do plano de discagem usada para deixar mensagens no correio de voz. + +
+
+
+ Contexto do Exten - Este es el contexto del plan de marcado que las solicitudes de agente, como Vicidial, principalmente el uso. Se supone que todos los números marcados por las aplicaciones cliente utilizan este contexto, por lo que es una buena idea para asegurarse de que este es el contexto más amplio posible. verificar con el archivo extensions.conf antes de cambiar. por defecto es por defecto. + +
+
+
+ Teléfono Contexto - Este es el contexto del plan de marcado que este teléfono se utiliza para marcar. Si está ejecutando un centro de llamadas y usted no desea que sus agentes sean capaces de marcar fuera de la aplicación Vicidial por ejemplo, entonces puedes establecer este campo a un contexto dialplan que no existe, algo como agente nodial. por defecto es por defecto. + +
+
+
+ Conf. Archivo Secreto - Este es el secreto o la contraseña, por el teléfono de la SIP IAX o auto-generados conf para este teléfono. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. + +
+
+
+ Canal de envio de DTMF - Este é canal usado para enviar tons DTMF nas conferencias meetme do aplicativo client. Verifique a exten e o contexto no arquivo extensions.conf. + +
+
+
+ Grupo de Saída - Este é o grupo de canais em que as chamadas saintes são feitas. Existem algumas rotinas no aplicativo cliente que usam isso. Para canais Zap você deve fazer algo como Zap/g2, para trunks IAX2 voce deve usar o prefixo completo como: IAX2/VICItest1:secret@10.10.10.15:4569. Verifique os trunks no arquivo extensions.conf, normalmente é o que voce definiu na variavel global TRUNK no inicio do arquivo. + +
+
+
+ Local do Browser - Isto se aplica apenas a clientes UNIX/LINUX, é o caminho absoluto para os browsers Mozilla ou Firefox na maquina. Verifique isso executando-o manualmente. + +
+
+
+ Diretório de Instalação - Este é o local onde os scripts do astGUIclient e astVICIDIAL estão localizados na sua maquina. Para Win32 deve ser algo como: C:\\AST_VICI e para UNIX deve ser algo como /usr/local/perl_TK. Verifique isso manualmente. + +
+
+
+ URL do Identificador - + +
+
+
+ URL default do VICIDIAL - Este é o endereço da página usada para customizar pesquisas do VICIDIAL. O endereço padrão de testes é: htpp://astguiclient.sf.net/test_VICIDIAL_output.php + +
+
+
+ Registro de chamada - Esta configuração terá valor true se o arquivo call_log.agi estiver no arquivo extensions.conf para todas as extensões de saida e de desligamento (hangup). Isso deve sempre estar true pois é obrigado para que muitas funcionalidades do astGUIclient e do VICIDIAL funcionem corretamente. + +
+
+
+ Conmutación del usuario - fije para verdad para permitir que el usuario cambie a otra cuenta del usuario. NOTA: Si los interruptores del usuario ellos pueden iniciar la grabación en la conversación de teléfono del nuevo usuario + +
+
+
+ Conferencias - Configurado como true, permite o usuário iniciar conferências de até seis telefones externos. + +
+
+
+ Hangup do Admin - Configurado como true permite que o usuário desligue qualquer linha através do astGUIclient. Uma boa ideia é somente permitir isso para usuários Admin. + +
+
+
+ Sequestro do Admin - Configure como true para permitir que o usuário consiga pegar qualquer linha e transferir para seu ramal através do astGUIclient. Uma boa ideia é permitir somente para o usuário Admin. Mas é muito útil para gerentes. + +
+
+
+ Monitoramento Admin - Configure como true para permitir que o usuário consiga pegar qualquer linha e transferir para seu ramal através do astGUIclient. Uma boa ideia é permitir somente para o usuário Admin. Mas é muito útil para gerentes. + +
+
+
+ Estacionamento de chamadas - Se configurado como true permite o usuário estacionar as chamadas pelo astGUIclient para que sejam capturadas por outros usuários do sistema. Chamadas ficam estacionadas por até meia hora e depois são desligadas. Normalmente é habilitado para todos. + +
+
+
+ Verif. de Updater - Se configurado como true, mostra um aviso em popup que o tempo do atualizador nao mudou em 20 segundos. Útil para usuários Admin. + +
+
+
+ Registro AF - Se configurado como true, grava várias ações do uso do astGUIclient para um arquivo texto no computador do usuário. + +
+
+
+ Habilitar Fila - Configure como true para que os aplicativos cliente usem o controle central de Filas do Asterisk. Requerido e recomendado para todos os usuários. + +
+
+
+ Popup do CallerID - Configurado como true permite que números configurados no arquivo extensions.conf enviem telas popup de Identificação (CallerID) para os usuários. + +
+
+
+ Botão do VMail - Configurado como true irá mostrar o botao do VOICEMAIL (correio de voz) e o contador de mensagens no astGUIclient. + +
+
+
+ Atualização Rápida - Configure como true para habilitar uma nova velocidade de atualização das informações sobre a chamada no astGUIclient. A velocidade padrão quando desabilitado é de 1000ms ou 1 segundo. Pode aumentar a carga no sistema se esse tempo for reduzido. + +
+
+
+ Tempo de Atualização Rápida - em milisegundos. Só é usado se a opção "Atualização Rápida" estiver habilitada. O valor padrão desabilitado é 1000ms, 1 segundo. Pode aumentar a carga do sistema se esse valor for reduzido. + +
+
+
+ MySQL Permanente- Se estiver habilitada, a conexão do astGUIclient permanecerá ativa ao invés de conectar a cada segundo. Útil se você tiver um tempo de atualização curto. Pode aumentar a quantidade de conexões no servidor MySQL. + +
+
+
+ Discar próximo número automaticamente- Se habilitado o aplicativo client do VICIDIAL irá discar o próximo número automaticamente no desligamento de uma chamada, a não ser que o usuário selecione "Parar Discagem" na tela de finalização da chamada. + +
+
+
+ Parar gravação após cada chamada- Se habilitado o client do VICIDIAL irá parar de gravar após o final de cada chamada. Útil se você está fazendo muitas gravações ou se está usando o formulário web para acionar a gravação. + +
+
+
+ Habilitar Mensagens SIPSAK - Se habilitado, o servidor irá mandar mensagens para o fone SIP mostrar no display quando logado no VICIDIAL. Este recurso só funciona com telefones SIP e requer o aplicativo sipsak instalado no servidor web. Padrão é 0. + +
+
+
+ Servidor DBX - O servidor de banco de dados que este usuário deve se conectar. + +
+
+
+ Base de dados DBX - A base de dados MySQL que o usuário deve se conectar. Padrão é asterisk. + +
+
+
+ Usuário do DBX - O login de usuário do MySQL que esse usuário deve usar para conectar. Default é cron. + +
+
+
+ Senha do DBX - Senha do usuário de conexão do MySQL. Padrão é 1234. + +
+
+
+ Porta DBX - A porta TCP de conexão com o MySQL que o usuário deve usar para conectar. Padrão é 3306. + +
+
+
+ Servidor DBY - O servidor de banco de dados que este usuário deve se conectar. Secundário server, não utilizado atualmente. + +
+
+
+ Base de dados DBY - A base de dados MySQL que o usuário deve se conectar. Padrão é asterisk. Secundário server, não utilizado atualmente. + +
+
+
+ Usuário do DBY - O login de usuário do MySQL que esse usuário deve usar para conectar. Default é cron. Secundário server, não utilizado atualmente. + +
+
+
+ Senha do DBY - Senha do usuário de conexão do MySQL. Padrao é 1234. Secundário server, não utilizado atualmente. + +
+
+
+ Porta DBY - A porta TCP de conexão com o MySQL que o usuário deve usar para conectar. Padrao é 3306. Secundário server, não utilizado atualmente. + +
+
+
+ ID do Alias - O ID do alias usado para permitir balanceamento de carga entre ramais. Não é permitido espacos ou caracteres especiais. Deve ter entre 2 e 20 caracteres. + +
+
+
+ Nome do Alias - O nome usado para descrever o alias do ramal, deve ter entre 2 e 50 caracteres. + +
+
+
+ Lista de Logins de Ramais - Uma lista, separada por vírgulas, logins de ramais usados quando o agente está usando ramais do balanceamento de carga. O aplicativo agente irá encontrar o servidor ativo com a menor quantidade de agentes logados e fazer a chamada a partir daquele servidor para o agente no login. + +
+
+
+ ID do Template - Este é o ID do Template de arquivo conf que este ramal irá usar para as configurações do Asterisk. O padrão é --NONE--. + +
+
+
+ Conf Override Settings - If populated, and the ID do Template is set to --NONE-- then the contents of this field are used as the conf file entries for this phone. generate_vicidial_conf for this phones server must be set to Y for this to work. This field should NOT contain the [extension] line, that will be automatically generated. + +
+
+
+ ID do Alias de Grupo - É o ID do alias de grupo usado por agentes do sistema para realizar chamadas pela interface do VICIDIAL com CallerIDs diferentes. Não é permitido uso de caracteres especiais ou espaços. Deve ter entre 2 e 20 caracteres. + +
+
+
+ Nome do Alias de Grupo - O nome usado para descrever um alias de grupo, Deve ter entre 2 e 20 caracteres de comprimento. + +
+
+
+ Número do CallerID - O Número do Caller ID usado para este alias de grupo. Deve ter apenas dígitos. + +
+
+
+ Nome do CallerID - O Nome do Caller ID que é enviado com esse Alias de Grupo. Até onde sabemos isso só funciona nos circuitos PRI do Canadá e usando trunk IAX com Asterisk. + + + + +



+ + TABELA DOS SERVIDORES

+
+
+ ID do Servidor - Este campo é onde você configura o nome dos servidores Asterisk, nao precisa ser o domínio oficial, apenas um apelido para identificar o servidor para usuários Admin. + +
+
+
+ Descrição do Servidor - O campo onde você usa uma pequena descrição para o servidor Asterisk. + +
+
+
+ Endereço IP do Servidor - O campo onde você configura o endereço IP do servidor Asterisk. + +
+
+
+ Ativo - Configure se o servidor está ativo ou não. + +
+
+
+ Carga do Sistema - Estas duas estatísticas mostram a média de carga de um sistema vezes 100 e o percentual de uso de CPU do servidor, atualizados a cada minuto. A média de carga deve ser em média menor que 100 multiplicado pelo número de núcleos de CPU que seu sistema tem, para melhor performance. O percentual de uso do CPU deve ficar abaixo de 50 para melhor performance. + +
+
+
+ Canais Falando - Este campo mostra o número atual de canais ativos no Asterisk que estão falando neste momento. É importante perceber que o número de canais do Asterisk é normalmente muito mais alto do que as chamadas atuais do sistema. Este campo é atualizado a cada minuto. + +
+
+
+ Uso do HD - Este campo irá mostrar o uso de disco para cada partição neste servidor. Este campo é atualizado a cada minuto. + +
+
+
+ Versão do Asterisk - Configure a versão do Asterisk que está instalada no servidor. Exemplos: '1.2', '1.0.8', '1.0.7', 'CVS_HEAD', 'REALLY OLD', etc... Isto é necessário pois as versões 1.0.8 e 1.0.9 tem metodos diferentes de controlar canais Local, um erro foi arrumado na CVS v1.0, e precisa ser tratado de forma diferente quando usamos os canais "Local". Também, a versão atual CVS_HEAD e a 1.2 usam managers diferentes e os resultados dos comandos devem ser tratados de forma diferente. + +
+
+
+ Qtd máxima de trunks VICIDIAL - Este campo determina o número máximo de linhas que o discador automático do VICIDIAL irá usar para chamar esse servidor. Se você quer dedicar dois canais E1 para discagem automática do VICIDIAL nesse servidor, entao você deve configurar como 60. O valor padrão é 96. + +
+
+
+ Máx. de Chamadas por Segundo - Esta configuração determina o número máximo de chamadas que podem ser feitas pelo script de discagem automática neste servidor por segundo. Deve ser de 1 a 100. O padrão é 20 + +
+
+
+ Host Telnet - Este é o endereço ou nome do servidor Asterisk e é como os aplicativos de gerenciamento se conectam a ele. Se os aplicativos de gerenciamento estiverem sendo executados no próprio servidor Asterisk, então 'localhost' está correto. + +
+
+
+ Porta Telnet - Esta é a porta para conexão com o Manager do servidor Asterisk e é como os aplicativos de gerenciamento se conectam a ele. A porta padrão é '5038' e funciona normalmente com a instalação padrão. + +
+
+
+ Usuário do Manager - O nome do usuário (login) usado para conectar genericamente ao serviço do Manager do Asterisk. O padrão é 'cron' + +
+
+
+ Senha do Manager - A senha usada para a conexão com o serviço do Manager do Asterisk. O padrão é '1234' + +
+
+
+ Usuário de atualização do Manager -O nome do usuário (login) otimizado para atualizações, para se conectar ao serviço do Manager do Asterisk. O padrão é 'updatecron' e asume que a senha é a mesma do usuário genérico. + +
+
+
+ Usuário de Escuta do Manager - O nome de usuário (login) otimizado para escutar eventos de saída, usado para conectar ao serviço de Manager do Asterisk. Padrão é 'listencron' e assume que a senha é a mesma do usuário genérico. + +
+
+
+ Usuário de envio do Manager - O nome de usuário (login) otimizado para enviar Ações para o manager, para se conectar ao serviço do Manager do Asterisk. O Valor padrão é 'sendcron' e assume que a senha é a mesma do usuário genérico. + +
+
+
+ Conf. Archivo Secreto - Este es el secreto, o la contraseña, para que el servidor en el auto iax generado conf para este servidor en otros servidores. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. + +
+
+
+ Diferença GMT do Servidor- A diferença em horas a partir do horário GMT de onde se encontra o servidor, nao ajustada para o horário de verão. O padrão é '-5' + +
+
+
+ Exten de descarga de Correio de Voz - É o prefixo de exten usado neste servidor para enviar chamadas diretamente pelo agc para uma caixa postal específica. O padrão é '85026666666666' + +
+
+
+ Exten DA do Vicidial - A extensão padrão caso não haja nenhuma na campanha para enviar chamadas do Discador Automático VICIDIAL. Valor Padrão é '8365' + +
+
+
+ Contexto Padrão - O contexto padrão usado para scripts que operam nesse servidor. O valor padrão é 'default' + +
+
+
+ Performance do Sistema - Configurar esta opção como Y irá habilitar a gravação de log de estatísticas de performance do sistema para o servidor, processos do sistema e canais em uso no Asterisk. O padrão é N. + +
+
+
+ Logs do Servidor - Configurando esta opção como Y irá habilitar a gravação de log de todos os scripts do VICIDIAL em arquivos texto. Configurando como N irá parar de escrever logs para os arquivos desses processos, também a gravação de log do Asterisk estará desabilitada se estiver configurada como N quando o Asterisk iniciar. O padrão é Y . + +
+
+
+ Saída AGI - Configurando esta opção como NONE irá desabilitar a saída de todos os scripts AGI do VICIDIAL. Configurando como STDERR irá enviar a saída do AGI para a CLI do Asterisk. Configurando como FILE irá enviar a saída para um arquivo no diretório de log. Configurando como BOTH irá enviar a saída para ambos CLI e o arquivo de log. O padrão é FILE. + +
+
+
+ Discagem Balanceada - Se configurado como Y irá permitir que o servidor faça chamadas balanceadas para as campanhas do VICIDIAL de forma que o nível de chamadas do servidor possa ser alcançado mesmo que nao haja agentes logados nas campanhas deste servidor. Padrão é N. + +
+
+
+ Balance Vicidial Rank - Este campo le permite establecer el orden en que este servidor se va a utilizar para la marcación de equilibrio, si está activada la marcación de equilibrio. El servidor con el rango más alto será usado primero en la colocación de Balance llenar las llamadas. Por defecto es 0. + +
+
+
+ Limites de Balanceamento do VICIDIAL - Esta configuração define o número de trunks não disponíveis ao uso balanceado do VICIDIAL. Por exemplo, se você tem 40 trunks máximos e o limite de balanceamento for 10, você só poderá usar 30 linhas do trunk para balanceamento VICIDIAL. Padrão é 0. + +
+
+
+ Link Web de Gravação - Esta configuração permite que você altere o padrão do link apresentado na tela de gravação no site admin. O padrão é SERVER_IP. + +
+
+
+ IP do Serv. Altern. de Gravação- Esta configuração é onde você pode colocar um IP do servidor ou outro nome de máquina que pode ser usado para colocar no lugar do server_ip nos links de gravação nas páginas do site admin. O padrão é vazio. + +
+
+
+ Servidor Asterisk Ativo - Se o Asterisk não estiver rodando neste servidor, ou se o VICIDIAL não deveria estar usando este servidor, ou se estiver usando este servidor para outros scripts como o de carregamento de hopper, você deve configurar para N. O padrão é Y. + +
+
+
+ Ativo Server Agent - Al establecer esta opción a N de impedir que los agentes de poder acceder a este servidor a través de la pantalla del agente Vicidial. Esto es muy útil cuando se utiliza una carga de inicio de sesión de instalación del teléfono equilibrada. Por defecto es Y. + +
+
+
+ Gerar Arquivos Conf - Se você deseja que o sistema gere automaticamente os arquivos conf do asterisk baseados nas configurações de ramal, operadoras, e balanceamento de carga no VICIDIAL então configure como Y. O padrão é Y. + +
+
+
+ Reconstruir Arquivos Conf - Se você quer forçar a reconstrução dos arquivos conf do Asterisk ou se qualquer um dos ramais ou operadoras foi alterado então isso deve ser Y. Após os aquivos conf terem sido criados e o Asterisk ter sido recarregado, então isso será alterado para N. O padrão é Y. + +
+
+
+ Volver a generar música en espera - Si desea forzar una reconstrucción de la música en los archivos de la bodega o si la música en las entradas de espera ni entradas de servidor han cambiado entonces esto debe establecerse en Y. Después de la música en espera los archivos se han sincronizado y volver a cargar entonces esto va a ser cambiado a N. defecto es Y. + +
+
+
+ Actualización de los sonidos - Si desea forzar una comprobación de los archivos de sonido en este servidor, y el almacén central de audio está activado como una configuración del sistema, este campo permitirán a los sonidos de actualización para ejecutar en la parte superior de la siguiente minuto. Toda vez que un archivo de audio se carga desde la interfaz web de este se ajusta automáticamente a Y para todos los servidores que tienen activos de Asterisk. Por defecto es n. + +
+
+
+ Grabación Vicidial Límite - Este campo es donde se define el número máximo de minutos que una grabación de la llamada iniciada por Vicidial puede ser. Por defecto es de 60 minutos. + +
+
+
+ Portador de registro activo - Esta configuración le permite registrar todos los códigos de retorno para colgar cualquier lista de marcación saliente llamadas que están haciendo. Por defecto es N. + + + + + + +



+ + vicidial_conf_templates TABELA

+
+
+ ID da Template - Este campo precisa ter pelo menos 2 caracteres de comprimento e não mais que 15 caracteres, sem espaços. Este é o ID que irá ser usado para identificar o template de conf no sistema. + +
+
+
+ Nome da Template - Este é o nome descritivo da configuração da template. + +
+
+
+ Conteúdo da Template - Este campo é onde você pode configurar itens específicos para serem usados por todos os ramais e/ou todas as operadoras que estão configuradas para usar este template. Campos que NÃO devem ser incluídos nesse ítem são: secret, accountcode, account, username e mailbox. + + + + + +



+ + vicidial_server_carriers TABELA

+
+
+ ID da Operadora - Este campo precisa ter entre 2 e 15 caracteres de comprimento, sem espaços. Este é o ID que irá ser usado para identificar a operadora no sistema. + +
+
+
+ Nome da Operadora - Este é o nome descritivo da operadora no sistema. + +
+
+
+ Descripción Carrier - Éste se coloca en los comentarios de los archivos de conf asterisco encima del dialplan y anotaciones en cuenta. Máximo 255 caracteres. + +
+
+
+ String de Registro - Este campo é onde você coloca a string necessária na configuração do IAX ou SIP para registrar a operadora. Opcional mas altamente recomendado se sua operadora permite registro . + +
+
+
+ ID do Template - Este campo opcional permite você escolha um template para esta configuração de operadora. + +
+
+
+ Dados da Conta - Este campo é usado se você não selecionou um template para ser usado, e é onde você pode entrar com configurações específicas para serem usadas para esta operadora. Se você receberá chamadas entrantes desta operadora, você deve configurar o context=trunkinbound neste campo para que possa ser usado o processo de controle de DDR do VICIDIAL. + +
+
+
+ Protocolo - Este campo permite que você defina o protocolo a ser usado para esta configuração de operadora. Atualmente somente IAX e SIP são suportados. + +
+
+
+ String Global- Este campo opcional permite definir uma variável global para uso desta operadora no plano de discagem. + +
+
+
+ Plano de Discagem- Este campo opcional permite definir um conjunto de entradas no plano de discagem para serem usados com esta operadora. + +
+
+
+ IP do Servidor - Este é o servidor que este registro de operadora está configurado. + +
+
+
+ Ativo - Isto define se a operadora irá ser incluída nos arquivos conf gerados automáticamente ou não. + + + + + +



+ + TABELA DE CONFERÊNCIAS

+
+
+ Número da Conferência - Este é o campo onde deve ser colocado o número do plano de discagem da conferência. Também é recomendado que o número da conferência esteja também no arquivo meetme.conf. É usado para as conferências do astGUIclient e para funcionalidade de chamada a três no VICIDIAL. + +
+
+
+ IP do Servidor - Deve ser selecionado qual servidor Asterisk esta conferência está configurada. + + + + + 0) + { + ?> +



+ + VICIDIAL_SERVER_TRUNKS TABELA

+
+
+ Trunks do Servidor VICIDIAL permitem que você limite as linhas que são usadas para saída neste servidor para discagem de campanhas ou por cada campanha. Você tem a opção de reservar um número específico de linhas a serem usadas por apenas uma campanha assim como permitir que esta campanha rode nas linhas garantidas a ela e usar linhas que estão abertas, somente se a quantidade total de linhas usadas for menor que a configuração de máximo. Não havendo nenhuma dessas configurações irá permitir que a campanha que discar primeiro, ter quantas linhas ela puder pegar até a quantidade máxima configurada. + + + + + +



+ + SYSTEM_SETTINGS TABELA

+
+
+ Uso Não-Latino - Esta opção permite configurar o padrão de visualização para usar caracteres UTF8 e não filtrar com expressões regulares os caracteres da família dos latinos ou mostrar formatação. Padrão é 0. + +
+
+
+ Raiz Web Gravável - Esta configuração permite que você define se os arquivos temporários e de autenticação devem ser gravados na raiz do website ou do servidor web. Padrão é 1. + +
+
+
+ Mostrar Bloqueio ao Agente VICIDIAL - Este campo é usado para selecionar quando mostrar para um agente que sua sessão foi bloqueada pelo sistema, ação do gerente ou ocorrência externa. A configuração NOT_ACTIVE irá desabilitar a mensagem na tela do agente. A configuração LIVE_AGENTE só irá mostrar a mensagem de bloqueio quando o registro da vicidial_auto_calls for removido, nas situações de logout forçado ou logout de emergência. + +
+
+
+ Permitir Mensagens SIPSAK - Se configurada como 1, irá permitir que a configuração da tabela de ramais funcione corretamente, o servidor irá enviar mensagens para o telefone SIP mostrar no Mostrar LCD quando logado no VICIDIAL. Este recurso só funciona em telefones SIP e requer o aplicativo sipsak instalado no servidor web. O padrão é 0. + +
+
+
+ API do Agente Ativa - Se configurado como 1, irá permitir que a interface API do agente Funcione. O padrão é 0. + +
+
+
+ URL Home do Admin - É a URL do site que você irá se clicar no link HOME no topo da página admin.php. + +
+
+
+ Habilitar Log de Transf.- Esta opção irá gravar um regsitro de ocorrências em um arquivo no servidor web cada vez que uma chamada for transferida para um agente. O padrão é 0, desabilitado. + +
+
+
+ Fim do dia - Esta configuração define quando os usuários devem ser retirados do sistema de ponto automaticamente. Só roda uma vez por dia. Deve ter somente 4 caracteres, 2 para hora e 2 para os minutos no formato 24 horas. O padrão é 0000. + +
+
+
+ Último Sair Automático do Ponto - Este campo mostra a data do último logout automático -. + +
+
+
+ Formato da data do cabeçalho da tela do agente - Este menu permite você escolher o formato da data que é mostrada na parte de cima da tela do agente. As opções para esta configuração são: o padrão é MS_DASH_24HR
+ MS_DASH_24HR 2008-06-24 23:59:59 - Formato de data Padrão com ano mês dia seguido por horário 24 horas
+ US_SLASH_24HR 06/24/2008 23:59:59 - Formato de data dos EUA com mês dia ano seguido por horário 24 horas
+ EU_SLASH_24HR 24/06/2008 23:59:59 - Formato de data Europeu com dia mês ano seguido por horário 24 horas
+ AL_TEXT_24HR JUN 24 23:59:59 - Formato de data abreviada em texto com mes e dia seguido por horário 24 horas
+ MS_DASH_AMPM 2008-06-24 11:59:59 PM - Formato de data Padrão com ano mês dia seguido por horário 12 horas
+ US_SLASH_AMPM 06/24/2008 11:59:59 PM - Formato de data dos EUA com mês dia ano seguido por horário 12 horas
+ EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Formato de data Europeu com dia mês ano seguido por horário 12 horas
+ AL_TEXT_AMPM JUN 24 11:59:59 PM - Formato de data abreviada em texto com mes e dia seguido por horário 12 horas
+ +
+
+
+ Formato da data do cliente na tela do agente - Este menú permite você selecionar o formato para a data no fuso horário do cliente que aparece no topo das informações sobre o cliente na tela do agente. As opções para esta configuração são: o padrão é AL_TEXT_AMPM
+ MS_DASH_24HR 2008-06-24 23:59:59 - Formato de data Padrão com ano mês dia seguido por horário 24 horas
+ US_SLASH_24HR 06/24/2008 23:59:59 - Formato de data dos EUA com mês dia ano seguido por horário 24 horas
+ EU_SLASH_24HR 24/06/2008 23:59:59 - Formato de data Europeu com dia mês ano seguido por horário 24 horas
+ AL_TEXT_24HR JUN 24 23:59:59 - Formato de data abreviada em texto com mes e dia seguido por horário 24 horas
+ MS_DASH_AMPM 2008-06-24 11:59:59 PM - Formato de data Padrão com ano mês dia seguido por horário 12 horas
+ US_SLASH_AMPM 06/24/2008 11:59:59 PM - Formato de data dos EUA com mês dia ano seguido por horário 12 horas
+ EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Formato de data Europeu com dia mês ano seguido por horário 12 horas
+ AL_TEXT_AMPM JUN 24 11:59:59 PM - Formato de data abreviada em texto com mes e dia seguido por horário 12 horas
+ +
+
+
+ Formato do Telefone do Cliente na Tela do Agente - Este menú permite escolher o formato do telefone do cliente que é mostrado na seção de status da tela do agente. As opções são: o padrão é US_PARN
+ US_DASH 000-000-0000 - USA número separado por traço
+ US_PARN (000)000-0000 - USA número separado por traço, ddd entre parentesis
+ MS_NODS 0000000000 - Sem Formatação
+ UK_DASH 00 0000-0000 - UK número separado por traço com espaço após o código da cidade
+ AU_SPAC 000 000 000 - Australia número separado por espaços
+ IT_DASH 0000-000-000 - Italy número separado por traço
+ FR_SPAC 00 00 00 00 00 - France número separado por espaços
+ +
+
+
+ Agent interface API Access Ativo - This option allows you to enable or disable the agent interface API. Default is 0. + +
+
+
+ Trava para Agendamento Vinculado - Esta opção define se Agendamento Vinculado(AGENTONLY) serão travados para a campanha que o a gente originalmente agendou. Configurando como 1 significa que o agente somente pode discar para eles a partir da campanha que os configurou, 0 significa que o agente pode acessar os agendamentos não importando a campanha que eles foram criados. O padrão é 1. + +
+
+
+ Controle Central de Audio Ativado - Esta opção define se o sistema de sincronia de som está ativado entre todos os servidores. O padrão é 0 para inativo. + +
+
+
+ Servidor Web de Sons - Este é o nome do servidor ou endereço IP para o servidor web que estará controlando os arquivos de audio no sistema, isto deve combinar com o nome do servidor ou endereço IP no qual você está tentando acessar a página audio_store.php. O padrão é 127.0.0.1. + +
+
+
+ Diretório Web de Sons - Esta auto-generado nombre del directorio es creado al azar por el sistema como el lugar que la tienda de audio se mantendrá. Todos los archivos de audio residir en este directorio. + +
+
+
+ Servidor de correo de voz activo - En sistemas multi-servidor, este es el servidor que se encargará de todas las casillas de correo de voz. Este servidor es también donde la línea telefónica en mensajes generados se cargan desde el 8168 grabaciones. + +
+
+
+ Discagem Automática Ativa- Esta opção permite você habilitar ou desabilitar a discagem automática de saída do VICIDIAL, configurando este campo como 0 irá remover as seções de LISTAS e FILTROS e vários campos das telas de configuração de Campanha. Discagem Manual ainda será permitida pela tela do agente, mas a discagem por listas não será possível. O padrão é 1 para ativo. + +
+
+
+ Ratio Dial Limit - Este es el límite máximo de la escala de marcación automática en la pantalla de la campaña. + +
+
+
+ Máx. de Cham. Trasnf. por Segundo - Esta configuração determina o número máximo de chamadas que podem ser feitas pelo discador automático de saída para todos os servidores, por segundo. Deve ter entre 1 e 200 caracteres. O padrão é 40. + +
+
+
+ Permitir Custom Dialplan entradas - Esta opción le permite introducir líneas personalizadas dialplan en llamadas menús. El valor predeterminado es 0 para los inactivos. + +
+
+
+ Territorios de usuario de Ativo - Esta configuración le permite habilitar la setttings territorios de usuario desde la pantalla de modificación del usuario. Esta característica se agregó para permitir una mayor integración con una instalación personalizada Vtiger pero puede tener aplicaciones en un sistema de Vicidial pura también. Por defecto es 0 para discapacitados. + +
+
+
+ Formulario de Asistencia Segunda Habilitar - This setting allows you to have a second web form for campaigns and in-groups in the agent interface. Default is 0 for disabled. + +
+
+
+ Habilitar TTS Integración - Esta configuración le permite habilitar Texto a la integración de voz con Cepstral. Esto sólo está disponible actualmente para las campañas de tipo de encuesta de salida. Por defecto es 0 para discapacitados. + +
+
+
+ Recursos de CQ Ativos - Esta opção permite habilitar ou desabilitar os recursos de CQ ou Controle de Qualidade. O padrão é 0 para Inativo. + +
+
+
+ Habilitar Log para o QueueMetrics - Esta configuração permite que você defina se o VICIDIAL irá enviar registros de log para a base de dados queue_log conforme a atividade de Queues do Asterisk faz. QueueMetrics é um programa de fonte fechado para analise estatística. Você deve ter o QueueMetrics instalado e configurado antes de habilitar este recurso. O padrão é 0. + +
+
+
+ IP do servidor do QueueMetrics - É o IP do servidor do QueueMetrics. + +
+
+
+ Nome do BD do QueueMetrics - É o nome do banco de Dados do QueueMetrics. + +
+
+
+ Login do BD do QueueMetrics - éste es el nombre delusuario usado para abrirse una sesión a su base de datos deQueueMetrics. + +
+
+
+ Senha do BD do QueueMetrics - É a senha a ser usada para logar no DB do QueueMetrics. + +
+
+
+ URL do QueueMetrics - É a URL ou endereço do site usado para entrar na sua instalação do QueueMetrics. + +
+
+
+ ID do Log do QueueMetrics - É o ID do servidor que o VICIDIAL coloca no BD do QueueMetrics para identificação de cada registro. + +
+
+
+ Prefixo QueueMetrics EnterQueue - Este campo é usado para permitir prefixar um dos campos da tabela vicidial_list na frente do número do telefone do cliente para relatórios customizados no QueueMetrics. O padrão é NONE para não colocar nada. + +
+
+
+ Habilitar Integração com Vtiger - Esta configuração permite que seja habilitada a integração entre VICIDIAL e VTIGER. Atualmente o único tipo de integração disponível são links para o site de administração, pesquisa e replicação do cadastro de usuários. O padrão é 0. + +
+
+
+ IP do Serv. BD Vtiger - É o endereço IP do servidor de banco de dados da instalação do Vtiger. + +
+
+
+ Base de Dados Vtiger - Este é o nome da base de dados para o Vtiger. + +
+
+
+ Login do BD do Vtiger - É o nome do usuário usado para acessar o BD do Vtiger. + +
+
+
+ Senha do BD Vtiger - É a senha usada para acessar o BD do Vtiger. + +
+
+
+ URL do Vtiger - Esta é a URL ou endereço do site usado para acessar o Vtiger. + + +



+ + VICIDIAL_STATUS TABELA

+
+
+ Com o uso do status do sistema, você pode ter status que existem para campanhas e grupos de entrada. O Status deve ter entre 1 e 6 caracteres de comprimento, a descrição deve ter entre 2 e 30 caracteres de comprimento e Selecionável define se será mostrado no VICIDIAL na finalização da chamada. O campo human_answered é usado para calcular o percentual de drop, ou índice de abandono. Configurando human_answered para Y irá usar este status quando contando as chamadas atendidas por humanos. A opção de Categoria permite agrupar vários status em uma categoria que pode ser usada para análise estatística. Existem também 5 configurações adicionais que irão definir o tipo do status: sale, dnc, customer contact, not interested, unworkable. + + + +



+ + VICIDIAL_STATUS_CATEGORIES TABELA

+
+
+ Através do uso de categoria de status de sistema, você pode agrupar status para permitir análise estatística em um grupo de status. O ID da categoria deve ter entre 2 e 20 caracteres sem espaços, o nome deve ter entre 2 e 50 caracteres, a descrição é opicional e o Mostrar TimeonVDAD define se o status deve ser um dos 4 status que podem ser calculados e mostrados no relatório em tempo real Time On VDAD . A Categoria de Venda e a Categoria Registro Ruim são ambas usadas pelo sistema de Sugestão de Listas quando analisando as estatisticas da lista. + + + 0) + { + ?> +



+ + CÓDIGOS DE STATUS DE CONTROLE DE QUALIDADE

+
+
+ O sistema de Controle de Qualidade do VICIDIAL tem seu conjunto de status separados daqueles usados na finalização de chamadas do VICIDIAL. Os códigos de CQ devem ter entre 2 e 8 caracteres de comprimento e não podem conter caracteres especiais como espaços ou virgulas. A descrição do código de status de CQ deve ter entre 2 e 30 caracteres + + + + +







+







+ FIM +
+ \n"; + echo "\n"; + echo "\n"; + echo ""; + + $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $dial_statuses = $row[0]; + $local_call_time = $row[1]; + $drop_lockout_time = $row[3]; + if ($lead_filter_id=='') + { + $lead_filter_id = $row[2]; + if ($lead_filter_id=='') + { + $lead_filter_id='NONE'; + } + } + + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";} + } + $camp_lists = eregi_replace(".$","",$camp_lists); + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + + echo "

\n"; + echo "Mostrar Quantidade de Registros Discáveis -

\n"; + echo "CAMPANHA: $campaign_id
\n"; + echo "LISTAS: $camp_lists
\n"; + echo "STATUS: $dial_statuses
\n"; + echo "FILTER: $lead_filter_id
\n"; + echo "CALL TIME: $local_call_time

\n"; + + ### call function to calculate and print dialable leads + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + + echo "

\n"; + echo "\n"; + + exit; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=7111111 view sample script with test variables +###################### + +if ($ADD==7111111) + { + ##### TEST VARIABLES ##### + $vendor_lead_code = 'VENDOR:LEAD;CODE'; + $list_id = 'LISTID'; + $gmt_offset_now = 'GMTOFFSET'; + $phone_code = '1'; + $phone_number = '7275551212'; + $title = 'Mr.'; + $first_name = 'JOHN'; + $middle_initial = 'Q'; + $last_name = 'PUBLIC'; + $address1 = '1234 Main St.'; + $address2 = 'Apt. 3'; + $address3 = 'ADDRESS3'; + $city = 'CHICAGO'; + $state = 'IL'; + $province = 'PROVINCE'; + $postal_code = '33760'; + $country_code = 'USA'; + $gender = 'M'; + $date_of_birth = '1970-01-01'; + $alt_phone = '3125551111'; + $email = 'test@test.com'; + $security_phrase = 'SECUTIRY'; + $comments = 'COMMENTS FIELD'; + $RGfullname = 'JOE AGENT'; + $RGuser = '6666'; + $RGlead_id = '1234'; + $RGcampaign = 'TESTCAMP'; + $RGphone_login = 'gs102'; + $RGgroup = 'TESTCAMP'; + $RGchannel_group = 'TESTCAMP'; + $RGSQLdate = date("Y-m-d H:i:s"); + $RGepoch = date("U"); + $RGuniqueid = '1163095830.4136'; + $RGcustomer_zap_channel = 'Zap/1-1'; + $RGserver_ip = '10.10.10.15'; + $RGSIPexten = 'SIP/gs102'; + $RGsession_id = '8600051'; + $RGdialed_number = '3125551111'; + $RGdialed_label = 'ALT'; + $RGrank = '99'; + $RGowner = '6666'; + $RGcamp_script = 'TESTSCRIPT'; + $RGin_script = ''; + $script_width = '600'; + $script_height = '400'; + $recording_filename = '20091204-1639_6666_7275551212'; + $recording_id = '1235'; + $user_custom_one = 'custom one'; + $user_custom_two = 'custom two'; + $user_custom_three = 'custom three'; + $user_custom_four = 'custom four'; + $user_custom_five = 'custom five'; + $preset_number_a = 'preset_a'; + $preset_number_b = 'preset_b'; + $preset_number_c = 'preset_c'; + $preset_number_d = 'preset_d'; + $preset_number_e = 'preset_e'; + $preset_number_f = 'preset_f'; + $preset_dtmf_a = 'preset_dtmf_a'; + $preset_dtmf_b = 'preset_dtmf_b'; + + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + + $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $script_name = $row[1]; + $script_text = stripslashes($row[3]); + + if (eregi("iframe src",$script_text)) + { + $vendor_lead_code = eregi_replace(' ','+',$vendor_lead_code); + $list_id = eregi_replace(' ','+',$list_id); + $gmt_offset_now = eregi_replace(' ','+',$gmt_offset_now); + $phone_code = eregi_replace(' ','+',$phone_code); + $phone_number = eregi_replace(' ','+',$phone_number); + $title = eregi_replace(' ','+',$title); + $first_name = eregi_replace(' ','+',$first_name); + $middle_initial = eregi_replace(' ','+',$middle_initial); + $last_name = eregi_replace(' ','+',$last_name); + $address1 = eregi_replace(' ','+',$address1); + $address2 = eregi_replace(' ','+',$address2); + $address3 = eregi_replace(' ','+',$address2); + $city = eregi_replace(' ','+',$city); + $state = eregi_replace(' ','+',$state); + $province = eregi_replace(' ','+',$province); + $postal_code = eregi_replace(' ','+',$postal_code); + $country_code = eregi_replace(' ','+',$country_code); + $gender = eregi_replace(' ','+',$gender); + $date_of_birth = eregi_replace(' ','+',$date_of_birth); + $alt_phone = eregi_replace(' ','+',$alt_phone); + $email = eregi_replace(' ','+',$email); + $security_phrase = eregi_replace(' ','+',$security_phrase); + $comments = eregi_replace(' ','+',$comments); + $RGfullname = eregi_replace(' ','+',$RGfullname); + $RGuser = eregi_replace(' ','+',$RGuser); + $RGlead_id = eregi_replace(' ','+',$RGlead_id); + $RGcampaign = eregi_replace(' ','+',$RGcampaign); + $RGphone_login = eregi_replace(' ','+',$RGphone_login); + $RGgroup = eregi_replace(' ','+',$RGgroup); + $RGchannel_group = eregi_replace(' ','+',$RGchannel_group); + $RGSQLdate = eregi_replace(' ','+',$RGSQLdate); + $RGepoch = eregi_replace(' ','+',$RGepoch); + $RGuniqueid = eregi_replace(' ','+',$RGuniqueid); + $RGcustomer_zap_channel = eregi_replace(' ','+',$RGcustomer_zap_channel); + $RGserver_ip = eregi_replace(' ','+',$RGserver_ip); + $RGSIPexten = eregi_replace(' ','+',$RGSIPexten); + $RGsession_id = eregi_replace(' ','+',$RGsession_id); + $RGdialed_number = eregi_replace(' ','+',$RGdialed_number); + $RGdialed_label = eregi_replace(' ','+',$RGdialed_label); + $RGrank = eregi_replace(' ','+',$RGrank); + $RGowner = eregi_replace(' ','+',$RGowner); + $RGcamp_script = eregi_replace(' ','+',$RGcamp_script); + $RGin_script = eregi_replace(' ','+',$RGin_script); + $script_width = eregi_replace(' ','+',$script_width); + $script_height = eregi_replace(' ','+',$script_height); + $recording_filename = eregi_replace(' ','+',$recording_filename); + $recording_id = eregi_replace(' ','+',$recording_id); + $user_custom_one = eregi_replace(' ','+',$user_custom_one); + $user_custom_two = eregi_replace(' ','+',$user_custom_two); + $user_custom_three = eregi_replace(' ','+',$user_custom_three); + $user_custom_four = eregi_replace(' ','+',$user_custom_four); + $user_custom_five = eregi_replace(' ','+',$user_custom_five); + $preset_number_a = eregi_replace(' ','+',$preset_number_a); + $preset_number_b = eregi_replace(' ','+',$preset_number_b); + $preset_number_c = eregi_replace(' ','+',$preset_number_c); + $preset_number_d = eregi_replace(' ','+',$preset_number_d); + $preset_number_e = eregi_replace(' ','+',$preset_number_e); + $preset_number_f = eregi_replace(' ','+',$preset_number_f); + $preset_dtmf_a = eregi_replace(' ','+',$preset_dtmf_a); + $preset_dtmf_b = eregi_replace(' ','+',$preset_dtmf_b); + } + + $script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); + $script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); + $script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); + $script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); + $script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); + $script_text = eregi_replace('--A--title--B--',"$title",$script_text); + $script_text = eregi_replace('--A--first_name--B--',"$first_name",$script_text); + $script_text = eregi_replace('--A--middle_initial--B--',"$middle_initial",$script_text); + $script_text = eregi_replace('--A--last_name--B--',"$last_name",$script_text); + $script_text = eregi_replace('--A--address1--B--',"$address1",$script_text); + $script_text = eregi_replace('--A--address2--B--',"$address2",$script_text); + $script_text = eregi_replace('--A--address3--B--',"$address3",$script_text); + $script_text = eregi_replace('--A--city--B--',"$city",$script_text); + $script_text = eregi_replace('--A--state--B--',"$state",$script_text); + $script_text = eregi_replace('--A--province--B--',"$province",$script_text); + $script_text = eregi_replace('--A--postal_code--B--',"$postal_code",$script_text); + $script_text = eregi_replace('--A--country_code--B--',"$country_code",$script_text); + $script_text = eregi_replace('--A--gender--B--',"$gender",$script_text); + $script_text = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$script_text); + $script_text = eregi_replace('--A--alt_phone--B--',"$alt_phone",$script_text); + $script_text = eregi_replace('--A--email--B--',"$email",$script_text); + $script_text = eregi_replace('--A--security_phrase--B--',"$security_phrase",$script_text); + $script_text = eregi_replace('--A--comments--B--',"$comments",$script_text); + $script_text = eregi_replace('--A--fullname--B--',"$RGfullname",$script_text); + $script_text = eregi_replace('--A--fronter--B--',"$RGuser",$script_text); + $script_text = eregi_replace('--A--user--B--',"$RGuser",$script_text); + $script_text = eregi_replace('--A--lead_id--B--',"$RGlead_id",$script_text); + $script_text = eregi_replace('--A--campaign--B--',"$RGcampaign",$script_text); + $script_text = eregi_replace('--A--phone_login--B--',"$RGphone_login",$script_text); + $script_text = eregi_replace('--A--group--B--',"$RGgroup",$script_text); + $script_text = eregi_replace('--A--channel_group--B--',"$RGchannel_group",$script_text); + $script_text = eregi_replace('--A--SQLdate--B--',"$RGSQLdate",$script_text); + $script_text = eregi_replace('--A--epoch--B--',"$RGepoch",$script_text); + $script_text = eregi_replace('--A--uniqueid--B--',"$RGuniqueid",$script_text); + $script_text = eregi_replace('--A--customer_zap_channel--B--',"$RGcustomer_zap_channel",$script_text); + $script_text = eregi_replace('--A--server_ip--B--',"$RGserver_ip",$script_text); + $script_text = eregi_replace('--A--SIPexten--B--',"$RGSIPexten",$script_text); + $script_text = eregi_replace('--A--session_id--B--',"$RGsession_id",$script_text); + $script_text = eregi_replace('--A--dialed_number--B--',"$RGdialed_number",$script_text); + $script_text = eregi_replace('--A--dialed_label--B--',"$RGdialed_label",$script_text); + $script_text = eregi_replace('--A--rank--B--',"$RGrank",$script_text); + $script_text = eregi_replace('--A--owner--B--',"$RGowner",$script_text); + $script_text = eregi_replace('--A--camp_script--B--',"$RGcamp_script",$script_text); + $script_text = eregi_replace('--A--in_script--B--',"$RGin_script",$script_text); + $script_text = eregi_replace('--A--script_width--B--',"$script_width",$script_text); + $script_text = eregi_replace('--A--script_height--B--',"$script_height",$script_text); + $script_text = eregi_replace('--A--recording_filename--B--',"$recording_filename",$script_text); + $script_text = eregi_replace('--A--recording_id--B--',"$recording_id",$script_text); + $script_text = eregi_replace('--A--user_custom_one--B--',"$user_custom_one",$script_text); + $script_text = eregi_replace('--A--user_custom_two--B--',"$user_custom_two",$script_text); + $script_text = eregi_replace('--A--user_custom_three--B--',"$user_custom_three",$script_text); + $script_text = eregi_replace('--A--user_custom_four--B--',"$user_custom_four",$script_text); + $script_text = eregi_replace('--A--user_custom_five--B--',"$user_custom_five",$script_text); + $script_text = eregi_replace('--A--preset_number_a--B--',"$preset_number_a",$script_text); + $script_text = eregi_replace('--A--preset_number_b--B--',"$preset_number_b",$script_text); + $script_text = eregi_replace('--A--preset_number_c--B--',"$preset_number_c",$script_text); + $script_text = eregi_replace('--A--preset_number_d--B--',"$preset_number_d",$script_text); + $script_text = eregi_replace('--A--preset_number_e--B--',"$preset_number_e",$script_text); + $script_text = eregi_replace('--A--preset_number_f--B--',"$preset_number_f",$script_text); + $script_text = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$script_text); + $script_text = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$script_text); + $script_text = eregi_replace("\n","
",$script_text); + + + echo ""; + + echo "Pré-Visualizar Script: $script_id
\n"; + echo "
\n"; + echo "
$script_name
\n"; + echo "$script_text\n"; + echo "
\n"; + + echo "\n"; + + exit; + } + + +$ADMIN=$PHP_SELF; +require("admin_header.php"); + + + + + +###################################################################################################### +###################################################################################################### +####### 1 series, ADD NEW forms for inserting new records into the database +###################################################################################################### +###################################################################################################### + + +###################### +# ADD=1 display the ADD NEW USER FORM SCREEN +###################### + +if ($ADD=="1") + { + if ($LOGmodify_users==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_users' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
INCLUIR USUÁRIO
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$NWB#vicidial_users-user_group$NWE\n"; + echo "\n"; + echo "
Número do usuário: Auto-Generated $NWB#vicidial_users-user$NWE
Número do usuário: $NWB#vicidial_users-user$NWE
Senha: $NWB#vicidial_users-pass$NWE
Nome Completo: $NWB#vicidial_users-full_name$NWE
Nível do Usuário: $NWB#vicidial_users-user_level$NWE
Grupo do Usuário:
Login do Ramal: $NWB#vicidial_users-phone_login$NWE
Senha do Ramal: $NWB#vicidial_users-phone_pass$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=1A display the COPY USER FORM SCREEN +###################### + +if ($ADD=="1A") + { + if ($LOGmodify_users==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_users' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
COPIAR USUÁRIO\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + echo "\n"; + + if ($LOGuser_level==9) {$levelMAX=10;} + else {$levelMAX=$LOGuser_level;} + + echo "\n"; + echo "\n"; + echo "
Número do usuário: Auto-Generated $NWB#vicidial_users-user$NWE
Número do usuário: $NWB#vicidial_users-user$NWE
Senha: $NWB#vicidial_users-pass$NWE
Nome Completo: $NWB#vicidial_users-full_name$NWE
Source Usuário: $NWB#vicidial_users-user$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN +###################### + +if ($ADD==11) + { + if ($LOGmodify_campaigns==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_campaigns' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
NOVA CAMPANHA\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "\n"; + echo "\n"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + + $eswHTML=''; + if ($SSenable_second_webform > 0) + {$eswHTML = '';} + echo "\n"; + echo "\n"; + echo "
ID da Campanha: Auto-Generated $NWB#vicidial_campaigns-campaign_id$NWE
ID da Campanha: $NWB#vicidial_campaigns-campaign_id$NWE
Nome da Campanha: $NWB#vicidial_campaigns-campaign_name$NWE
Descrição da Campanha: $NWB#vicidial_campaigns-campaign_description$NWE
Ativo: $NWB#vicidial_campaigns-active$NWE
Extensão de Estacionamento: $NWB#vicidial_campaigns-park_ext$NWE
Nome do arquivo de Estacionamento: $NWB#vicidial_campaigns-park_file_name$NWE
Formulário Web: $NWB#vicidial_campaigns-web_form_address$NWE
Permitir Finalizadores (Closers): $NWB#vicidial_campaigns-allow_closers$NWE
Nível do Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Nível de Discagem Automática: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Próximo Agente a chamar: $NWB#vicidial_campaigns-next_agent_call$NWE
Horário Local da Chamada: $NWB#vicidial_campaigns-local_call_time$NWE
Correio de Voz: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Pegar lançamento da chamada: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=12 display the COPY CAMPAIGN FORM SCREEN +###################### + +if ($ADD==12) + { + if ($LOGmodify_campaigns==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_campaigns' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
COPIAR CAMPANHA\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "
ID da Campanha: Auto-Generated $NWB#vicidial_campaigns-campaign_id$NWE
ID da Campanha: $NWB#vicidial_campaigns-campaign_id$NWE
Nome da Campanha: $NWB#vicidial_campaigns-campaign_name$NWE
Campanha Origem:$NWB#vicidial_campaigns-campaign_id$NWE
ATENÇÃO: Copiar uma campanha irá copiar todas as configurações da campanha que você escolher, mas não irá copiar a lista de bloqueio específica da campanha que você selecionar.
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=111 display the ADD NEW LIST FORM SCREEN +###################### + +if ($ADD==111) + { + if ($LOGmodify_lists==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_lists' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
ADD A NEW LIST\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID da Lista: Auto-Generated $NWB#vicidial_lists-list_id$NWE
ID da Lista: (somente dígitos)$NWB#vicidial_lists-list_id$NWE
Nome da Lista: $NWB#vicidial_lists-list_name$NWE
Descrição da Lista: $NWB#vicidial_lists-list_description$NWE
Campanha: $NWB#vicidial_lists-campaign_id$NWE
Ativo: $NWB#vicidial_lists-active$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=121 display the ADD NUMBER TO DNC FORM SCREEN and add a new number +###################### + +if ($ADD==121) + { + echo "
\n"; + echo ""; + + $campaigns_list = "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where use_campaign_dnc IN('Y','AREACODE') order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "\n"; + $o++; + } + + if (strlen($phone_numbers) > 2) + { + $PN = explode("\n",$phone_numbers); + $PNct = count($PN); + $p=0; + while ($p < $PNct) + { + if ( (ereg('delete',$stage)) and ($LOGdelete_from_dnc > 0) ) + { + ##### BEGIN DELETE FROM DNC ##### + if (ereg('SYSTEM_INTERNAL',$campaign_id)) + { + $stmt="SELECT count(*) from vicidial_dnc where phone_number='$PN[$p]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
BLOQUEIO NÃO REMOVIDO - Este número de telefone não está na lista de bloqueio: $PN[$p]\n";} + else + { + $stmt="DELETE FROM vicidial_dnc where phone_number='$PN[$p]';"; + $rslt=mysql_query($stmt, $link); + + echo "
BLOQUEIO REMOVIDO: $PN[$p]\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='LISTAS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM DNC LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
BLOQUEIO NÃO REMOVIDO - Este número de telefone não está na lista de bloqueio: $PN[$p] $campaign_id\n";} + else + { + $stmt="DELETE FROM vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
BLOQUEIO REMOVIDO: $PN[$p] $campaign_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='LISTAS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM CAMPANHA DNC LIST $campaign_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + ##### END DELETE FROM DNC ##### + } + else + { + ##### BEGIN ADD TO DNC ##### + if (ereg('SYSTEM_INTERNAL',$campaign_id)) + { + $stmt="SELECT count(*) from vicidial_dnc where phone_number='$PN[$p]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
Bloqueio não Cadastrado - Este número já existe na lista de bloqueio: $PN[$p]\n";} + else + { + $stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');"; + $rslt=mysql_query($stmt, $link); + + echo "
Bloqueio Adicionado: $PN[$p]\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='LISTAS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN INCLUIR NÚMERO AO BLOQUEIO LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
Bloqueio não Cadastrado - Este número já existe na lista de bloqueio: $PN[$p] $campaign_id\n";} + else + { + $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$PN[$p]','$campaign_id');"; + $rslt=mysql_query($stmt, $link); + + echo "
Bloqueio Adicionado: $PN[$p] $campaign_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='LISTAS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO CAMPANHA DNC LIST $campaign_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + ##### END ADD TO DNC ##### + } + $p++; + } + } + + if ($LOGdelete_from_dnc > 0) + {echo "
INCLUIR OU REMOVER TELEFONES DA LISTA DE BLOQUEIO\n";} + else + {echo "
INCLUIR NÚMEROS PARA LISTA DE BLOQUEIO\n";} + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + if ($LOGdelete_from_dnc > 0) + { + echo "\n"; + } + echo "\n"; + echo "
List:
Números de Telefone:

(somente um telefone por linha)
$NWB#vicidial_list-dnc$NWE
Incluir ou Remover:
\n"; + } + + +###################### +# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN +###################### + +if ($ADD==1111) + { + if ($LOGmodify_ingroups==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_inbound_groups' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
NOVO GRUPO DE ENTRADA\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $eswHTML=''; + if ($SSenable_second_webform > 0) + {$eswHTML = '';} + echo "\n"; + echo "\n"; + echo "
ID do Grupo: Auto-Generated $NWB#vicidial_inbound_groups-group_id$NWE
ID do Grupo: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Nome do Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Cor do Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
Ativo: $NWB#vicidial_inbound_groups-active$NWE
Formulário Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Correio de Voz: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Próximo Agente a chamar: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Pegar lançamento da chamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=1211 display the COPY INBOUND GROUP SCREEN +###################### + +if ($ADD==1211) + { + if ($LOGmodify_ingroups==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_inbound_groups' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
COPIAR GRUPO DE ENTRADA\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
ID do Grupo: Auto-Generated $NWB#vicidial_inbound_groups-group_id$NWE
ID do Grupo: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Nome do Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Source ID do Grupo: $NWB#vicidial_inbound_groups-group_id$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=1311 display the ADD NEW DID SCREEN +###################### + +if ($ADD==1311) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
INCLUIR DDR\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Extensão DDR: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
Descrição DDR:$NWB#vicidial_inbound_dids-did_description$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=1411 display the COPY DID SCREEN +###################### + +if ($ADD==1411) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
COPIAR DDR\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
Extensão DDR: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
Descrição DDR:$NWB#vicidial_inbound_dids-did_description$NWE
DDR Origem:$NWB#vicidial_inbound_dids-did_pattern$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=1511 display the ADD NEW CALL MENU SCREEN +###################### + +if ($ADD==1511) + { + if ($LOGmodify_dids==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_call_menu' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
INCLUIR UM MENU\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "
ID do Menu: Auto-Generated $NWB#vicidial_call_menu-menu_id$NWE
ID do Menu: (no spaces or special characters)$NWB#vicidial_call_menu-menu_id$NWE
Nome do Menu: $NWB#vicidial_call_menu-menu_name$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=1611 display the COPY CALL MENU SCREEN +###################### + +if ($ADD==1611) + { + if ($LOGmodify_dids==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_call_menu' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
COPIAR UM MENU\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
ID do Menu: Auto-Generated $NWB#vicidial_call_menu-menu_id$NWE
ID do Menu: (no spaces or special characters)$NWB#vicidial_call_menu-menu_id$NWE
Nome do Menu: $NWB#vicidial_call_menu-menu_name$NWE
Menu Origem: $NWB#vicidial_call_menu-menu_id$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN +###################### + +if ($ADD==11111) + { + if ($LOGmodify_remoteagents==1) + { + echo "
\n"; + echo ""; + + echo "
NOVO AGENTE REMOTO\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Início do ID do Usuário: (somente números, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Número de linhas: (somente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP do Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
Extensão Externa: (número do plano de discagem para ligar para agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campanha: $NWB#vicidial_remote_agents-campaign_id$NWE
Grupos de Entrada: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; + echo "AVISO: Pode demorar até 30 segundos para que as alterações enviadas por essa tela se tornem ativas\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=111111 display the ADD NEW USERS GROUP SCREEN +###################### + +if ($ADD==111111) + { + if ($LOGmodify_usergroups==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_user_groups' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
NOVO GRUPO DE USUÁRIOS\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "
Grupo: Auto-Generated $NWB#vicidial_user_groups-user_group$NWE
Grupo: (sem espaços ou pontos)$NWB#vicidial_user_groups-user_group$NWE
Descrição: (descrição do grupo)$NWB#vicidial_user_groups-group_name$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=1111111 display the ADD NEW SCRIPT SCREEN +###################### + +if ($ADD==1111111) + { + if ($LOGmodify_scripts==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_scripts' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
ADD NEW SCRIPT\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Script: Auto-Generated $NWB#vicidial_scripts-script_id$NWE
ID do Script: (sem espaços ou pontos)$NWB#vicidial_scripts-script_id$NWE
Nome do Script: (título do script)$NWB#vicidial_scripts-script_name$NWE
Comentários do Script: $NWB#vicidial_scripts-script_comments$NWE
Ativo: $NWB#vicidial_scripts-active$NWE
Texto do Script: "; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=11111111 display the ADD NEW FILTER SCREEN +###################### + +if ($ADD==11111111) + { + if ($LOGmodify_filters==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_lead_filters' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
INCLUIR NOVO FILTRO\n"; + echo "\n"; + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Filtro:Auto-Generated $NWB#vicidial_lead_filters-lead_filter_id$NWE
ID do Filtro: (sem espaços ou pontos)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nome do Filtro: (descrição simples do filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Comentários do filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filtro SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=111111111 display the ADD NEW CALL TIME SCREEN +###################### + +if ($ADD==111111111) + { + if ($LOGmodify_call_times==1) + { + echo "
\n"; + echo ""; + + echo "
NOVO HORÁRIO DE CHAM.\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "
ID do Horário de Cham.: (sem espaços ou pontos)$NWB#vicidial_call_times-call_time_id$NWE
Nome do Horário de Cham.: (descrição curta do horário de chamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentários do Horário de cham.: $NWB#vicidial_call_times-call_time_comments$NWE
Opções de dia e hora irão aparecer assim que você crie definições de Horário de Chamada
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=1111111111 display the ADD NEW STATE CALL TIME SCREEN +###################### + +if ($ADD==1111111111) + { + if ($LOGmodify_call_times==1) + { + echo "
\n"; + echo ""; + + echo "
NOVO HORÁRIO DE CHAM. POR ESTADO\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "
ID do horário de chamada por estado: (sem espaços ou pontos)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (sem espaços ou pontos)$NWB#vicidial_call_times-state_call_time_state$NWE
Nome do horário de chamada por estado: (descrição curta do horário de chamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentários do horário de chamada por estado: $NWB#vicidial_call_times-call_time_comments$NWE
Opções de dia e hora irão aparecer assim que você crie definições de Horário de Chamada
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=131111111 display the ADD NEW SHIFT SCREEN +###################### + +if ($ADD==131111111) + { + if ($LOGmodify_call_times==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW SHIFT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Turno: (sem espaços ou pontos)$NWB#vicidial_shifts-shift_id$NWE
Nome do Turno: (descrição curta do turno)$NWB#vicidial_shifts-shift_name$NWE
Início do Turno:\n"; + echo "   Final do Turno:\n"; + echo " $NWB#vicidial_shifts-shift_start_time$NWE
Duração do Turno: $NWB#vicidial_shifts-shift_length$NWE
Dias do Turno:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; + echo "Domingo
\n"; + echo "Segunda
\n"; + echo "Terça
\n"; + echo "Quarta
\n"; + echo "Quinta
\n"; + echo "Sexta
\n"; + echo "Sábado
\n"; + echo "
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=11111111111 display the ADD NEW PHONE SCREEN +###################### + +if ($ADD==11111111111) + { + if ($LOGast_admin_access==1) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='phones' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $voi_count = "$row[0]"; + } + ##### END ID override optional section ##### + + echo "
\n"; + echo ""; + + echo "
INCLUIR RAMAL\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + if ($voi_count > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Extensão do Ramal: Auto-Generated $NWB#phones-extension$NWE
Extensão do Ramal: $NWB#phones-extension$NWE
Número no Plano de Discagem: (somente dígitos)$NWB#phones-dialplan_number$NWE
Caixa do Correio de Voz: (somente dígitos)$NWB#phones-voicemail_id$NWE
CallerID de Saída: (somente dígitos)$NWB#phones-outbound_cid$NWE
Endereço IP do Ramal: (optional)$NWB#phones-phone_ip$NWE
Endereço IP do Computador: (optional)$NWB#phones-computer_ip$NWE
IP do Servidor: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Senha: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Conta Ativa: $NWB#phones-active$NWE
Tipo de Ramal: $NWB#phones-phone_type$NWE
Nome Completo: $NWB#phones-fullname$NWE
Empresa: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Protocolo do Cliente: $NWB#phones-protocol$NWE
GMT Local: (NÃO ajuste para o horário de verão)$NWB#phones-local_gmt$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=12111111111 display the ADD NEW PHONE ALIAS SCREEN +###################### + +if ($ADD==12111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
INCLUIR ALIAS DE RAMAL\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
ID do Alias:$NWB#phones-alias_id$NWE
Nome do Alias: $NWB#phones-alias_name$NWE
Lista de Logins de Ramal: (comma separated)$NWB#phones-logins_list$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=13111111111 display the ADD NEW GROUP ALIAS SCREEN +###################### + +if ($ADD==13111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
INCLUIR NOVO ALIAS DE GRUPO\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
ID do Alias: $NWB#phones-group_alias_id$NWE
Nome do Alias: $NWB#phones-group_alias_name$NWE
Número CallerID: $NWB#phones-caller_id_number$NWE
Nome CallerID: $NWB#phones-caller_id_name$NWE
Ativo:
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=111111111111 display the ADD NEW SERVER SCREEN +###################### + +if ($ADD==111111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
INCLUIR SERVIDOR\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Servidor: $NWB#servers-server_id$NWE
Descrição do Servidor: $NWB#servers-server_description$NWE
Endereço IP do Servidor: $NWB#servers-server_ip$NWE
Ativo: $NWB#servers-active$NWE
Versão do Asterisk: $NWB#servers-asterisk_version$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=131111111111 display the ADD NEW CONF TEMPLATE SCREEN +###################### + +if ($ADD==131111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
INCLUIR TEMPLATE CONF\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Template: $NWB#vicidial_conf_templates-template_id$NWE
Nome do Template: $NWB#vicidial_conf_templates-template_name$NWE
Conteúdo do Template: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=141111111111 display the ADD NEW CARRIER SCREEN +###################### + +if ($ADD==141111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
Incluir Operadora\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
ID da Operadora: $NWB#vicidial_server_carriers-carrier_id$NWE
Nome da Operadora: $NWB#vicidial_server_carriers-carrier_name$NWE
Descripción Carrier: $NWB#vicidial_server_carriers-carrier_description$NWE
String de Registro: $NWB#vicidial_server_carriers-registration_string$NWE
ID do Template: $NWB#vicidial_server_carriers-template_id$NWE
Dados da Conta: $NWB#vicidial_server_carriers-account_entry$NWE
Protocolo: $NWB#vicidial_server_carriers-protocol$NWE
String Global: $NWB#vicidial_server_carriers-globals_string$NWE
Plano de Discagem: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP do Servidor: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=151111111111 display the ADD NEW TTS ENTRY SCREEN +###################### + +if ($ADD==151111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW TTS ENTRADA\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
TTS ID: $NWB#vicidial_tts_prompts-tts_id$NWE
Nombre TTS: $NWB#vicidial_tts_prompts-tts_name$NWE
Ativo:
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=161111111111 display the ADD NEW MUSIC ON HOLD ENTRY SCREEN +###################### + +if ($ADD==161111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW MUSIC EN ESPERA DE ENTRADA\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Música en espera de identificación: $NWB#vicidial_music_on_hold-moh_id$NWE
Música en espera Nombre: $NWB#vicidial_music_on_hold-moh_name$NWE
Orden aleatorio:
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=171111111111 display the ADD NEW VOICEMAIL BOX SCREEN +###################### + +if ($ADD==171111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW contestador\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
ID de correo de voz: $NWB#vicidial_voicemail-voicemail_id$NWE
Pass: $NWB#vicidial_voicemail-pass$NWE
Name: $NWB#vicidial_voicemail-fullname$NWE
Ativo:
Email:$NWB#vicidial_voicemail-email$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=1111111111111 display the ADD NEW CONFERENCE SCREEN +###################### + +if ($ADD==1111111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
INCLUIR CONFERÊNCIA\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Número da Conferência: (somente dígitos)$NWB#conferences-conf_exten$NWE
IP do Servidor: $NWB#conferences-server_ip$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=11111111111111 display the ADD NEW VICIDIAL CONFERENCE SCREEN +###################### + +if ($ADD==11111111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
ADD A NEW VICIDIAL CONFERENCE\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Número da Conferência: (somente dígitos)$NWB#conferences-conf_exten$NWE
IP do Servidor: $NWB#conferences-server_ip$NWE
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + +###################################################################################################### +###################################################################################################### +####### 2 series, validates form data and inserts the new record into the database +###################################################################################################### +###################################################################################################### + + +###################### +# ADD=2 adds the new user to the system +###################### + +if ($ADD=="2") + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_users' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $user = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$user' where id_table='vicidial_users' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
USUÁRIO NÃO ADICIONADO - já existe um usuário no sistema com esse número\n";} + else + { + if (ereg('AUTOGENERA',$user)) + { + $user = 'AUTOGENERA'; + } + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 20) and (!ereg('AUTOGENERA',$user)) ) ) + { + echo "
USUÁRIO NÃO ADICIONADO - Por favor volte e verifique os dados digitados\n"; + echo "
user id must be between 2 and 20 characters long\n"; + echo "
nome completo e senha devem ter pelo menos 2 caracteres de comprimento\n"; + echo "
usted debe seleccionar un grupo de usuarios\n"; + } + else + { + if (ereg('AUTOGENERA',$user)) + { + $new_user=0; + $auto_user_add_value=0; + while ($new_user < 2) + { + if ($new_user < 1) + { + $stmt = "SELECT auto_user_add_value FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + $ss_auav_ct = mysql_num_rows($rslt); + if ($ss_auav_ct > 0) + { + $row=mysql_fetch_row($rslt); + $auto_user_add_value = $row[0]; + } + $new_user++; + } + $stmt = "SELECT count(*) FROM vicidial_users where user='$auto_user_add_value';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + $new_user++; + } + else + { + echo "\n"; + $auto_user_add_value = ($auto_user_add_value + 7); + } + } + $user = $auto_user_add_value; + echo "
user_id has been auto-generated: $user
\n"; + + $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; + $rslt=mysql_query($stmt, $link); + } + echo "
USUÁRIO ADICIONADO: $user\n"; + + $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass) values('$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='USUÁRIOS', event_type='ADD', record_id='$user', event_code='ADMIN ADD USER', event_sql=\"$SQL_log\", event_notes='user: $user';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + $user_name = $user; + $user_password = $pass; + $last_name = $full_name; + $is_admin = 'off'; + $roleid = 'H5'; + $status = 'Ativo'; + $groupid = '1'; + if ($user_level >= 7) {$roleid = 'H3';} + if ($user_level >= 8) {$roleid = 'H4';} + if ($user_level >= 9) {$roleid = 'H2';} + if ($user_level >= 9) {$is_admin = 'on';} + $salt = substr($user_name, 0, 2); + $salt = '$1$' . $salt . '$'; + $encrypted_password = crypt($user_password, $salt); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $group_found_count = $row[0]; + + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### + + ###################################### + ##### BEGIN Add/Update user info in Vtiger + $stmt="SELECT count(*) from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + ### user exists in vtiger, update it + if ($found_count > 0) + { + $stmt="SELECT id from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $userid = $row[0]; + + $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $usergroupcount = $row[0]; + + $stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + if ($usergroupcount < 1) + { + $stmt="SELECT user_group FROM vicidial_user_groups;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VD_groups_ct = mysql_num_rows($rslt); + $k=0; + $VD_groups_list=''; + while ($k < $VD_groups_ct) + { + $row=mysql_fetch_row($rslt); + $VD_groups_list .= "'$row[0]',"; + $k++; + } + $VD_groups_list = preg_replace("/.$/",'',$VD_groups_list); + + $stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN(SELECT groupid from vtiger_groups where groupname IN($VD_groups_list));"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW USER RECORD IN VTIGER + $stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $userid = mysql_insert_id($linkV); + + $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW USER RECORD IN VTIGER + } + ##### END Add/Update user info in Vtiger + ###################################### + } + ### END vtiger integration + } + } + + $ADD=3; + } + +###################### +# ADD=2A adds the copied new user to the system +###################### + +if ($ADD=="2A") + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_users' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $user = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$user' where id_table='vicidial_users' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
USUÁRIO NÃO ADICIONADO - já existe um usuário no sistema com esse número\n";} + else + { + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 20) ) + { + echo "
USUÁRIO NÃO ADICIONADO - Por favor volte e verifique os dados digitados\n"; + echo "
user id must be between 2 and 20 characters long\n"; + echo "
nome completo e senha devem ter pelo menos 2 caracteres de comprimento\n"; + echo "\n"; + } + else + { + if (ereg('AUTOGEN',$user)) + { + $new_user=0; + $auto_user_add_value=0; + while ($new_user < 2) + { + if ($new_user < 1) + { + $stmt = "SELECT auto_user_add_value FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + $ss_auav_ct = mysql_num_rows($rslt); + if ($ss_auav_ct > 0) + { + $row=mysql_fetch_row($rslt); + $auto_user_add_value = $row[0]; + } + $new_user++; + } + $stmt = "SELECT count(*) FROM vicidial_users where user='$auto_user_add_value';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + $new_user++; + } + else + { + echo "\n"; + $auto_user_add_value = ($auto_user_add_value + 7); + } + } + $user = $auto_user_add_value; + echo "
user_id has been auto-generated: $user
\n"; + + $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; + $rslt=mysql_query($stmt, $link); + } + $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user=\"$source_user_id\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) SELECT \"$user\",campaign_id,campaign_rank,campaign_weight,\"0\" from vicidial_campaign_agents where user=\"$source_user_id\";"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='USUÁRIOS', event_type='COPY', record_id='$user', event_code='ADMIN COPIAR USUÁRIO', event_sql=\"$SQL_log\", event_notes='user: $user';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + $user_name = $user; + $user_password = $pass; + $last_name = $full_name; + $is_admin = 'off'; + $roleid = 'H5'; + $status = 'Ativo'; + $groupid = '1'; + if ($user_level >= 7) {$roleid = 'H3';} + if ($user_level >= 8) {$roleid = 'H4';} + if ($user_level >= 9) {$roleid = 'H2';} + if ($user_level >= 9) {$is_admin = 'on';} + $salt = substr($user_name, 0, 2); + $salt = '$1$' . $salt . '$'; + $encrypted_password = crypt($user_password, $salt); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $group_found_count = $row[0]; + + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### + + ###################################### + ##### BEGIN Add/Update user info in Vtiger + $stmt="SELECT count(*) from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + ### user exists in vtiger, update it + if ($found_count > 0) + { + $stmt="SELECT id from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $userid = $row[0]; + + $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $usergroupcount = $row[0]; + + $stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + if ($usergroupcount < 1) + { + $stmt="SELECT user_group FROM vicidial_user_groups;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VD_groups_ct = mysql_num_rows($rslt); + $k=0; + $VD_groups_list=''; + while ($k < $VD_groups_ct) + { + $row=mysql_fetch_row($rslt); + $VD_groups_list .= "'$row[0]',"; + $k++; + } + $VD_groups_list = preg_replace("/.$/",'',$VD_groups_list); + + $stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN(SELECT groupid from vtiger_groups where groupname IN($VD_groups_list));"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW USER RECORD IN VTIGER + $stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $userid = mysql_insert_id($linkV); + + $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW USER RECORD IN VTIGER + } + ##### END Add/Update user info in Vtiger + ###################################### + } + ### END vtiger integration + + echo "
USER COPIED: $user copied from $source_user_id\n"; + echo "

\n"; + echo "Click here to go to the user record\n"; + echo "

\n"; + + } + } + exit; + } + +###################### +# ADD=21 adds the new campaign to the system +###################### + +if ($ADD==21) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_campaigns' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_id = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$campaign_id' where id_table='vicidial_campaigns' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CAMPANHA NÃO ADICIONADA - já existe uma campanha com esse ID no sistema\n";} + else + { + $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CAMPANHA NOT ADDED - there is already an inbound group in the system with this ID\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 6) or (strlen($campaign_name) > 40) ) + { + echo "
CAMPANHA NÃO ADICIONADA - Por favor volte e verifique os dados digitados\n"; + echo "
ID da campanha deve ter entre 2 e 8 caracteres de comprimento\n"; + echo "
o nome da campanha deve ter entre 6 e 40 caracteres de comprimento\n"; + } + else + { + echo "
CAMPANHA ADICIONADA: $campaign_id\n"; + + $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,campaign_description,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch,campaign_changedate,campaign_stats_refresh,list_order_mix,web_form_address_two,start_call_url,dispo_call_url) values('$campaign_id','$campaign_name','$campaign_description','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','');"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NOVA CAMPANHA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $ADD=31; + } + +###################### +# ADD=20 adds copied new campaign to the system +###################### + +if ($ADD==20) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_campaigns' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_id = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$campaign_id' where id_table='vicidial_campaigns' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CAMPANHA NÃO ADICIONADA - já existe uma campanha com esse ID no sistema\n";} + else + { + $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CAMPANHA NOT ADDED - there is already an inbound group in the system with this ID\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 2) or (strlen($source_campaign_id) < 2) or (strlen($source_campaign_id) > 8) ) + { + echo "
CAMPANHA NÃO ADICIONADA - Por favor volte e verifique os dados digitados\n"; + echo "
ID da campanha deve ter entre 2 e 8 caracteres de comprimento\n"; + echo "
source ID da campanha deve ter entre 2 e 8 caracteres de comprimento\n"; + } + else + { + echo "
CAMPANHA COPIED: $campaign_id copied from $source_campaign_id\n"; + + $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_campaign_hotkeys (status,hotkey,status_name,selectable,campaign_id) SELECT status,hotkey,status_name,selectable,\"$campaign_id\" from vicidial_campaign_hotkeys where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_lead_recycle (status,attempt_delay,attempt_maximum,active,campaign_id) SELECT status,attempt_delay,attempt_maximum,active,\"$campaign_id\" from vicidial_lead_recycle where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_pause_codes (pause_code,pause_code_name,billable,campaign_id) SELECT pause_code,pause_code_name,billable,\"$campaign_id\" from vicidial_pause_codes where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='COPY', record_id='$campaign_id', event_code='ADMIN COPY CAMPANHA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $ADD=31; + } + +###################### +# ADD=22 adds the new campaign status to the system +###################### + +if ($ADD==22) + { + echo ""; + $stmt="SELECT count(*) from vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
STATUS DE CAMPANHA NAO ADICIONADO - já existe um status/campanha no sistema com esse nome\n";} + else + { + $stmt="SELECT count(*) from vicidial_statuses where status='$status_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
STATUS DE CAMPANHA NÃO ADICIONADO - já existe um status global do sistema com esse nome\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status_id) < 1) or (strlen($status_name) < 2) ) + { + echo "
STATUS DE CAMPANHA NÃO ADICIONADO- Por favor volte e verifique os dados digitados\n"; + echo "
status deve ter entre 1 e 8 caracteres de comprimento\n"; + echo "
nome do status deve ter entre 2 e 30 caracteres de comprimento\n"; + } + else + { + echo "
STATUS DE CAMPANHA ADICIONADO: $campaign_id - $status_id\n"; + + $stmt="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) values('$status_id','$status_name','$selectable','$campaign_id','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_STATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NOVA CAMPANHA STATUS', event_sql=\"$SQL_log\", event_notes='Status: $status_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $SUB=22; + $ADD=31; + } + + +###################### +# ADD=23 adds the new campaign hotkey to the system +###################### + +if ($ADD==23) + { + $HKstatus_data = explode('-----',$HKstatus); + $status = $HKstatus_data[0]; + $status_name = $HKstatus_data[1]; + + echo ""; + $stmt="SELECT count(*) from vicidial_campaign_hotkeys where campaign_id='$campaign_id' and hotkey='$hotkey' and hotkey='$hotkey';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CAMPANHA HOT KEY NOT ADDED - there is already a campaign-hotkey in the system with this hotkey\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) + { + echo "
TECLA DE ATALHO DA CAMPANHA NÃO ADICIONADA - Por favor volte e verifique os dados digitados\n"; + echo "
hotkey must be a single character between 1 and 9 \n"; + echo "
status deve ter entre 1 e 8 caracteres de comprimento\n"; + } + else + { + echo "
ATALHO DA CAMPANHA ADICIONADO: $campaign_id - $status - $hotkey\n"; + + $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_HOTKEY', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NOVA CAMPANHA HOTKEY', event_sql=\"$SQL_log\", event_notes='Status: $status|HotKey: $hotkey';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $SUB=23; + $ADD=31; + } + + +###################### +# ADD=25 adds the new campaign lead recycle entry to the system +###################### + +if ($ADD==25) + { + $status = eregi_replace("-----.*",'',$status); + echo ""; + $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
RECICLAGEM DE REGISTROS DA CAMPANHA NÃO ADICIONADO - já existe um registro de reciclagem nessa campanha para esse status\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_delay >= 43200) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) + { + echo "
CAMPANHA LEAD RECYCLE NOT ADDED - Por favor, volte e verifique os dados digitados\n"; + echo "
status deve ter entre 1 e 6 caracteres\n"; + echo "
tempo de tentativa deve ter pelo menos 120 segundos e menos de 43200 segundos ou 12 horas\n"; + echo "
quantidade máxima de tentativas deve ser entre 1 e 10\n"; + } + else + { + echo "
RECICLAGEM DE REGISTROS DA CAMPANHA ADICIONADO: $campaign_id - $status - $attempt_delay\n"; + + $stmt="INSERT INTO vicidial_lead_recycle(campaign_id,status,attempt_delay,attempt_maximum,active) values('$campaign_id','$status','$attempt_delay','$attempt_maximum','$active');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_RECYCLE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NOVA CAMPANHA LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Status: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $SUB=25; + $ADD=31; + } + + +###################### +# ADD=26 adds the new auto alt dial status to the campaign +###################### + +if ($ADD==26) + { + $status = eregi_replace("-----.*",'',$status); + echo ""; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\";"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
STATUS DE DISCAGEM DE NÚM. ALT. NÃO INCLUÍDO - já existe uma entrada para esta campanha com este status\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + { + echo "
STATUS DE DISCAGEM DE NÚM. ALT. NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
status deve ter entre 1 e 6 caracteres\n"; + } + else + { + echo "
STATUS DE DISCAGEM PARA NÚM. ALT. INCLUÍDO: $campaign_id - $status\n"; + + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + if (strlen($row[0])<2) {$row[0] = ' -';} + $auto_alt_dial_statuses = " $status$row[0]"; + $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_ALTDIAL', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NOVA CAMPANHA ALT DIAL', event_sql=\"$SQL_log\", event_notes='Status: $auto_alt_dial_statuses';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $SUB=26; + $ADD=31; + } + + +###################### +# ADD=27 adds the new campaign agent pause code entry to the system +###################### + +if ($ADD==27) + { + echo ""; + $stmt="SELECT count(*) from vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CÓDIGO DE PAUSA NAO INCLUÍDO - já existe uma entrada para esta campanha e este código de pausa\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) or (strlen($pause_code) > 6) or (strlen($pause_code_name) < 2) ) + { + echo "
CÓDIGO DE PAUSA NAO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
pause code must be between 1 and 6 characters in length\n"; + echo "
pause nome do código deve ter entre 2 e 30 caracteres de comprimento\n"; + } + else + { + echo "
CÓDIGO DE PAUSA INCLUÍDO: $campaign_id - $pause_code - $pause_code_name\n"; + + $stmt="INSERT INTO vicidial_pause_codes(campaign_id,pause_code,pause_code_name,billable) values('$campaign_id','$pause_code','$pause_code_name','$billable');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_PAUSECODE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NOVA CAMPANHA PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Código de Pausa: $pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $SUB=27; + $ADD=31; + } + + +###################### +# ADD=28 adds new status to the campaign dial statuses +###################### + +if ($ADD==28) + { + $status = eregi_replace("-----.*",'',$status); + echo ""; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
STATUS DE DISCAGEM NÃO INCLUÍDO - já existe uma entrada para esta campanha com este status\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + { + echo "
STATUS DE DISCAGEM NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
status deve ter entre 1 e 6 caracteres\n"; + } + else + { + echo "
STATUS DE DISCAGEM INCLUÍDO: $campaign_id - $status\n"; + + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + if (strlen($row[0])<2) {$row[0] = ' -';} + $dial_statuses = " $status$row[0]"; + $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_DIALSTATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NOVA CAMPANHA DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Status: $statuses';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + #$SUB=28; + $ADD=31; + } + + +###################### +# ADD=211 adds the new list to the system +###################### + +if ($ADD==211) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_lists' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $list_id = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$list_id' where id_table='vicidial_lists' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
LISTA NÃO ADICIONADA - já existe uma lista no sistema com essa ID\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or ($list_id < 100) or (strlen($list_id) > 8) ) + { + echo "
LISTA NÃO ADICIONADA - por favor volte e verifique os dados digitados\n"; + echo "
A ID da lista deve ter entre 2 e 8 caracteres de comprimento\n"; + echo "
O Nome da Lista deve ter até 2 caracteres de comprimento\n"; + echo "
ID da Lista must be greater than 100\n"; + } + else + { + echo "
LISTA ADICIONADA: $list_id\n"; + + $stmt="INSERT INTO vicidial_lists (list_id,list_name,campaign_id,active,list_description,list_changedate) values('$list_id','$list_name','$campaign_id','$active','$list_description','$SQLdate');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='LISTAS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=311; + } + + + +###################### +# ADD=2111 adds the new inbound group to the system +###################### + +if ($ADD==2111) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_inbound_groups' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_id = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$group_id' where id_table='vicidial_inbound_groups' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
GRUPO NÃO ADICIONADO - já existe um grupo com essa ID no sistema\n";} + else + { + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
GROUP NOT ADDED - there is already a campaign in the system with this ID\n";} + else + { + if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_color) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi("\-",$group_id)) or (eregi("\+",$group_id)) ) + { + echo "
GRUPO NÃO ADICIONADO - por favor volte e verifique os dados digitados\n"; + echo "
A ID do grupo deve ter entre 2 e 20 caracteres de comprimento ' -+'.\n"; + echo "
O nome e a cor do grupo devem ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,web_form_address_two,start_call_url,dispo_call_url) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','');"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); + + echo "
GRUPO ADICIONADO: $group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='INGROUPS', event_type='ADD', record_id='$group_id', event_code='ADMIN ADD ENTRANTE GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $ADD=3111; + } + + +###################### +# ADD=2011 adds copied inbound group to the system +###################### + +if ($ADD==2011) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_inbound_groups' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_id = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$group_id' where id_table='vicidial_inbound_groups' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
GRUPO NÃO ADICIONADO - já existe um grupo com essa ID no sistema\n";} + else + { + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
GROUP NOT ADDED - there is already a campaign in the system with this ID\n";} + else + { + if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi("\-",$group_id)) or (eregi("\+",$group_id)) ) + { + echo "
GRUPO NÃO ADICIONADO - por favor volte e verifique os dados digitados\n"; + echo "
A ID do grupo deve ter entre 2 e 20 caracteres de comprimento ' -+'.\n"; + echo "
O nome e a cor do grupo devem ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $rslt=mysql_query($stmt, $link); + + echo "
GRUPO ADICIONADO: $group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='INGROUPS', event_type='COPY', record_id='$group_id', event_code='ADMIN COPIAR GRUPO DE ENTRADA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $ADD=3111; + } + + +###################### +# ADD=2311 adds the new did to the system +###################### + +if ($ADD==2311) + { + echo ""; + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$did_pattern';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
DDR NÃO INCLUÍDO - já existe um DDR com este ID no sistema\n";} + else + { + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$did_pattern';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
DDR NÃO INCLUÍDO - já existe um DDR com esta extensão no sistema\n";} + else + { + if ( (strlen($did_pattern) < 2) or (eregi(' ',$did_pattern)) or (eregi('-',$did_pattern)) or (eregi("\+",$did_pattern)) ) + { + echo "
DDR NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n"; + } + else + { + $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description) values('$did_pattern','$did_description');"; + $rslt=mysql_query($stmt, $link); + + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $did_id = $row[0]; + + echo "
DID ADDED: $did_pattern $did_description - $did_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='DIDS', event_type='ADD', record_id='$did_id', event_code='ADMIN ADD DID', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $ADD=3311; + } + + +###################### +# ADD=2411 adds copied did to the system +###################### + +if ($ADD==2411) + { + echo ""; + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$did_pattern';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
DDR NÃO INCLUÍDO - já existe um DDR com esta extensão no sistema\n";} + else + { + if ( (strlen($source_did) < 1) or (strlen($did_pattern) < 1) or (eregi(' ',$source_did)) or (eregi(' ',$did_pattern)) or (eregi("\+",$source_did)) ) + { + echo "
DDR NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n"; + } + else + { + $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id) SELECT \"$did_pattern\",\"$did_description\",did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id from vicidial_inbound_dids where did_id=\"$source_did\";"; + $rslt=mysql_query($stmt, $link); + + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $did_id = $row[0]; + + echo "
DID ADDED: $did_pattern - $did_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='DIDS', event_type='COPY', record_id='$did_id', event_code='ADMIN COPIAR DDR', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=3311; + } + + +###################### +# ADD=2511 adds the new call menu to the system +###################### + +if ($ADD==2511) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_call_menu' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $menu_id = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$menu_id' where id_table='vicidial_call_menu' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_call_menu where menu_id='$menu_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
MENU NÃO INCLUÍDO - there is already a CALL MENU in the system with this ID\n";} + else + { + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + { + echo "
MENU NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
O ID do menu deve ter entre 2 e 50 caracteres de comprimento e nao conter ' '.\n"; + } + else + { + $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; + $rslt=mysql_query($stmt, $link); + + echo "
MENU INCLUÍDO: $menu_id $menu_name\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=3511; + } + + +###################### +# ADD=2611 adds copied call menu to the system +###################### + +if ($ADD==2611) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_call_menu' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $menu_id = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$menu_id' where id_table='vicidial_call_menu' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_call_menu where menu_id='$menu_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
MENU NÃO INCLUÍDO - there is already a CALL MENU in the system with this ID\n";} + else + { + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + { + echo "
MENU NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
O ID do menu deve ter entre 2 e 50 caracteres de comprimento e nao conter ' '.\n"; + } + else + { + $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group) SELECT \"$menu_id\",\"$menu_name\",menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group from vicidial_call_menu where menu_id=\"$source_menu\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; + $rslt=mysql_query($stmtA, $link); + + echo "
MENU INCLUÍDO: $menu_id - $menu_name\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA"; + $SQL_log = ereg_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='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=3511; + } + + +###################### +# ADD=21111 adds new remote agents to the system +###################### + +if ($ADD==21111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_remote_agents where server_ip='$server_ip' and user_start='$user_start';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
AGENTES REMOTOS NÃO ADICIONADOS - já existe um usuário remoto com esse ID no sistema\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
AGENTES REMOTOS NÃO ADICIONADOS - Por favor volte e verifique os dados digitados\n"; + echo "
Início da ID e extensão externa devem ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $rslt=mysql_query($stmt, $link); + + echo "
AGENTES REMOTOS ADICIONADOS: $user_start\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=10000; + } + +###################### +# ADD=211111 adds new user group to the system +###################### + +if ($ADD==211111) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_user_groups' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $user_group = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$user_group' where id_table='vicidial_user_groups' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
GRUPO DE USUÁRIO NÃO ADICIONADO - já existe um grupo de usuários com este nome\n";} + else + { + if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) + { + echo "
GRUPO DE USUÁRIOS NÃO ADICIONADO - Por favor volte e verifique os dados digitados\n"; + echo "
Nome e descrição do grupo devem ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPANHAS-');"; + $rslt=mysql_query($stmt, $link); + + echo "
GRUPO DE USUÁRIOS ADICIONADOS: $user_group\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='USERGROUPS', event_type='ADD', record_id='$user_group', event_code='ADMIN NOVO GRUPO DE USUÁRIO', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $group_found_count = $row[0]; + + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### + } + } + } + $ADD=100000; + } + +###################### +# ADD=2111111 adds new script to the system +###################### + +if ($ADD==2111111) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_scripts' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $script_id = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$script_id' where id_table='vicidial_scripts' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
SCRIPT NÃO ADICIONADO - já existe um script com este nome no sistema\n";} + else + { + if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) + { + echo "
SCRIPT NÃO ADICIONADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Nome do script, descrição e texto devem ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "|$stmt|";} + echo "
SCRIPT ADICIONADO: $script_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SCRIPTS', event_type='ADD', record_id='$script_id', event_code='ADMIN INCLUIR SCRIPT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=1000000; + } + + +###################### +# ADD=21111111 adds new filter to the system +###################### + +if ($ADD==21111111) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_lead_filters' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_filter_id = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$lead_filter_id' where id_table='vicidial_lead_filters' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
FILTRO NÃO ADICIONADO - já existe um filtro com esse ID\n";} + else + { + if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) + { + echo "
FILTRO NAO ADICIONADO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do Filtro, nome e SQL devem ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "';"; + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|";} + echo "
FILTRO CRIADO: $lead_filter_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='FILTROS', event_type='ADD', record_id='$lead_filter_id', event_code='ADMIN INCLUIR FILTRO', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=10000000; + } + + +###################### +# ADD=211111111 adds new call time definition to the system +###################### + +if ($ADD==211111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CONFIGURAÇÃO DE HORÁRIO DE CHAMADA NAO INCLUÍDO - já existe uma entrada de Horário para este ID\n";} + else + { + if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) + { + echo "
CONFIGURAÇÃO DE HORÁRIO DE CHAMADA NAO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID e nome do Horário de Chamada deve ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $stmt="INSERT INTO vicidial_call_times SET call_time_id='$call_time_id',call_time_name='$call_time_name',call_time_comments='$call_time_comments';"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "|$stmt|";} + + echo "
HORÁRIO DE CHAMADA ADICIONADA: $call_time_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CALLTIMES', event_type='ADD', record_id='$call_time_id', event_code='ADMIN ADD CALL TIME', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=311111111; + } + + +###################### +# ADD=2111111111 adds new state call time definition to the system +###################### + +if ($ADD==2111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_state_call_times where state_call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CONFIGURAÇÃO DO HORÁRIO DE CHAMADA POR ESTADO NAO ADICIONADA - já existe uma entrada de Horário para este ID\n";} + else + { + if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) + { + echo "
CONFIGURAÇÃO DO HORÁRIO DE CHAMADA POR ESTADO NAO ADICIONADA - Por favor, volte e verifique os dados digitados\n"; + echo "
ID da configuração de chamada por estado, nome e estado devem ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + $stmt="INSERT INTO vicidial_state_call_times SET state_call_time_id='$call_time_id',state_call_time_name='$call_time_name',state_call_time_comments='$call_time_comments',state_call_time_state='$state_call_time_state';"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "|$stmt|";} + + echo "
HORÁRIO DE CHAMADA POR ESTADO ADICIONADA: $call_time_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CALLTIMES_STATE', event_type='ADD', record_id='$call_time_id', event_code='ADMIN ADD STATE CALL TIME', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=3111111111; + } + + +###################### +# ADD=231111111 adds new shift definition to the system +###################### + +if ($ADD==231111111) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_shifts' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $shift_id = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$shift_id' where id_table='vicidial_shifts' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from vicidial_shifts where shift_id='$shift_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CONFIGURAÇÃO DE TURNO NÃO INCLUÍDA - já existe uma entrada de turno com este ID\n";} + else + { + $shift_length_test = eregi_replace(':','',$shift_length); + if ( (strlen($shift_id) < 2) or (strlen($shift_name) < 2) or (strlen($shift_start_time) < 4) or (strlen($shift_start_time) > 4) or (strlen($shift_length) < 5) or (strlen($shift_length) > 5) or ($shift_start_time > 2359) or ($shift_length_test > 2400) ) + { + echo "
CONFIGURAÇÃO DE TURNO NÃO INCLUÍDA - Por favor, volte e verifique os dados digitados\n"; + echo "
ID e Nome do turno devem ter pelo menos 2 caracteres\n"; + echo "
Horário de início deve ter 4 caracteres e ser um horário válido\n"; + echo "
Duração do Turno deve ter 5 caracteres e 24 horas ou menos\n"; + } + else + { + $p=0; + $shift_weekdays_ct = count($shift_weekdays); + while ($p <= $shift_weekdays_ct) + { + $SHIFT_weekdays .= "$shift_weekdays[$p]"; + $p++; + } + $stmt="INSERT INTO vicidial_shifts SET shift_id='$shift_id',shift_name='$shift_name',shift_start_time='$shift_start_time',shift_length='$shift_length',shift_weekdays='$SHIFT_weekdays';"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "|$stmt|";} + + echo "
TURNO INCLUÍDO:$shift_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SHIFTS', event_type='ADD', record_id='$shift_id', event_code='ADMIN ADD SHIFT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=331111111; + } + + +###################### +# ADD=21111111111 adds new phone to the system +###################### + +if ($ADD==21111111111) + { + ##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value ##### + $stmt = "SELECT value FROM vicidial_override_ids where id_table='phones' and active='1';"; + $rslt=mysql_query($stmt, $link); + $voi_ct = mysql_num_rows($rslt); + if ($voi_ct > 0) + { + $row=mysql_fetch_row($rslt); + $extension = ($row[0] + 1); + + $stmt="UPDATE vicidial_override_ids SET value='$extension' where id_table='phones' and active='1';"; + $rslt=mysql_query($stmt, $link); + } + ##### END ID override optional section ##### + + echo ""; + $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
RAMAL NÃO ADICIONADO - já existe um Ramal no sistema com essa extensão\/servidor\n";} + else + { + $stmt="SELECT count(*) from phones where login='$login';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
PHONE NOT ADDED - já existe um Ramal no sistema com este login\n";} + else + { + $stmt="SELECT count(*) from phones_alias where alias_id='$login';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
PHONE NOT ADDED - já existe um alias de Ramal no sistema com esse login\n";} + else + { + $stmt="SELECT count(*) from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
PHONE NOT ADDED - there is already a ID de correo de voz in the system with this ID\n";} + else + { + if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) + { + echo "
RAMAL NÃO ADICIONADO - Por favor volte e verifique os dados digitados\n"; + echo "
Los siguientes campos deben disponer de datos: extension, server_ip, dialplan_number, voicemail_id, login, pass\n"; + } + else + { + echo "
RAMAL ADICIONADO\n"; + + $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');"; + $rslt=mysql_query($stmt, $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_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='ADD', record_id='$extension', event_code='ADMIN ADD PHONE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + } + $ADD=31111111111; + } + + +###################### +# ADD=22111111111 adds new phone alias to the system +###################### + +if ($ADD==22111111111) + { + echo ""; + $stmt="SELECT count(*) from phones_alias where alias_id='$alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
ALIAS DE RAMAL NÃO INCLUIDO - já existe um Alias de Ramal no sistema com esse ID\n";} + else + { + $stmt="SELECT count(*) from phones where login='$alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
ALIAS DE RAMAL NÃO INCLUIDO - ja existe um Login no sistema com esse ID\n";} + else + { + if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) ) + {echo "
ALIAS DE RAMAL NÃO INCLUIDO - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
ALIAS DE RAMAL INCLUÍDO\n"; + + $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$alias_id','$alias_name','$logins_list');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN ADD ALIAS DE RAMAL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $ADD=32111111111; + } + + +###################### +# ADD=23111111111 adds new group alias to the system +###################### + +if ($ADD==23111111111) + { + echo ""; + $stmt="SELECT count(*) from groups_alias where group_alias_id='$group_alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
ALIAS DE GRUPO NÃO INCLUÍDO - já existe um Alias de Ramal no sistema com esse ID\n";} + else + { + if (preg_match("/AGENT_PHONE|CUSTOMER|CAMPANHA|NONE/",$group_alias_id)) + {echo "
ALIAS DE GRUPO NÃO INCLUÍDO - não pode ser usado palavras reservadas neste alias de grupo\n";} + else + { + if ( (strlen($group_alias_id) < 1) or (strlen($group_alias_name) < 2) ) + {echo "
ALIAS DE GRUPO NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
ALIAS DE GRUPO INCLUÍDO\n"; + + $stmt="INSERT INTO groups_alias (group_alias_id,group_alias_name,caller_id_number,caller_id_name,active) values('$group_alias_id','$group_alias_name','$caller_id_number','$caller_id_name','$active');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='GROUPALIASES', event_type='ADD', record_id='$group_alias_id', event_code='ADMIN ADD GROUP ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $ADD=33111111111; + } + + +###################### +# ADD=211111111111 adds new server to the system +###################### + +if ($ADD==211111111111) + { + echo ""; + $stmt="SELECT count(*) from servers where server_id='$server_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
SERVIDOR NÃO ADICIONADO - já existe um servidor no sistema com essa ID\n";} + else + { + if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) + {echo "
SERVIDOR NÃO ADICIONADO - por favor volte e verifique os dados digitados\n";} + else + { + echo "
SERVIDOR ADICIONADO\n"; + + $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SERVERS', event_type='ADD', record_id='$server_id', event_code='ADMIN ADD SERVER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=311111111111; + } + + +###################### +# ADD=221111111111 adds the new vicidial server trunk record to the system +###################### + +if ($ADD==221111111111) + { + echo ""; + $stmt="SELECT max_vicidial_trunks from servers where server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $MAXvicidial_trunks = $rowx[0]; + + $stmt="SELECT sum(dedicated_trunks) from vicidial_server_trunks where server_ip='$server_ip' and campaign_id !='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $SUMvicidial_trunks = ($rowx[0] + $dedicated_trunks); + + if ($SUMvicidial_trunks > $MAXvicidial_trunks) + { + echo "
REGISTRO DE TRUNK VICIDIAL NÃO ADICIONADO - o número de trunk vicidial é muito alto: $SUMvicidial_trunks / $MAXvicidial_trunks\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_server_trunks where campaign_id='$campaign_id' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
REGISTRO DE TRUNK VICIDIAL NÃO ADICIONADO - já existe um registro de trunk para esta campanha\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) or (strlen($dedicated_trunks) < 1) or (strlen($trunk_restriction) < 1) ) + { + echo "
REGISTRO DE TRUNK VICIDIAL NÃO ADICIONADO - Por favor, volte e verifique os dados digitados\n"; + echo "
campanha deve ter entre 3 e 8 caracteres de comprimento\n"; + echo "
delay do IP do servidor deve ser pelo menos 7 caracteres\n"; + echo "
trunks devem ter um digito entre 0 e 9999\n"; + } + else + { + echo "
REGISTRO DE TRUNK VICIDIAL INCLUÍDO: $campaign_id - $server_ip - $dedicated_trunks - $trunk_restriction\n"; + + $stmt="INSERT INTO vicidial_server_trunks(server_ip,campaign_id,dedicated_trunks,trunk_restriction) values('$server_ip','$campaign_id','$dedicated_trunks','$trunk_restriction');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SERVERS_TRUNK', event_type='ADD', record_id='$server_ip', event_code='ADMIN ADD SERVIDOR TRUNK', event_sql=\"$SQL_log\", event_notes='campaign: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $ADD=311111111111; + } + + +###################### +# ADD=231111111111 adds new conf template to the system +###################### + +if ($ADD==231111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_conf_templates where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
TEMPLATE DE CONF NÃO INCLUÍDA - já existe um template no sistema com esse ID\n";} + else + { + if (strlen($template_id) < 2) + {echo "
TEMPLATE DE CONF NÃO INCLUÍDA - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
TEMPLATE DE CONF INCLUÍDO\n"; + + $stmt="INSERT INTO vicidial_conf_templates (template_id,template_name,template_contents) values('$template_id','$template_name','$template_contents');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CONFTEMPLATES', event_type='ADD', record_id='$template_id', event_code='ADMIN ADD CONF TEMPLATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=331111111111; + } + + +###################### +# ADD=241111111111 adds new server carrier to the system +###################### + +if ($ADD==241111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
OPERADORA NÃO INCLUÍDA - já existe uma operadora no sistema com este ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
OPERADORA NÃO INCLUÍDA - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
CARRIER ADDED\n"; + + $stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N','$carrier_description');"; + $rslt=mysql_query($stmt, $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_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CARRIERS', event_type='ADD', record_id='$carrier_id', event_code='ADMIN ADD CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=341111111111; + } + + +###################### +# ADD=251111111111 adds new tts entry to the system +###################### + +if ($ADD==251111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_tts_prompts where tts_id='$tts_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
TTS entrada no AGREGADOS - ya hay una entrada de TTS en el sistema con este ID\n";} + else + { + if ( (strlen($tts_id) < 2) or (strlen($tts_name) < 3) ) + {echo "
TTS entrada no AGREGADOS - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
TTS añadido la entrada de\n"; + + $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='TTS', event_type='ADD', record_id='$tts_id', event_code='ADMIN ADD TTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=351111111111; + } + + +###################### +# ADD=261111111111 adds new music on hold entry to the system +###################### + +if ($ADD==261111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_music_on_hold where moh_id='$moh_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
MÚSICA EN ESPERA entrada no AGREGADOS - ya hay una entrada en el Ministerio de Salud en el sistema con este ID\n";} + else + { + if ( (strlen($moh_id) < 2) or (strlen($moh_name) < 3) or ($moh_id=='sounds') or ($moh_id=='agi-bin') or ($moh_id=='astdb') or ($moh_id=='keys') ) + {echo "
MÚSICA EN ESPERA entrada no AGREGADOS - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
MÚSICA EN ESPERA añadido la entrada de\n"; + + $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='MOH', event_type='ADD', record_id='$moh_id', event_code='ADMIN ADD MOH', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=361111111111; + } + + +###################### +# ADD=271111111111 adds new voicemail box to the system +###################### + +if ($ADD==271111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
Contestador NO AGREGADOS - ya existe un buzón de voz en el sistema con este ID\n";} + else + { + $stmt="SELECT count(*) from phones where voicemail_id='$voicemail_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
Contestador NO AGREGADOS - ya hay un teléfono en el sistema de correo de voz con este ID\n";} + else + { + if ( (strlen($voicemail_id) < 2) or (strlen($pass) < 2) or (strlen($fullname) < 3) ) + {echo "
Contestador NO AGREGADOS - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
Contestador AGREGADOS\n"; + + $stmt="INSERT INTO vicidial_voicemail SET voicemail_id='$voicemail_id',pass='$pass',email='$email',fullname='$fullname',active='$active';"; + $rslt=mysql_query($stmt, $link); + + $stmt="SELECT active_voicemail_server from system_settings;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $active_voicemail_server = $row[0]; + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$active_voicemail_server';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='VOICEMAIL', event_type='ADD', record_id='$voicemail_id', event_code='ADMIN ADD VOICEMAIL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $ADD=371111111111; + } + + +###################### +# ADD=2111111111111 adds new conference to the system +###################### + +if ($ADD==2111111111111) + { + echo ""; + $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CONFERÊNCIA NÃO ADICIONADA - já existe no sistema uma conferência com este ID e servidor\n";} + else + { + if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) + {echo "
CONFERÊNCIA NÃO ADICIONADA - Por favor volte e verifique os dados digitados\n";} + else + { + echo "
CONFERÊNCIA ADICIONADA\n"; + + $stmt="INSERT INTO conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');"; + $rslt=mysql_query($stmt, $link); + } + } + $ADD=3111111111111; + } + + +###################### +# ADD=21111111111111 adds new vicidial conference to the system +###################### + +if ($ADD==21111111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
VICIDIAL CONFERENCE NOT ADDED - there is already a vicidial conference in the system with this ID and server\n";} + else + { + if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) + {echo "
VICIDIAL CONFERÊNCIA NÃO ADICIONADA - Por favor volte e verifique os dados digitados\n";} + else + { + echo "
VICIDIAL CONFERÊNCIA ADICIONADA\n"; + + $stmt="INSERT INTO vicidial_conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');"; + $rslt=mysql_query($stmt, $link); + } + } + $ADD=31111111111111; + } + + +###################### +# ADD=221111111111111 adds the new system status to the system +###################### + +if ($ADD==221111111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
STATUS DE SISTEMA NÃO INCLUÍDO - there is already a campaign-status in the system with this name: $row[0]\n";} + else + { + $stmt="SELECT count(*) from vicidial_statuses where status='$status_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
STATUS DE SISTEMA NÃO INCLUÍDO - there is already a global-status in the system with this name\n";} + else + { + if ( (strlen($status_id) < 1) or (strlen($status_name) < 2) ) + { + echo "
STATUS DE SISTEMA NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
status deve ter entre 1 e 8 caracteres de comprimento\n"; + echo "
nome do status deve ter entre 2 e 30 caracteres de comprimento\n"; + } + else + { + echo "
STATUS DE SISTEMA INCLUÍDO: $status_name - $status_id\n"; + + $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable) values('$status_id','$status_name','$selectable','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SYSTEMSTATUS', event_type='ADD', record_id='$status_id', event_code='ADMIN ADD SYSTEM STATUS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + $ADD=321111111111111; + } + + +###################### +# ADD=231111111111111 adds the new status category to the system +###################### + +if ($ADD==231111111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_status_categories where vsc_id='$vsc_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CATEGORIA NÃO INCLUIDA - já existe uma categoria de status com esse ID no sistema: $row[0]\n";} + else + { + if ( (strlen($vsc_id) < 2) or (strlen($vsc_id) > 20) or (strlen($vsc_name) < 2) ) + { + echo "
CATEGORIA NÃO INCLUIDA - Por favor, volte e verifique os dados digitados\n"; + echo "
ID deve ter entre 2 e 20 caracteres \n"; + echo "
o nome deve ter entre 2 e 50 caracteres\n"; + } + else + { + echo "
STATUS CATEGORIA ADDED: $vsc_id - $vsc_name\n"; + + $stmt="SELECT count(*) from vicidial_status_categories where tovdad_display='Y' and vsc_id NOT IN('$vsc_id');"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($row[0] > 3) and (ereg('Y',$tovdad_display)) ) + { + $tovdad_display = 'N'; + echo "
ERRO: Já existem 4 Categorias de Status no Relatório TimeOnVDAD\n"; + } + + $stmt="INSERT INTO vicidial_status_categories (vsc_id,vsc_name,vsc_description,tovdad_display,sale_category,dead_lead_category) values('$vsc_id','$vsc_name','$vsc_description','$tovdad_display','$sale_category','$dead_lead_category');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='STATUSCATEGORIES', event_type='ADD', record_id='$vsc_id', event_code='ADMIN ADD STATUS CATEGORIA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=331111111111111; + } + + + +###################### +# ADD=241111111111111 adds the new qc status code to the system +###################### + +if ($ADD==241111111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_qc_codes where code='$code';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CÓDIGO DE STATUS CQ NÃO INCLUÍDO- já existe um código de status cq no sistema com esse nome: $row[0]\n";} + else + { + if ( (strlen($code) < 1) or (strlen($code_name) < 2) ) + { + echo "
CÓDIGO DE STATUS CQ NÃO INCLUÍDO- Por favor, volte e verifique os dados digitados\n"; + echo "
código deve ter entre 1 e 8 caracteres de comprimento\n"; + echo "
nome do código deve ter entre 2 e 30 caracteres de comprimento\n"; + } + else + { + echo "
CÓDIGO DE STATUS CQ ADICIONADO:$code_name - $code\n"; + + $stmt="INSERT INTO vicidial_qc_codes (code,code_name) values('$code','$code_name');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='QCSTATUS', event_type='ADD', record_id='$code', event_code='ADMIN ADD QC STATUS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=341111111111111; + } + + + +###################################################################################################### +###################################################################################################### +####### 4 series, record modifications submitted and DB is modified, then on to 3 series forms below +###################################################################################################### +###################################################################################################### + + + +###################### +# ADD=4A submit user modifications to the system - ADMIN +###################### + +if ($ADD=="4A") + { + if ($LOGmodify_users==1) + { + echo ""; + + if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) + { + echo "
USUÁRIO NÃO ALTERADO - Por favor volte e verifique os dados digitados\n"; + echo "
Senha e Nome Completo devem ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } + echo "
USUÁRIO ALTERADO - ADMIN: $user\n"; + + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five' where user='$user';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmt_grp_values|"; + $SQL_log = ereg_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='USUÁRIOS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + $user_name = $user; + $user_password = $pass; + $last_name = $full_name; + $is_admin = 'off'; + $roleid = 'H5'; + $status = 'Ativo'; + $groupid = '1'; + if ($user_level >= 7) {$roleid = 'H3';} + if ($user_level >= 8) {$roleid = 'H4';} + if ($user_level >= 9) {$roleid = 'H2';} + if ($user_level >= 9) {$is_admin = 'on';} + $salt = substr($user_name, 0, 2); + $salt = '$1$' . $salt . '$'; + $encrypted_password = crypt($user_password, $salt); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $group_found_count = $row[0]; + + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### + + ###################################### + ##### BEGIN Add/Update user info in Vtiger + $stmt="SELECT count(*) from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + ### user exists in vtiger, update it + if ($found_count > 0) + { + $stmt="SELECT id from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $userid = $row[0]; + + $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $usergroupcount = $row[0]; + + $stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + if ($usergroupcount < 1) + { + $stmt="SELECT user_group FROM vicidial_user_groups;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VD_groups_ct = mysql_num_rows($rslt); + $k=0; + $VD_groups_list=''; + while ($k < $VD_groups_ct) + { + $row=mysql_fetch_row($rslt); + $VD_groups_list .= "'$row[0]',"; + $k++; + } + $VD_groups_list = preg_replace("/.$/",'',$VD_groups_list); + + $stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN(SELECT groupid from vtiger_groups where groupname IN($VD_groups_list));"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW USER RECORD IN VTIGER + $stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $userid = mysql_insert_id($linkV); + + $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW USER RECORD IN VTIGER + } + ##### END Add/Update user info in Vtiger + ###################################### + } + ### END vtiger integration + + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=3; # go to user modification below + } + + +###################### +# ADD=4B submit user modifications to the system - ADMIN +###################### + +if ($ADD=="4B") + { + if ($LOGmodify_users==1) + { + echo ""; + + if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) + { + echo "
USUÁRIO NÃO ALTERADO - Por favor volte e verifique os dados digitados\n"; + echo "
Senha e Nome Completo devem ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } + echo "
USUÁRIO ALTERADO - ADMIN: $user\n"; + + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',alter_custphone_override='$alter_custphone_override',active='$active',agent_shift_enforcement_override='$agent_shift_enforcement_override',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five' where user='$user';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='USUÁRIOS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + $user_name = $user; + $user_password = $pass; + $last_name = $full_name; + $is_admin = 'off'; + $roleid = 'H5'; + $status = 'Ativo'; + $groupid = '1'; + if ($user_level >= 7) {$roleid = 'H3';} + if ($user_level >= 8) {$roleid = 'H4';} + if ($user_level >= 9) {$roleid = 'H2';} + if ($user_level >= 9) {$is_admin = 'on';} + $salt = substr($user_name, 0, 2); + $salt = '$1$' . $salt . '$'; + $encrypted_password = crypt($user_password, $salt); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $group_found_count = $row[0]; + + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### + + ###################################### + ##### BEGIN Add/Update user info in Vtiger + $stmt="SELECT count(*) from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + ### user exists in vtiger, update it + if ($found_count > 0) + { + $stmt="SELECT id from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $userid = $row[0]; + + $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $usergroupcount = $row[0]; + + $stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + if ($usergroupcount < 1) + { + $stmt="SELECT user_group FROM vicidial_user_groups;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VD_groups_ct = mysql_num_rows($rslt); + $k=0; + $VD_groups_list=''; + while ($k < $VD_groups_ct) + { + $row=mysql_fetch_row($rslt); + $VD_groups_list .= "'$row[0]',"; + $k++; + } + $VD_groups_list = preg_replace("/.$/",'',$VD_groups_list); + + $stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN(SELECT groupid from vtiger_groups where groupname IN($VD_groups_list));"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW USER RECORD IN VTIGER + $stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $userid = mysql_insert_id($linkV); + + $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW USER RECORD IN VTIGER + } + ##### END Add/Update user info in Vtiger + ###################################### + } + ### END vtiger integration + + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=3; # go to user modification below + } + + +###################### +# ADD=4 submit user modifications to the system +###################### + +if ($ADD==4) + { + if ($LOGmodify_users==1) + { + echo ""; + + if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) + { + echo "
USUÁRIO NÃO ALTERADO - Por favor volte e verifique os dados digitados\n"; + echo "
Senha e Nome Completo devem ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + echo "
USUÁRIO ALTERADO: $user\n"; + + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',active='$active',email='$email',user_code='$user_code',territory='$territory' where user='$user';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='USUÁRIOS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + $user_name = $user; + $user_password = $pass; + $last_name = $full_name; + $is_admin = 'off'; + $roleid = 'H5'; + $status = 'Ativo'; + $groupid = '1'; + if ($user_level >= 7) {$roleid = 'H3';} + if ($user_level >= 8) {$roleid = 'H4';} + if ($user_level >= 9) {$roleid = 'H2';} + if ($user_level >= 9) {$is_admin = 'on';} + $salt = substr($user_name, 0, 2); + $salt = '$1$' . $salt . '$'; + $encrypted_password = crypt($user_password, $salt); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $group_found_count = $row[0]; + + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### + + ###################################### + ##### BEGIN Add/Update user info in Vtiger + $stmt="SELECT count(*) from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + ### user exists in vtiger, update it + if ($found_count > 0) + { + $stmt="SELECT id from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $userid = $row[0]; + + $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $usergroupcount = $row[0]; + + $stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + if ($usergroupcount < 1) + { + $stmt="SELECT user_group FROM vicidial_user_groups;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VD_groups_ct = mysql_num_rows($rslt); + $k=0; + $VD_groups_list=''; + while ($k < $VD_groups_ct) + { + $row=mysql_fetch_row($rslt); + $VD_groups_list .= "'$row[0]',"; + $k++; + } + $VD_groups_list = preg_replace("/.$/",'',$VD_groups_list); + + $stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN(SELECT groupid from vtiger_groups where groupname IN($VD_groups_list));"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW USER RECORD IN VTIGER + $stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $userid = mysql_insert_id($linkV); + + $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW USER RECORD IN VTIGER + } + ##### END Add/Update user info in Vtiger + ###################################### + } + ### END vtiger integration + + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=3; # go to user modification below + } + +###################### +# ADD=41 submit campaign modifications to the system - DETAIL +###################### + +if ($ADD==41) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ($SSoutbound_autodial_active < 1) + { + $adaptive_dl_diff_target = '0'; + $adaptive_dropped_percentage = '99'; + $adaptive_intensity = '0'; + $adaptive_latest_server_time = '2359'; + $adaptive_maximum_level = '1.0'; + $agent_extended_alt_dial = 'N'; + $alt_number_dialing = 'N'; + $am_message_exten = '8320'; + $amd_send_to_vmx = 'N'; + $auto_alt_dial = 'N'; + $auto_dial_level = '1.0'; + $available_only_ratio_tally = 'Y'; + $campaign_allow_inbound = 'Y'; + $campaign_vdad_exten = '8368'; + $concurrent_transfers = 'AUTO'; + $dial_method = 'RATIO'; + $dial_status = ''; + $dial_timeout = '60'; + $drop_action = 'HANGUP'; + $drop_call_seconds = '5'; + $drop_inbound_group = '---NONE---'; + $force_reset_hopper = 'N'; + $hopper_level = '5'; + $lead_filter_id = 'NONE'; + $lead_order = 'DOWN'; + $list_order_mix = 'DISABLED'; + $no_hopper_leads_logins = 'Y'; + $queue_priority = '50'; + $safe_harbor_exten = '8300'; + $survey_camp_record_dir = '/home/survey'; + $survey_dtmf_digits = '1238'; + $survey_first_audio_file = 'US_pol_survey_hello'; + $survey_method = 'AGENT_XFER'; + $survey_ni_audio_file = ''; + $survey_ni_digit = '8'; + $survey_ni_status = 'NI'; + $survey_no_response_action = 'OPTIN'; + $survey_opt_in_audio_file = 'US_pol_survey_transfer'; + $survey_response_digit_map = '1-DEMOCRAT|2-REPUBLICAN|3-INDEPENDANT|8-OPTOUT|X-NO RESPONSE|'; + $survey_xfer_exten = '8300'; + $voicemail_ext = ''; + $cpd_amd_action = 'DISABLED'; + $drop_lockout_time = '0'; + } + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
LISTAS ATIVAS ALTERADAS"; + $list_active_change_ct = count($list_active_change); + while ($p < $list_active_change_ct) + { + $LIST_ACTIVATE .= "'$list_active_change[$p]',"; + $p++; + } + + $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA ACTIVE LISTAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + } + else + { + if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) + { + echo "
CAMPANHA NÃO ALTERADA - Por favor volte e verifique os dados digitados\n"; + echo "
o nome da campanha precisa ter no mínimo 6 caracteres de comprimento\n"; + echo "
|$campaign_name|$active|\n"; + } + else + { + echo "
CAMPANHA ALTERADA: $campaign_id\n"; + + if ( ($dial_method != 'MANUAL') and ($dial_method != 'ENTRANTE_MAN') ) + { + $no_hopper_dialing='N'; + $agent_dial_owner_only='NONE'; + } + if ($no_hopper_dialing == 'Y') + { + $auto_alt_dial='NONE'; + $list_order_mix='DISABLED'; + } + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + $campaign_allow_inbound='N'; + } + else + { + if ($dial_level_override > 0) + { + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + } + if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) + {$hopper_level='100';} + + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + if ($reset_hopper == 'Y') + { + echo "
REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; + echo "
- Aguarde 1 minuto antes de discar o próximo número\n"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPANHA LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=42 modify/delete campaign status in the system +###################### + +if ($ADD==42) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + { + echo "
STATUS DA CAMPANHA NÃO ALTERADO - Por favor retorne e verifique os dados digitados\n"; + echo "
o id da campanha precisa ter no mínimo 2 caracteres de comprimento\n"; + echo "
o status da campanha precisa ter no mínimo 1 caracter de comprimento\n"; + } + else + { + if (ereg('delete',$stage)) + { + echo "
STATUS CUSTOMIZADO DA CAMPANHA REMOVIDO: $campaign_id - $status\n"; + + $stmt="DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; + $rslt=mysql_query($stmt, $link); + + $stmtA="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_STATUS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPANHA STATUS', event_sql=\"$SQL_log\", event_notes='Status: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if (ereg('modify',$stage)) + { + echo "
STATUS CUSTOMIZADO ALTERADO: $campaign_id - $status\n"; + + $stmt="UPDATE vicidial_campaign_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category',sale='$sale',dnc='$dnc',customer_contact='$customer_contact',not_interested='$not_interested',unworkable='$unworkable' where campaign_id='$campaign_id' and status='$status';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_STATUS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA STATUS', event_sql=\"$SQL_log\", event_notes='Status: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=22; + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=43 delete campaign hotkey in the system +###################### + +if ($ADD==43) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) + { + echo "
ATALHO DE TECLADO DA CAMPANHA NÃO ALTERADO - Por favor volte e verifique os dados digitados\n"; + echo "
o id da campanha precisa ter no mínimo 2 caracteres de comprimento\n"; + echo "
o status da campanha precisa ter no mínimo 1 caracter de comprimento\n"; + echo "
the campaign hotkey needs to be at least 1 characters in length\n"; + } + else + { + echo "
ATALHO DE TECLADO DA CAMPANHA REMOVIDO: $campaign_id - $status - $hotkey\n"; + + $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_HOTKEY', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPANHA HOTKEY', event_sql=\"$SQL_log\", event_notes='Status: $status|HotKey: $hotkey';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=23; + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=44 submit campaign modifications to the system - Basic View +###################### + +if ($ADD==44) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ($SSoutbound_autodial_active < 1) + { + $adaptive_dl_diff_target = '0'; + $adaptive_dropped_percentage = '99'; + $adaptive_intensity = '0'; + $adaptive_latest_server_time = '2359'; + $adaptive_maximum_level = '1.0'; + $agent_extended_alt_dial = 'N'; + $alt_number_dialing = 'N'; + $am_message_exten = '8320'; + $amd_send_to_vmx = 'N'; + $auto_alt_dial = 'N'; + $auto_dial_level = '1.0'; + $available_only_ratio_tally = 'Y'; + $campaign_allow_inbound = 'Y'; + $campaign_vdad_exten = '8368'; + $concurrent_transfers = 'AUTO'; + $dial_method = 'RATIO'; + $dial_status = ''; + $dial_timeout = '60'; + $drop_action = 'HANGUP'; + $drop_call_seconds = '5'; + $drop_inbound_group = '---NONE---'; + $force_reset_hopper = 'N'; + $hopper_level = '5'; + $lead_filter_id = 'NONE'; + $lead_order = 'DOWN'; + $list_order_mix = 'DISABLED'; + $no_hopper_leads_logins = 'Y'; + $queue_priority = '50'; + $safe_harbor_exten = '8300'; + $voicemail_ext = ''; + } + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
LISTAS ATIVAS ALTERADAS"; + $list_active_change_ct = count($list_active_change); + while ($p < $list_active_change_ct) + { + $LIST_ACTIVATE .= "'$list_active_change[$p]',"; + $p++; + } + + $stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rslt=mysql_query($stmtB, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA ACTIVE LISTAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} + } + else + { + if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) + { + echo "
CAMPANHA NÃO ALTERADA - Por favor volte e verifique os dados digitados\n"; + echo "
o nome da campanha precisa ter no mínimo 6 caracteres de comprimento\n"; + } + else + { + echo "
CAMPANHA ALTERADA: $campaign_id\n"; + + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) + {$hopper_level='100';} + + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', $adlSQL lead_filter_id='$lead_filter_id',dial_method='$dial_method',adaptive_intensity='$adaptive_intensity',campaign_changedate='$SQLdate',list_order_mix='$list_order_mix' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_hopper == 'Y') + { + echo "
REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; + echo "
- Aguarde 1 minuto antes de discar o próximo número\n"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPANHA LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=34; # go to campaign modification form below + } + + +###################### +# ADD=45 modify campaign lead recycle in the system +###################### + +if ($ADD==45) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_delay >= 43200) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) + { + echo "
CAMPANHA LEAD RECYCLE NOT MODIFIED - Por favor, volte e verifique os dados digitados\n"; + echo "
status deve ter entre 1 e 6 caracteres\n"; + echo "
tempo de tentativa deve ter pelo menos 120 segundos e menos de 43200 segundos ou 12 horas\n"; + echo "
quantidade máxima de tentativas deve ser entre 1 e 10\n"; + } + else + { + echo "
CAMPANHA LEAD MODIFIED: $campaign_id - $status - $attempt_delay\n"; + + $stmt="UPDATE vicidial_lead_recycle SET attempt_delay='$attempt_delay',attempt_maximum='$attempt_maximum',active='$active' where campaign_id='$campaign_id' and status='$status';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_RECYCLE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=25; + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=47 modify agent pause code in the system +###################### + +if ($ADD==47) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) or (strlen($pause_code) > 6) or (strlen($pause_code_name) < 2) ) + { + echo "
CÓDIGO DE PAUSA NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n"; + echo "
pause_code must be between 1 and 6 characters in length\n"; + echo "
pause_nome do código deve ter entre 2 e 30 caracteres de comprimento\n"; + } + else + { + echo "
AGENTE PAUSE CODE MODIFIED: $campaign_id - $pause_code - $pause_code_name\n"; + + $stmt="UPDATE vicidial_pause_codes SET pause_code_name='$pause_code_name',billable='$billable' where campaign_id='$campaign_id' and pause_code='$pause_code';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_PAUSECODE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA PAUSE CODE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=27; + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=48 modify campaign QC settings in the system +###################### +if ($ADD==48) + { + if ( ($LOGmodify_campaigns==1) and ($SSqc_features_active) ) + { + echo ""; + + if (strlen($campaign_id) < 2) + { + echo "
CONFIG. DE CQ NÃO ALTERADAS - Por favor, volte e verifique os dados digitados\n"; + } + else + { + $p=0; + $qc_statuses_ct = count($qc_statuses); + while ($p < $qc_statuses_ct) + { + $QC_statuses .= " $qc_statuses[$p]"; + $p++; + } + $p=0; + $qc_lists_ct = count($qc_lists); + while ($p < $qc_lists_ct) + { + $QC_lists .= " $qc_lists[$p]"; + $p++; + } + + if (strlen($QC_statuses)>0) {$QC_statuses .= " -";} + if (strlen($QC_lists)>0) {$QC_lists .= " -";} + + echo "
CONFIG. DE CQ ALTERADAS: $campaign_id\n"; + + $stmt="UPDATE vicidial_campaigns SET qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_lists='$QC_lists',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_shift_id='$qc_shift_id' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_QC', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA QC SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=28; + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=40A modify campaign survey settings in the system +###################### + +if ($ADD=='40A') + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if (strlen($campaign_id) < 2) + { + echo "
CONFIGURAÇÃO DE PESQUISA NÃO ALTERADA - Por favor, volte e verifique os dados digitados\n"; + } + else + { + echo "
CONFIGURAÇÃO DE PESQUISA ALTERADA: $campaign_id\n"; + + $stmt="UPDATE vicidial_campaigns SET survey_first_audio_file='$survey_first_audio_file',survey_dtmf_digits='$survey_dtmf_digits',survey_ni_digit='$survey_ni_digit',survey_opt_in_audio_file='$survey_opt_in_audio_file',survey_ni_audio_file='$survey_ni_audio_file',survey_method='$survey_method',survey_no_response_action='$survey_no_response_action',survey_ni_status='$survey_ni_status',survey_response_digit_map='$survey_response_digit_map',survey_xfer_exten='$survey_xfer_exten',survey_camp_record_dir='$survey_camp_record_dir',voicemail_ext='$voicemail_ext',survey_third_digit='$survey_third_digit',survey_fourth_digit='$survey_fourth_digit',survey_third_audio_file='$survey_third_audio_file',survey_fourth_audio_file='$survey_fourth_audio_file',survey_third_status='$survey_third_status',survey_fourth_status='$survey_fourth_status',survey_third_exten='$survey_third_exten',survey_fourth_exten='$survey_fourth_exten' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_SURVEY', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA SURVEY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB='20A'; + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=49 modify campaign list mix in the system +###################### + +if ($ADD==49) + { + if ($LOGmodify_campaigns==1) + { + ##### MODIFY a list mix container entry ##### + if ($stage=='MODIFY') + { + echo ""; + + $Flist_mix_container = "list_mix_container_$vcl_id"; + $Fmix_method = "mix_method_$vcl_id"; + $Fstatus = "status_$vcl_id"; + $Fvcl_name = "vcl_name_$vcl_id"; + + if (isset($_GET[$Flist_mix_container])) {$list_mix_container=$_GET[$Flist_mix_container];} + elseif (isset($_POST[$Flist_mix_container])) {$list_mix_container=$_POST[$Flist_mix_container];} + if (isset($_GET[$Fmix_method])) {$mix_method=$_GET[$Fmix_method];} + elseif (isset($_POST[$Fmix_method])) {$mix_method=$_POST[$Fmix_method];} + if (isset($_GET[$Fstatus])) {$status=$_GET[$Fstatus];} + elseif (isset($_POST[$Fstatus])) {$status=$_POST[$Fstatus];} + if (isset($_GET[$Fvcl_name])) {$vcl_name=$_GET[$Fvcl_name];} + elseif (isset($_POST[$Fvcl_name])) {$vcl_name=$_POST[$Fvcl_name];} + $list_mix_container = preg_replace("/:$/","",$list_mix_container); + + if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_mix_container) < 6) or (strlen($vcl_name) < 2) ) + { + echo "
MESCLAGEM DE LISTA NÃO ALTERADA - Por favor, volte e verifique os dados digitados\n"; + echo "
vcl_id must be between 1 and 20 characters in length\n"; + echo "
vcl_name name must be between 2 and 30 characters in length\n"; + } + else + { + $stmt="UPDATE vicidial_campaigns_list_mix SET vcl_name='$vcl_name',mix_method='$mix_method',list_mix_container='$list_mix_container' where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA LIST MIX', event_sql=\"$SQL_log\", event_notes='Mesclagem de Lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
MESCLAGEM DE LISTA ALTERADA: $campaign_id - $vcl_id - $vcl_name\n"; + } + } + + ##### ADD a list mix container entry ##### + if ($stage=='ADD') + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_id) < 1) ) + { + echo "
MESCLAGEM DE LISTA NÃO ALTERADA - Por favor, volte e verifique os dados digitados\n"; + echo "
vcl_id must be between 1 and 20 characters in length\n"; + echo "
list_id must be at least 2 characters in length\n"; + } + else + { + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $OLDlist_mix_container = $row[0]; + $NEWlist_mix_container = "$OLDlist_mix_container:$list_id|10|0| -|"; + + $stmt="UPDATE vicidial_campaigns_list_mix SET list_mix_container='$NEWlist_mix_container' where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA LIST MIX', event_sql=\"$SQL_log\", event_notes='Mesclagem de Lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
MESCLAGEM DE LISTA ALTERADA: $campaign_id - $vcl_id - $list_id\n"; + } + } + + ##### REMOVE a list mix container entry ##### + if ($stage=='REMOVE') + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_id) < 1) ) + { + echo "
MESCLAGEM DE LISTA NÃO ALTERADA - Por favor, volte e verifique os dados digitados\n"; + echo "
vcl_id must be between 1 and 20 characters in length\n"; + echo "
list_id must be at least 2 characters in length\n"; + } + else + { + $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $MIXentries = $MT; + $MIXentries = explode(":", $row[0]); + $Ms_to_print = (count($MIXentries) - 0); + + if ($Ms_to_print < 2) + { + echo "
MESCLAGEM DE LISTA NÃO ALTERADA: Você não pode apagar a última entrada de lista para uma mesclagem de lista\n"; + } + else + { + $MIXdetailsPCT = explode('|', $MIXentries[$mix_container_item]); + $MIXpercentPCT = $MIXdetailsPCT[2]; + + $q=0; + while ($Ms_to_print > $q) + { + if ( ($mix_container_item > $q) or ($mix_container_item < $q) ) + { + if ( ($q==0) and ($mix_container_item > 0) ) + { + $MIXdetailsONE = explode('|', $MIXentries[$q]); + $MIXpercentONE = ($MIXdetailsONE[2] + $MIXpercentPCT); + $NEWlist_mix_container .= "$MIXdetailsONE[0]|$MIXdetailsONE[1]|$MIXpercentONE|$MIXdetailsONE[3]|:"; + } + else + { + if ( ($q==1) and ($mix_container_item < 1) ) + { + $MIXdetailsONE = explode('|', $MIXentries[$q]); + $MIXpercentONE = ($MIXdetailsONE[2] + $MIXpercentPCT); + $NEWlist_mix_container .= "$MIXdetailsONE[0]|$MIXdetailsONE[1]|$MIXpercentONE|$MIXdetailsONE[3]|:"; + } + else + { + $NEWlist_mix_container .= "$MIXentries[$q]:"; + } + } + } + $q++; + } + $NEWlist_mix_container = preg_replace("/.$/",'',$NEWlist_mix_container); + + $stmt="UPDATE vicidial_campaigns_list_mix SET list_mix_container='$NEWlist_mix_container' where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA LIST MIX', event_sql=\"$SQL_log\", event_notes='Mesclagem de Lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
MESCLAGEM DE LISTA ALTERADA: $campaign_id - $vcl_id - $list_id - $mix_container_item\n"; + } + } + } + + ##### ADD a NEW list mix ##### + if ($stage=='NEWMIX') + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($vcl_name) < 2) ) + { + echo "
MESCLAGEM NÃO INCLUÍDA- Por favor, volte e verifique os dados digitados\n"; + echo "
vcl_id must be between 1 and 20 characters in length\n"; + echo "
vcl_name must be at least 2 characters in length\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + echo "
MESCLAGEM NÃO INCLUÍDA- Já existe uma mesclagem de lista com esse ID no sistema\n"; + } + else + { + $stmt="INSERT INTO vicidial_campaigns_list_mix SET list_mix_container='$list_id|1|100| $status -|',campaign_id='$campaign_id',vcl_id='$vcl_id',vcl_name='$vcl_name',mix_method='$mix_method',status='INACTIVE';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_LISTMIX', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NOVA CAMPANHA LIST MIX', event_sql=\"$SQL_log\", event_notes='Mesclagem de Lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
MESCLAGEM INCLUÍDA:$campaign_id - $vcl_id - $vcl_name\n"; + } + } + } + + ##### DELETE an existing list mix ##### + if ($stage=='DELMIX') + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) ) + { + echo "
MESCLAGEM NÃO REMOVIDA - Por favor, volte e verifique os dados digitados\n"; + echo "
vcl_id must be between 1 and 20 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_campaigns_list_mix where vcl_id='$vcl_id' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_LISTMIX', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPANHA LIST MIX', event_sql=\"$SQL_log\", event_notes='Mesclagem de Lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
MESCLAGEM REMOVIDA:$campaign_id - $vcl_id - $vcl_name\n"; + } + } + + ##### Set list mix entry to active ##### + if ($stage=='SETACTIVE') + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) ) + { + echo "
MESCLAGEM NÃO ATIVADA - Por favor, volte e verifique os dados digitados\n"; + echo "
vcl_id must be between 1 and 20 characters in length\n"; + } + else + { + $stmt="UPDATE vicidial_campaigns_list_mix SET status='INACTIVE' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE vicidial_campaigns_list_mix SET status='ACTIVE' where vcl_id='$vcl_id' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPANHA LIST MIX ACTIVE', event_sql=\"$SQL_log\", event_notes='Mesclagem de Lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
MESCLAGEM ATIVADA: $campaign_id - $vcl_id - $vcl_name\n"; + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=29; + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=411 submit list modifications to the system +###################### + +if ($ADD==411) + { + if ($LOGmodify_lists==1) + { + echo ""; + + if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) + { + echo "
LISTA NÃO ALTERADA - Por favor volte e verifique os dados digitados\n"; + echo "
o nome da lista precisa ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + if (strlen($reset_time) < 4) {$reset_time='';} + + echo "
LISTA ALTERADA: $list_id\n"; + + $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate',reset_time='$reset_time',agent_script_override='$agent_script_override',campaign_cid_override='$campaign_cid_override',am_message_exten_override='$am_message_exten_override',drop_inbound_group_override='$drop_inbound_group_override',xferconf_a_number='$xferconf_a_number',xferconf_b_number='$xferconf_b_number',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='LISTAS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_list == 'Y') + { + echo "
ZERANDO O STATUS DE CHAMADA DA LISTA\n"; + $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; + $rslt=mysql_query($stmtB, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='LISTAS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if ($campaign_id != "$old_campaign_id") + { + echo "
REMOVENDO REGISTROS HOPPERS DO HOPPER DA CAMPANHA ANTIGA ($old_campaign_id)\n"; + $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; + $rslt=mysql_query($stmtC, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=311; # go to list modification form below + } + + +###################### +# ADD=4111 modify in-group info in the system +###################### + +if ($ADD==4111) + { + if ($LOGmodify_ingroups==1) + { + echo ""; + + if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) + { + echo "
GRUPO NÃO ALTERADO - Por favor volte e verifique os dados digitados\n"; + echo "
a cor e o nome do grupo deve ter pelo menos 2 carcteres\n"; + } + else + { + $p=0; + $qc_statuses_ct = count($qc_statuses); + while ($p < $qc_statuses_ct) + { + $QC_statuses .= " $qc_statuses[$p]"; + $p++; + } + $p=0; + $qc_lists_ct = count($qc_lists); + while ($p < $qc_lists_ct) + { + $QC_lists .= " $qc_lists[$p]"; + $p++; + } + + if (strlen($QC_statuses)>0) {$QC_statuses .= " -";} + if (strlen($QC_lists)>0) {$QC_lists .= " -";} + + + if ($no_agent_action == "INGROUP") + { + if (isset($_GET["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_GET["IGgroup_id_no_agent_action"];} + elseif (isset($_POST["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_POST["IGgroup_id_no_agent_action"];} + if (isset($_GET["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_GET["IGhandle_method_no_agent_action"];} + elseif (isset($_POST["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_POST["IGhandle_method_no_agent_action"];} + if (isset($_GET["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_GET["IGsearch_method_no_agent_action"];} + elseif (isset($_POST["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_POST["IGsearch_method_no_agent_action"];} + if (isset($_GET["IGlist_id_no_agent_action"])) {$IGlist_id=$_GET["IGlist_id_no_agent_action"];} + elseif (isset($_POST["IGlist_id_no_agent_action"])) {$IGlist_id=$_POST["IGlist_id_no_agent_action"];} + if (isset($_GET["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_GET["IGcampaign_id_no_agent_action"];} + elseif (isset($_POST["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_POST["IGcampaign_id_no_agent_action"];} + if (isset($_GET["IGphone_code_no_agent_action"])) {$IGphone_code=$_GET["IGphone_code_no_agent_action"];} + elseif (isset($_POST["IGphone_code_no_agent_action"])) {$IGphone_code=$_POST["IGphone_code_no_agent_action"];} + + $no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + } + + if ($no_agent_action == "EXTENSION") + { + if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];} + elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];} + if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];} + elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];} + + $no_agent_action_value = "$EXextension,$EXcontext"; + } + + $no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value); + + echo "
GRUPO ALTERADO: $group_id\n"; + + $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=3111; # go to in-group modification form below + } + + +###################### +# ADD=4311 modify did info in the system +###################### + +if ($ADD==4311) + { + if ($LOGmodify_dids==1) + { + echo ""; + + if ( (strlen($did_id) < 1) or (strlen($did_pattern) < 1) ) + { + echo "
DDR NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n"; + echo "
did_extension must be at least 1 character in length\n"; + } + else + { + echo "
DDR ALTERADO: $did_pattern\n"; + + $stmt="UPDATE vicidial_inbound_dids set did_pattern='$did_pattern',did_description='$did_description',did_active='$did_active',did_route='$did_route',extension='$extension',exten_context='$exten_context',voicemail_ext='$voicemail_ext',phone='$phone',server_ip='$server_ip',user='$user',user_unavailable_action='$user_unavailable_action',user_route_settings_ingroup='$user_route_settings_ingroup',group_id='$group_id',call_handle_method='$call_handle_method',agent_search_method='$agent_search_method',list_id='$list_id',campaign_id='$campaign_id',phone_code='$phone_code',menu_id='$menu_id' where did_id='$did_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='DIDS', event_type='MODIFY', record_id='$did_id', event_code='ADMIN MODIFY DID', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=3311; # go to did modification form below + } + + +###################### +# ADD=4511 modify call menu info in the system +###################### + +if ($ADD==4511) + { + if ($LOGmodify_dids==1) + { + echo ""; + + if (strlen($menu_id) < 1) + { + echo "
MENU NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n"; + echo "
menu_id must be at least 1 character in length\n"; + } + else + { + echo "
MENU ALTERADO: $menu_id\n"; + + $stmt="UPDATE vicidial_call_menu set menu_name='$menu_name',menu_prompt='$menu_prompt',menu_timeout='$menu_timeout',menu_timeout_prompt='$menu_timeout_prompt',menu_invalid_prompt='$menu_invalid_prompt',menu_repeat='$menu_repeat',menu_time_check='$menu_time_check',call_time_id='$call_time_id',track_in_vdac='$track_in_vdac',custom_dialplan_entry='$custom_dialplan_entry',tracking_group='$tracking_group' where menu_id='$menu_id';"; + $rslt=mysql_query($stmt, $link); + + $h=0; + $option_value_list='|'; + while ($h <= 18) + { + $option_value=''; $option_description=''; $option_route=''; $option_route_value=''; $option_route_value_context=''; + + if (isset($_GET["option_value_$h"])) {$option_value=$_GET["option_value_$h"];} + elseif (isset($_POST["option_value_$h"])) {$option_value=$_POST["option_value_$h"];} + if (isset($_GET["option_description_$h"])) {$option_description=$_GET["option_description_$h"];} + elseif (isset($_POST["option_description_$h"])) {$option_description=$_POST["option_description_$h"];} + if (isset($_GET["option_route_$h"])) {$option_route=$_GET["option_route_$h"];} + elseif (isset($_POST["option_route_$h"])) {$option_route=$_POST["option_route_$h"];} + if (isset($_GET["option_route_value_$h"])) {$option_route_value=$_GET["option_route_value_$h"];} + elseif (isset($_POST["option_route_value_$h"])) {$option_route_value=$_POST["option_route_value_$h"];} + if (isset($_GET["option_route_value_context_$h"])) {$option_route_value_context=$_GET["option_route_value_context_$h"];} + elseif (isset($_POST["option_route_value_context_$h"])) {$option_route_value_context=$_POST["option_route_value_context_$h"];} + + if ($option_route == "INGROUP") + { + if (isset($_GET["IGhandle_method_$h"])) {$IGhandle_method=$_GET["IGhandle_method_$h"];} + elseif (isset($_POST["IGhandle_method_$h"])) {$IGhandle_method=$_POST["IGhandle_method_$h"];} + if (isset($_GET["IGsearch_method_$h"])) {$IGsearch_method=$_GET["IGsearch_method_$h"];} + elseif (isset($_POST["IGsearch_method_$h"])) {$IGsearch_method=$_POST["IGsearch_method_$h"];} + if (isset($_GET["IGlist_id_$h"])) {$IGlist_id=$_GET["IGlist_id_$h"];} + elseif (isset($_POST["IGlist_id_$h"])) {$IGlist_id=$_POST["IGlist_id_$h"];} + if (isset($_GET["IGcampaign_id_$h"])) {$IGcampaign_id=$_GET["IGcampaign_id_$h"];} + elseif (isset($_POST["IGcampaign_id_$h"])) {$IGcampaign_id=$_POST["IGcampaign_id_$h"];} + if (isset($_GET["IGphone_code_$h"])) {$IGphone_code=$_GET["IGphone_code_$h"];} + elseif (isset($_POST["IGphone_code_$h"])) {$IGphone_code=$_POST["IGphone_code_$h"];} + + $option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + } + + if ($non_latin < 1) + { + $option_value = ereg_replace("[^-\_0-9A-Z]","",$option_value); + $option_description = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$option_description); + $option_route = ereg_replace("[^-_0-9a-zA-Z]","",$option_route); + $option_route_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$option_route_value); + $option_route_value_context = ereg_replace("[^,-_0-9a-zA-Z]","",$option_route_value_context); + } + + if (strlen($option_route) > 0) + { + $stmtA="SELECT count(*) from vicidial_call_menu_options where menu_id='$menu_id' and option_value='$option_value';"; + $rslt=mysql_query($stmtA, $link); + $row=mysql_fetch_row($rslt); + $option_exists = $row[0]; + + if ($option_exists > 0) + { + $stmtA="UPDATE vicidial_call_menu_options SET option_description='$option_description',option_route='$option_route',option_route_value='$option_route_value',option_route_value_context='$option_route_value_context' where menu_id='$menu_id' and option_value='$option_value';"; + $rslt=mysql_query($stmtA, $link); + $stmtAX .= "$stmtA|"; + } + else + { + $stmtA="INSERT INTO vicidial_call_menu_options SET menu_id='$menu_id',option_value='$option_value',option_description='$option_description',option_route='$option_route',option_route_value='$option_route_value',option_route_value_context='$option_route_value_context';"; + $rslt=mysql_query($stmtA, $link); + $stmtAX .= "$stmtA|"; + } + } + else + { + $stmtA="SELECT count(*) from vicidial_call_menu_options where menu_id='$menu_id' and option_value='$option_value';"; + $rslt=mysql_query($stmtA, $link); + $row=mysql_fetch_row($rslt); + $option_exists_db = $row[0]; + + if ($option_exists_db > 0) + { + $stmtA="DELETE FROM vicidial_call_menu_options where menu_id='$menu_id' and option_value='$option_value';"; + $rslt=mysql_query($stmtA, $link); + $stmtAX .= "$stmtA|"; + } + } + $option_value_list .= "$option_value|"; + $h++; + } + ## delete existing database records that were not in the submit + while ($h <= 18) + { + if (!preg_match("/\|$dtmf[$h]\|/i",$option_value_list)) + { + $stmtA="SELECT count(*) from vicidial_call_menu_options where menu_id='$menu_id' and option_value='$dtmf[$h]';"; + $rslt=mysql_query($stmtA, $link); + $row=mysql_fetch_row($rslt); + $option_exists_db = $row[0]; + + if ($option_exists_db > 0) + { + $stmtA="DELETE FROM vicidial_call_menu_options where menu_id='$menu_id' and option_value='$dtmf[$h]';"; + $rslt=mysql_query($stmtA, $link); + $stmtAX .= "$stmtA|"; + } + } + $h++; + } + + $stmtA="UPDATE servers set rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $rslt=mysql_query($stmtA, $link); + $stmtAX .= "$stmtA|"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtAX"; + $SQL_log = ereg_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='CALLMENUS', event_type='MODIFY', record_id='$menu_id', event_code='ADMIN MODIFY CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=3511; # go to call menu modification form below + } + + +###################### +# ADD=41111 modify remote agents info in the system +###################### + +if ($ADD==41111) + { + if ($LOGmodify_remoteagents==1) + { + echo ""; + + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
AGENTES REMOTOS NÃO ALTERADOS - Por favor volte e verifique os dados digitados\n"; + echo "
O início do ID e a Extensão Externa deve ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
AGENTES REMOTOS ALTERADOS\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=31111; # go to remote agents modification form below + } + + +###################### +# ADD=411111 modify user group info in the system +###################### + +if ($ADD==411111) + { + if ($LOGmodify_usergroups==1) + { + echo ""; + + if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) + { + echo "
GRUPO DE USUÁRIOS NÃO MODIFICADO - Por favor volte e verifique os dados digitados\n"; + echo "
Nome e descrição do grupo devem ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $group_shifts[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$group_shifts[$p]); + $GROUP_shifts .= "$group_shifts[$p] "; + $p++; + } + $p=0; + $VGROUP_vgroups=' '; + $vgroup_vgroups_ct = count($agent_status_viewable_groups); + while ($p <= $vgroup_vgroups_ct) + { + $agent_status_viewable_groups[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); + $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; + $p++; + } + + $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time' where user_group='$OLDuser_group';"; + $rslt=mysql_query($stmt, $link); + + echo "
GRUPO DE USUÁRIOS ALTERADO\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY GRUPO DE USUÁRIOS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ############################################################### + ##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + $stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } + ##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### + ############################################################# + + if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + echo 'Connected successfully'; + mysql_select_db("$vtiger_dbname", $linkV); + + ###################################### + ##### BEGIN Add/Update group info in Vtiger + $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $group_found_count = $row[0]; + + ### group exists in vtiger, update it + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$user_group';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + + $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #### END CREATE NEW GROUP RECORD IN VTIGER + } + ##### END Add/Update group info in Vtiger + ###################################### + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=311111; # go to user group modification form below + } + + +###################### +# ADD=4111111 modify script in the system +###################### + +if ($ADD==4111111) + { + if ($LOGmodify_scripts==1) + { + echo "\n"; + echo "\n"; + echo ""; + + if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) + { + echo "
SCRIPT NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Nome do script, descrição e texto devem ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
SCRIPT ALTERADO\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SCRIPTS', event_type='MODIFY', record_id='$script_id', event_code='ADMIN MODIFY SCRIPT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=3111111; # go to script modification form below + } + + +###################### +# ADD=41111111 modify filter in the system +###################### + +if ($ADD==41111111) + { + if ($LOGmodify_filters==1) + { + echo "\n"; + echo "\n"; + echo ""; + + if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) + { + echo "
FILTRO NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do Filtro, nome e SQL devem ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "' where lead_filter_id='$lead_filter_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
FILTRO ALTERADO\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='FILTROS', event_type='MODIFY', record_id='$lead_filter_id', event_code='ADMIN MODIFY FILTER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=31111111; # go to filter modification form below + } + + +###################### +# ADD=411111111 modify call time in the system +###################### + +if ($ADD==411111111) + { + if ($LOGmodify_call_times==1) + { + echo ""; + + if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) + { + echo "
HORÁRIO DE CHAMADA NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID e nome do Horário de Chamada deve ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $ct_default_start = preg_replace('/\D/', '', $ct_default_start); + $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); + $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); + $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); + $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); + $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); + $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); + $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); + $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); + $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); + $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); + $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); + $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); + $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); + $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); + $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); + $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop' where call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
HORÁRIO DE CHAMADA ALTERADO\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CALLTIMES', event_type='MODIFY', record_id='$call_time_id', event_code='ADMIN MODIFY CALL TIME', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=311111111; # go to call time modification form below + } + + +###################### +# ADD=4111111111 modify state call time in the system +###################### + +if ($ADD==4111111111) + { + if ($LOGmodify_call_times==1) + { + echo ""; + + if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) + { + echo "
HORÁRIO DE CHAMADA POR ESTADO NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID da configuração de chamada por estado, nome e estado devem ter no mínimo 2 caracteres de comprimento\n"; + } + else + { + $ct_default_start = preg_replace('/\D/', '', $ct_default_start); + $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); + $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); + $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); + $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); + $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); + $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); + $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); + $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); + $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); + $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); + $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); + $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); + $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); + $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); + $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); + $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
HORÁRIO DE CHAMADA POR ESTADO ALTERADO\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CALLTIMES', event_type='MODIFY', record_id='$call_time_id', event_code='ADMIN MODIFY STATE CALL TIME', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=3111111111; # go to state call time modification form below + } + + +###################### +# ADD=431111111 modify shift in the system +###################### + +if ($ADD==431111111) + { + if ($LOGmodify_call_times==1) + { + echo ""; + + $shift_length_test = eregi_replace(':','',$shift_length); + if ( (strlen($shift_id) < 2) or (strlen($shift_name) < 2) or (strlen($shift_start_time) < 4) or (strlen($shift_start_time) > 4) or (strlen($shift_length) < 5) or (strlen($shift_length) > 5) or ($shift_start_time > 2359) or ($shift_length_test > 2400) ) + { + echo "
SHIFT DEFINITION NOT MODIFIED - Por favor, volte e verifique os dados digitados\n"; + echo "
ID e Nome do turno devem ter pelo menos 2 caracteres\n"; + echo "
Horário de início deve ter 4 caracteres e ser um horário válido\n"; + echo "
Duração do Turno deve ter 5 caracteres e 24 horas ou menos\n"; + } + else + { + $p=0; + $shift_weekdays_ct = count($shift_weekdays); + while ($p <= $shift_weekdays_ct) + { + $SHIFT_weekdays .= "$shift_weekdays[$p]"; + $p++; + } + $shift_start_time = preg_replace('/\D/', '', $shift_start_time); + $stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays' where shift_id='$shift_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
TURNOS ALTERADOS\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SHIFTS', event_type='MODIFY', record_id='$shift_id', event_code='ADMIN MODIFY SHIFT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=331111111; # go to shift modification form below + } + + +###################### +# ADD=41111111111 modify phone record in the system +###################### + +if ($ADD==41111111111) + { + if ($LOGast_admin_access==1) + { + echo ""; + + $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) + {echo "
RAMAL NÃO MODIFICADO - já existe no sistema um ramal com esta extensão e servidor\n";} + else + { + if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) + {echo "
RAMAL NÃO MODIFICADO - Por favor volte e verifique os dados digitados\n";} + else + { + echo "
RAMAL ALTERADO: $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='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($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' where extension='$old_extension' and server_ip='$old_server_ip';"; + $rslt=mysql_query($stmt, $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_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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 ALTERAR RAMAL', event_sql=\"$SQL_log\", event_notes='IP do Servidor: $server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=31111111111; # go to phone modification form below + } + + +###################### +# ADD=42111111111 modify phone alias record in the system +###################### + +if ($ADD==42111111111) + { + if ($LOGast_admin_access==1) + { + echo ""; + + $stmt="SELECT count(*) from phones_alias where alias_id='$alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) ) + {echo "
ALIAS DE RAMAL NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
ALIAS DE RAMAL ALTERADO: $alias_id\n"; + + $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='PHONEALIASES', event_type='MODIFY', record_id='$alias_id', event_code='ADMIN ALTERAR ALIAS DE RAMAL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=32111111111; # go to phone alias modification form below + } + + +###################### +# ADD=43111111111 modify group alias record in the system +###################### + +if ($ADD==43111111111) + { + if ($LOGast_admin_access==1) + { + echo ""; + + $stmt="SELECT count(*) from groups_alias where group_alias_id='$group_alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (strlen($group_alias_id) < 1) or (strlen($group_alias_name) < 2) ) + {echo "
ALIAS DE GRUPO NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n";} + else + { + echo "
ALIAS DE GRUPO ALTERADO: $alias_id\n"; + + $stmt="UPDATE groups_alias set group_alias_name='$group_alias_name', caller_id_number='$caller_id_number', caller_id_name='$caller_id_name', active='$active' where group_alias_id='$group_alias_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='GROUPALIASES', event_type='MODIFY', record_id='$group_alias_id', event_code='ADMIN ALTERAR ALIAS DE GRUPO', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=33111111111; # go to group alias modification form below + } + + +###################### +# ADD=411111111111 modify server record in the system +###################### + +if ($ADD==411111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + + $stmt="SELECT count(*) from servers where server_id='$server_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($row[0] > 0) && ($server_id != $old_server_id) ) + {echo "
SERVIDOR NOT MODIFIED - there is already a server in the system with this server_id\n";} + else + { + $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) + {echo "
SERVIDOR NÃO ALTERADO - já existe no sistema um servidor com este IP\n";} + else + { + if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) + {echo "
SERVIDOR NÃO ALTERADO - Por favor volte e verifique os dados digitados\n";} + else + { + $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output', vicidial_balance_active='$vicidial_balance_active',balance_trunks_offlimits='$balance_trunks_offlimits',recording_web_link='$recording_web_link',alt_server_ip='$alt_server_ip',active_asterisk_server='$active_asterisk_server',generate_vicidial_conf='$generate_vicidial_conf',rebuild_conf_files='$rebuild_conf_files',outbound_calls_per_second='$outbound_calls_per_second',sounds_update='$sounds_update',vicidial_recording_limit='$vicidial_recording_limit',carrier_logging_active='$carrier_logging_active',vicidial_balance_rank='$vicidial_balance_rank',rebuild_music_on_hold='$rebuild_music_on_hold',active_agent_login_server='$active_agent_login_server',conf_secret='$conf_secret' where server_id='$old_server_id';"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $rslt=mysql_query($stmtA, $link); + + echo "
SERVIDOR MODIFICADO: $server_ip\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SERVERS', event_type='MODIFY', record_id='$server_id', event_code='ADMIN ALTERAR SERVIDOR', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=311111111111; # go to server modification form below + } + + +###################### +# ADD=421111111111 modify vicidial server trunks record in the system +###################### + +if ($ADD==421111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + $stmt="SELECT max_vicidial_trunks from servers where server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $MAXvicidial_trunks = $rowx[0]; + + $stmt="SELECT sum(dedicated_trunks) from vicidial_server_trunks where server_ip='$server_ip' and campaign_id !='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $SUMvicidial_trunks = ($rowx[0] + $dedicated_trunks); + + if ($SUMvicidial_trunks > $MAXvicidial_trunks) + { + echo "
REGISTRO DE TRUNK VICIDIAL NÃO ADICIONADO - o número de trunk vicidial é muito alto: $SUMvicidial_trunks / $MAXvicidial_trunks\n"; + } + else + { + if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) or (strlen($dedicated_trunks) < 1) or (strlen($trunk_restriction) < 1) ) + { + echo "
REGISTRO DE TRUNK VICIDIAL NÃO INCLUÍDO - Por favor, volte e verifique os dados digitados\n"; + echo "
campanha deve ter entre 3 e 8 caracteres de comprimento\n"; + echo "
delay do IP do servidor deve ser pelo menos 7 caracteres\n"; + echo "
trunks devem ter um digito entre 0 e 9999\n"; + } + else + { + $stmt="UPDATE vicidial_server_trunks SET dedicated_trunks='$dedicated_trunks',trunk_restriction='$trunk_restriction' where campaign_id='$campaign_id' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + + echo "
REGISTRO DE TRUNK VICIDIAL ALTERADO: $campaign_id - $server_ip - $dedicated_trunks - $trunk_restriction\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SERVERTRUNKS', event_type='MODIFY', record_id='$server_ip', event_code='ADMIN ALTERAR SERVIDOR TRUNK', event_sql=\"$SQL_log\", event_notes='Campanha: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=311111111111; # go to server modification form below + } + + +###################### +# ADD=431111111111 modify conf template record in the system +###################### '$template_id','$template_name','$template_contents' + +if ($ADD==431111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($template_id) < 1) or (strlen($template_name) < 1) ) + {echo "
TEMPLATE DE CONF NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n";} + else + { + $stmt="UPDATE vicidial_conf_templates set template_name='$template_name',template_contents='$template_contents' where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $rslt=mysql_query($stmtA, $link); + + echo "
CONF TEMPLATE MODIFIED: $template_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CONFTEMPLATES', event_type='MODIFY', record_id='$template_id', event_code='ADMIN ALTERAR TEMPLATE CONF', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=331111111111; # go to conf template modification form below + } + + +###################### +# ADD=441111111111 modify carrier record in the system +###################### + +if ($ADD==441111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($carrier_id) < 1) or (strlen($server_ip) < 7) or (strlen($protocol) < 1) ) + {echo "
OPERADORA NÃO ALTERADA - Por favor, volte e verifique os dados digitados\n";} + else + { + $stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active',carrier_description='$carrier_description' where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $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_query($stmtA, $link); + + echo "
OPERADORA ALTERADA: $carrier_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CARRIERS', event_type='MODIFY', record_id='$carrier_id', event_code='ADMIN ALTERAR OPERADORA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=341111111111; # go to carrier modification form below + } + + +###################### +# ADD=451111111111 modify tts record in the system +###################### + +if ($ADD==451111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($tts_id) < 2) or (strlen($tts_name) < 5) ) + {echo "
TTS ENTRADA SIN MODIFICAR - Por favor, volte e verifique os dados digitados\n";} + else + { + $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_text=\"$tts_text\" where tts_id='$tts_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
TTS entrada modificada: $tts_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='TTS', event_type='MODIFY', record_id='$tts_id', event_code='ADMIN MODIFY TTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=351111111111; # go to tts entry modification form below + } + + +###################### +# ADD=461111111111 modify music on hold record in the system +###################### + +if ($ADD==461111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + + if ($stage == "FILEDELETE") + { + if ( (strlen($moh_id) < 2) or (strlen($filename) < 1) or ($moh_id=='sounds') or ($moh_id=='agi-bin') or ($moh_id=='astdb') or ($moh_id=='keys') ) + {echo "
MÚSICA EN ESPERA DE ENTRADA SIN MODIFICAR - Por favor, volte e verifique os dados digitados\n";} + else + { + $stmt="DELETE FROM vicidial_music_on_hold_files where moh_id='$moh_id' and filename='$filename';"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $rslt=mysql_query($stmtA, $link); + + echo "
MÚSICA EN ESPERA entrada modificada: $moh_id - $filename\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|"; + $SQL_log = ereg_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='MOH', event_type='MODIFY', record_id='$moh_id', event_code='ADMIN MODIFY MOH', event_sql=\"$SQL_log\", event_notes='FILE DELETE';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + if ( (strlen($moh_id) < 2) or (strlen($moh_name) < 5) or ($moh_id=='sounds') or ($moh_id=='agi-bin') or ($moh_id=='astdb') or ($moh_id=='keys') ) + {echo "
MÚSICA EN ESPERA DE ENTRADA SIN MODIFICAR - Por favor, volte e verifique os dados digitados\n";} + else + { + $stmt="UPDATE vicidial_music_on_hold set moh_name='$moh_name',active='$active',random='$random' where moh_id='$moh_id';"; + $rslt=mysql_query($stmt, $link); + $stmtLIST = $stmt; + + $stmt="SELECT filename,rank from vicidial_music_on_hold_files where moh_id='$moh_id' order by rank;"; + $rsltx=mysql_query($stmt, $link); + $mohfiles_to_print = mysql_num_rows($rsltx); + $ranks = ($mohfiles_to_print + 1); + $o=0; + while ($mohfiles_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $mohfiles[$o] = $rowx[0]; + $mohranks[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($mohfiles_to_print > $o) + { + $new_rank=0; + $Ffilename = $mohfiles[$o]; + if (isset($_GET[$Ffilename])) {$new_rank=$_GET[$Ffilename];} + elseif (isset($_POST[$Ffilename])) {$new_rank=$_POST[$Ffilename];} + + $stmt="UPDATE vicidial_music_on_hold_files set rank='$new_rank' where moh_id='$moh_id' and filename='$mohfiles[$o]';"; + $rslt=mysql_query($stmt, $link); + $stmtLIST .= "|$stmt"; + $o++; + } + + if (strlen($filename) > 0) + { + $stmt="INSERT INTO vicidial_music_on_hold_files set filename='$filename',rank='$ranks',moh_id='$moh_id';"; + $rslt=mysql_query($stmt, $link); + $stmtLIST .= "|$stmt"; + } + + $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $rslt=mysql_query($stmtA, $link); + + echo "
MÚSICA EN ESPERA entrada modificada: $moh_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtLIST|$stmtA|"; + $SQL_log = ereg_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='MOH', event_type='MODIFY', record_id='$moh_id', event_code='ADMIN MODIFY MOH', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=361111111111; # go to music on hold entry modification form below + } + + +###################### +# ADD=471111111111 modify voicemail record in the system +###################### + +if ($ADD==471111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($voicemail_id) < 2) or (strlen($fullname) < 2) ) + {echo "
Contestador SIN MODIFICAR - Por favor, volte e verifique os dados digitados\n";} + else + { + $stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email' where voicemail_id='$voicemail_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="SELECT active_voicemail_server from system_settings;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $active_voicemail_server = $row[0]; + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$active_voicemail_server';"; + $rslt=mysql_query($stmtA, $link); + + echo "
Contestador MODIFICADOS: $voicemail_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='VOICEMAIL', event_type='MODIFY', record_id='$voicemail_id', event_code='ADMIN MODIFY VOICEMAIL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=371111111111; # go to voicemail entry modification form below + } + + +###################### +# ADD=4111111111111 modify conference record in the system +###################### + +if ($ADD==4111111111111) + { + if ($LOGast_admin_access==1) + { + echo ""; + + $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + {echo "
CONFERÊNCIA NÃO ALTERADA - já existe no sistema uma conferência com esta extensão e servidor\n";} + else + { + if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) + {echo "
CONFERÊNCIA NÃO ALTERADA - Por favor volte e verifique os dados digitados\n";} + else + { + echo "
CONFERÊNCIA ALTERADA: $conf_exten\n"; + + $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=3111111111111; # go to conference modification form below + } + + +###################### +# ADD=41111111111111 modify vicidial conference record in the system +###################### + +if ($ADD==41111111111111) + { + if ($LOGast_admin_access==1) + { + echo ""; + + $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) + {echo "
VICIDIAL CONFERÊNCIA NÃO ALTERADA - já existe no sistema uma conferência com esta extensão e servidor\n";} + else + { + if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) + {echo "
VICIDIAL CONFERÊNCIA NÃO ALTERADA - Por favor volte e verifique os dados digitados\n";} + else + { + echo "
VICIDIAL CONFERÊNCIA ALTERADA: $conf_exten\n"; + + $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $rslt=mysql_query($stmt, $link); + + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=31111111111111; # go to vicidial conference modification form below + } + + +###################### +# ADD=411111111111111 modify vicidial system settings +###################### + +if ($ADD==411111111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + + echo "
CONFIGURAÇÕES DE SISTEMA ALTERADAS\n"; + + $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SYSTEMSETTINGS', event_type='MODIFY', record_id='system_settings', event_code='ADMIN MODIFY SYSTEM SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=311111111111111; # go to vicidial system settings form below + } + + +###################### +# ADD=421111111111111 modify/delete system status in the system +###################### + +if ($ADD==421111111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + + if (ereg('delete',$stage)) + { + if ( (strlen($status) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$status)) ) + { + echo "
STATUS DE SISTEMA NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
el estado de sistema no puede ser un estado reservado:B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; + echo "
el estado de sistema necesita ser por lo menos los caracteres 1 enlongitud\n"; + } + else + { + echo "
SYSTEM STATUS DELETED: $status\n"; + + $stmt="DELETE FROM vicidial_statuses where status='$status';"; + $rslt=mysql_query($stmt, $link); + + $stmtA="DELETE FROM vicidial_campaign_hotkeys where status='$status';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SYSTEMSTATUS', event_type='DELETE', record_id='$status', event_code='ADMIN DELETE SYSTEM STATUS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + if (ereg('modify',$stage)) + { + if ( (strlen($status) < 1) or (strlen($status_name) < 2) ) + { + echo "
STATUS DO SISTEMA NÃO ALTERADO - Por favor, volte e verifique os dados digitados\n"; + echo "
el estado de sistema necesita ser por lo menos los caracteres 1 enlongitud\n"; + echo "
o nome do status deve ter pelo menos 1 caractere de comprimento\n"; + } + else + { + echo "
STATUS DO SISTEMA ALTERADO: $status\n"; + + $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category',sale='$sale',dnc='$dnc',customer_contact='$customer_contact',not_interested='$not_interested',unworkable='$unworkable' where status='$status';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SYSTEMSTATUS', event_type='MODIFY', record_id='$status', event_code='ADMIN MODIFY SYSTEM STATUS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=321111111111111; # go to system settings modification form below + } + + +###################### +# ADD=431111111111111 modify/delete status category in the system +###################### + +if ($ADD==431111111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) ) + { + echo "
CATEGORIA NÃO ALTERADA - Por favor, volte e verifique os dados digitados\n"; + echo "
a categoria de status não pode ser uma categoria reservada:UNDEFINED\n"; + echo "
a categoria de status precisa ter pelo menos 2 caracteres\n"; + } + else + { + if (ereg('delete',$stage)) + { + echo "
CATEGORIA REMOVIDA: $vsc_id\n"; + + $stmt="DELETE FROM vicidial_status_categories where vsc_id='$vsc_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='STATUSCATEGORIES', event_type='DELETE', record_id='$vsc_id', event_code='ADMIN DELETE STATUS CATEGORIA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if (ereg('modify',$stage)) + { + echo "
CATEGORIA ALTERADA: $vsc_id\n"; + + $stmt="SELECT count(*) from vicidial_status_categories where tovdad_display='Y' and vsc_id NOT IN('$vsc_id');"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($row[0] > 3) and (ereg('Y',$tovdad_display)) ) + { + $tovdad_display = 'N'; + echo "
ERRO: Já existem 4 Categorias de Status no Relatório TimeOnVDAD\n"; + } + + $stmt="UPDATE vicidial_status_categories SET vsc_name='$vsc_name',vsc_description='$vsc_description',tovdad_display='$tovdad_display',sale_category='$sale_category',dead_lead_category='$dead_lead_category' where vsc_id='$vsc_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='STATUSCATEGORIES', event_type='MODIFY', record_id='$vsc_id', event_code='ADMIN MODIFY STATUS CATEGORIA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=331111111111111; # go to system settings modification form below + } + + +###################### +# ADD=441111111111111 modify/delete qc status code in the system +###################### + +if ($ADD==441111111111111) + { + if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) + { + echo ""; + + if (ereg('delete',$stage)) + { + if ( (strlen($code) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$code)) ) + { + echo "
CÓDIGO DE STATUS CQ NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
the qc status code cannot be a reserved status: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; + echo "
o código de status cq precisa ter pelo menos 1 caracter de comprimento\n"; + } + else + { + echo "
CÓDIGO DE STATUS CQ REMOVIDO:$code\n"; + + $stmt="DELETE FROM vicidial_qc_codes where code='$code';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='QCCODES', event_type='DELETE', record_id='$vsc_id', event_code='ADMIN DELETE QC CODES', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + if (ereg('modify',$stage)) + { + if ( (strlen($code) < 1) or (strlen($code_name) < 2) ) + { + echo "
CÓDIGO DE STATUS CQ NÃO ALTERADO- Por favor, volte e verifique os dados digitados\n"; + echo "
o código de status cq precisa ter pelo menos 1 caracter de comprimento\n"; + echo "
o nome do status cq precisa ter pelo menos 1 caracter de comprimento\n"; + } + else + { + echo "
CÓDIGO DE STATUS CQ ALTERADO:$code\n"; + + $stmt="UPDATE vicidial_qc_codes SET code_name='$code_name' where code='$code';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='QCCODES', event_type='MODIFY', record_id='$vsc_id', event_code='ADMIN MODIFY QC CODES', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=341111111111111; # go to qc status code modification form below + } + + + + +###################################################################################################### +###################################################################################################### +####### 5 series, delete records confirmation +###################################################################################################### +###################################################################################################### + + +###################### +# ADD=5 confirmation before deletion of user +###################### + +if ($ADD==5) + { + echo ""; + + if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) + { + echo "
USUÁRIO NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Usuário be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DO USUÁRIO: $user\n"; + echo "

Clique aqui para apagar o usuário $user


\n"; + } + + $ADD='3'; # go to user modification below + } + +###################### +# ADD=51 confirmation before deletion of campaign +###################### + +if ($ADD==51) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or ($LOGdelete_campaigns < 1) ) + { + echo "
CAMPANHA NÃO APAGADA - Por favor, volte e verifique os dados digitados\n"; + echo "
Campanha_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DA CAMPANHA: $campaign_id\n"; + echo "

Clique aqui para apagar a campanha $campaign_id


\n"; + } + + $ADD='31'; # go to campaign modification below + } + +###################### +# ADD=52 confirmation before logging all agents out of campaign of campaign +###################### + +if ($ADD==52) + { + echo ""; + + if (strlen($campaign_id) < 2) + { + echo "
AGENTES NÃO DESLIGADOS DA CAMPANHA - Por favor, volte e verifique os dados digitados\n"; + echo "
Campanha_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE SAÍDA FORÇADA DOS AGENTES: $campaign_id\n"; + echo "

Clique aqui para desconectar todos os agentes $campaign_id


\n"; + } + + $ADD='31'; # go to campaign modification below + } + +###################### +# ADD=53 confirmation before Emergency VDAC Jam Clear - deletes oldest LIVE vicidial_auto_call record +###################### + +if ($ADD==53) + { + if (eregi('IN',$stage)) + {$group_id=$campaign_id;} + echo ""; + + if (strlen($campaign_id) < 2) + { + echo "
VDAC NÃO LIMPO PARA CAMPANHA - Por favor, volte e verifique os dados digitados\n"; + echo "
Campanha_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAR LIMPEZA DO VDAC: $campaign_id\n"; + echo "

Clique aqui para apagar o registro mais velho do VDAC para $campaign_id


\n"; + } + + # go to campaign modification below + if (eregi('IN',$stage)) + {$ADD='3111';} + else + {$ADD='31';} + } + +###################### +# ADD=511 confirmation before deletion of list +###################### + +if ($ADD==511) + { + echo ""; + + if ( (strlen($list_id) < 2) or ($LOGdelete_lists < 1) ) + { + echo "
LISTA NÃO APAGADA - Por favor, volte e verifique os dados digitados\n"; + echo "
List_id be at least 2 characters in length\n"; + } + else + { + echo "
COMFIRMAÇÃO DE REMOÇÃO DA LISTA: $list_id\n"; + echo "

Clique aqui para apagar a lista e todos os seus registros $list_id


\n"; + } + + $ADD='311'; # go to campaign modification below + } + +###################### +# ADD=5111 confirmation before deletion of in-group +###################### + +if ($ADD==5111) + { + echo ""; + + if ( (strlen($group_id) < 2) or ($LOGdelete_ingroups < 1) ) + { + echo "
GRUPO DE ENTRADA NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Group_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DE GRUPO DE ENTRADA: $group_id\n"; + echo "

Clique aqui para apagar este grupo de entrada $group_id


\n"; + } + + $ADD='3111'; # go to in-group modification below + } + +###################### +# ADD=5311 confirmation before deletion of did +###################### + +if ($ADD==5311) + { + echo ""; + + if ( (strlen($did_id) < 1) or ($LOGdelete_dids < 1) ) + { + echo "
DDR NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
did_id be at least 1 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DO DDR: $menu_id\n"; + echo "

Clique aqui para removerDID $did_id


\n"; + } + + $ADD='3311'; # go to did modification below + } + +###################### +# ADD=5511 confirmation before deletion of call menu +###################### + +if ($ADD==5511) + { + echo ""; + + if ( (strlen($menu_id) < 2) or ($LOGdelete_dids < 1) ) + { + echo "
MENU NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
menu_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DE MENU: $menu_id\n"; + echo "

Clique aqui para remover o MENU $menu_id


\n"; + } + + $ADD='3511'; # go to call menu modification below + } + +###################### +# ADD=51111 confirmation before deletion of remote agent record +###################### + +if ($ADD==51111) + { + echo ""; + + if ( (strlen($remote_agent_id) < 1) or ($LOGdelete_remote_agents < 1) ) + { + echo "
AGENTE REMOTO NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Remote_agent_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DE AGENTE REMOTO: $remote_agent_id\n"; + echo "

Clique aqui para apagar este usuário remoto $remote_agent_id


\n"; + } + + $ADD='31111'; # go to remote agent modification below + } + +###################### +# ADD=511111 confirmation before deletion of user group record +###################### + +if ($ADD==511111) + { + echo ""; + + if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) + { + echo "
GRUPO DE USUÁRIOS NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Usuário_group be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DE GRUPO DE USUÁRIO: $user_group\n"; + echo "

Clique aqui para apagar este grupo de usuários $user_group


\n"; + } + + $ADD='311111'; # go to user group modification below + } + +###################### +# ADD=5111111 confirmation before deletion of script record +###################### + +if ($ADD==5111111) + { + echo ""; + + if ( (strlen($script_id) < 2) or ($LOGdelete_scripts < 1) ) + { + echo "
SCRIPT NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Script_id must be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DE SCRIPT: $script_id\n"; + echo "

Clique aqui para apagar o script $script_id


\n"; + } + + $ADD='3111111'; # go to script modification below + } + +###################### +# ADD=51111111 confirmation before deletion of filter record +###################### + +if ($ADD==51111111) + { + echo ""; + + if ( (strlen($lead_filter_id) < 2) or ($LOGdelete_filters < 1) ) + { + echo "
FILTRO NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do filtro deve ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + echo "
FILTER DELETION CONFIRMATION: $lead_filter_id\n"; + echo "

Clique aqui para apagar o filtro$lead_filter_id


\n"; + } + + $ADD='31111111'; # go to filter modification below + } + +###################### +# ADD=511111111 confirmation before deletion of call time record +###################### + +if ($ADD==511111111) + { + echo ""; + + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + { + echo "
HORÁRIO DE CHAMADA NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do horário de cham. deve ter pelo menos 2 caracteres\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DO HORÁRIO DE CHAMADAS: $call_time_id\n"; + echo "

Clique aqui para removercall time $call_time_id


\n"; + } + + $ADD='311111111'; # go to call time modification below + } + +###################### +# ADD=5111111111 confirmation before deletion of state call time record +###################### + +if ($ADD==5111111111) + { + echo ""; + + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + { + echo "
HORÁRIO DE CHAM. POR ESTADO NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do horário de cham. deve ter pelo menos 2 caracteres\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DO HORÁRIO DE CHAM. POR ESTADO: $call_time_id\n"; + echo "

Clique aqui para removerstate call time $call_time_id


\n"; + } + + $ADD='3111111111'; # go to state call time modification below + } + +###################### +# ADD=531111111 confirmation before deletion of shift record +###################### + +if ($ADD==531111111) + { + echo ""; + + if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) ) + { + echo "
TURNO NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
Shift ID must be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DE TURNO:$shift_id\n"; + echo "

Clique aqui para remover o turno $shift_id


\n"; + } + + $ADD='331111111'; # go to call time modification below + } + +###################### +# ADD=51111111111 confirmation before deletion of phone record +###################### + +if ($ADD==51111111111) + { + echo ""; + + if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) ) + { + echo "
RAMAL NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Extension be at least 2 characters in length\n"; + echo "
IP do Servidor be at least 7 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DE RAMAL: $extension - $server_ip\n"; + echo "

Clique aqui para apagar este ramal $extension - $server_ip


\n"; + } + $ADD='31111111111'; # go to phone modification below + } + + +###################### +# ADD=52111111111 confirmation before deletion of phone alias record +###################### + +if ($ADD==52111111111) + { + echo ""; + + if ( (strlen($alias_id) < 1) or ($LOGast_delete_phones < 1) ) + { + echo "
ALIAS DE RAMAL NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
Alias ID must be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DE ALIAS: $alias_id\n"; + echo "

Clique aqui para remover o alias de ramal $alias_id


\n"; + } + $ADD='32111111111'; # go to phone alias modification below + } + + +###################### +# ADD=53111111111 confirmation before deletion of group alias record +###################### + +if ($ADD==53111111111) + { + echo ""; + + if ( (strlen($group_alias_id) < 1) or ($LOGast_delete_phones < 1) ) + { + echo "
ALIAS DE GRUPO NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do Alias must be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMAÇÃO DE REMOÇÃO DE ALIAS DE GRUPO: $group_alias_id\n"; + echo "

Clique aqui para remover alias de grupo $group_alias_id


\n"; + } + $ADD='33111111111'; # go to group alias modification below + } + + +###################### +# ADD=511111111111 confirmation before deletion of server record +###################### + +if ($ADD==511111111111) + { + echo ""; + + if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) ) + { + echo "
SERVIDOR NOT DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do Servidor be at least 2 characters in length\n"; + echo "
IP do Servidor be at least 7 characters in length\n"; + } + else + { + echo "
SERVIDOR DELETION CONFIRMATION: $server_id - $server_ip\n"; + echo "

Clique aqui para apagar este ramal $server_id - $server_ip


\n"; + } + $ADD='311111111111'; # go to server modification below + } + + +###################### +# ADD=531111111111 confirmation before deletion of conf template record +###################### + +if ($ADD==531111111111) + { + echo ""; + + if (strlen($template_id) < 2) + { + echo "
TEMPLATE DE CONF NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do template deve ter pelo menos 2 caracteres\n"; + } + else + { + echo "
CONFIRMAR REMOÇÃO DO TEMPLATE DE CONF: $template_id - $template_name\n"; + echo "

Clique aqui para remover esta template de conf $template_id - $template_name


\n"; + } + $ADD='331111111111'; # go to conf template modification below + } + + +###################### +# ADD=541111111111 confirmation before deletion of carrier record +###################### + +if ($ADD==541111111111) + { + echo ""; + + if (strlen($carrier_id) < 2) + { + echo "
OPERADORA NÃO REMOVIDA - Por favor, volte e verifique os dados digitados\n"; + echo "
O ID da operadora precisa ter pelo menos 2 caracteres\n"; + } + else + { + echo "
CONFIRMAR REMOÇÃO DA OPERADORA: $carrier_id - $carrier_name\n"; + echo "

Clique aqui para remover a operadora $carrier_id - $carrier_name


\n"; + } + $ADD='341111111111'; # go to carrier modification below + } + + +###################### +# ADD=551111111111 confirmation before deletion of tts record +###################### + +if ($ADD==551111111111) + { + echo ""; + + if (strlen($tts_id) < 2) + { + echo "
TTS entrada no DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
TTS ID be at least 2 characters in length\n"; + } + else + { + echo "
TTS DE ENTRADA SUPRESIÓN DE CONFIRMACIÓN: $tts_id - $tts_name\n"; + echo "

Haga clic aquí para eliminar TTS entrada $tts_id - $tts_name


\n"; + } + $ADD='351111111111'; # go to tts entry modification below + } + + +###################### +# ADD=561111111111 confirmation before deletion of music on hold record +###################### + +if ($ADD==561111111111) + { + echo ""; + + if (strlen($moh_id) < 2) + { + echo "
MÚSICA EN ESPERA DE ENTRADA no se eliminan - Por favor, volte e verifique os dados digitados\n"; + echo "
MOH ID be at least 2 characters in length\n"; + } + else + { + echo "
MÚSICA EN ESPERA DE ENTRADA SUPRESIÓN DE CONFIRMACIÓN: $moh_id - $moh_name\n"; + echo "

Haga clic aquí para borrar música en espera de entrada $moh_id - $moh_name


\n"; + } + $ADD='361111111111'; # go to music on hold entry modification below + } + + +###################### +# ADD=571111111111 confirmation before deletion of voicemail record +###################### + +if ($ADD==571111111111) + { + echo ""; + + if (strlen($voicemail_id) < 2) + { + echo "
Contestador no se eliminan - Por favor, volte e verifique os dados digitados\n"; + echo "
ID de correo de voz be at least 2 characters in length\n"; + } + else + { + echo "
Contestador SUPRESIÓN DE CONFIRMACIÓN: $voicemail_id - $fullname\n"; + echo "

Haga clic aquí para eliminar buzón de voz $voicemail_id - $fullname


\n"; + } + $ADD='371111111111'; # go to voicemail entry modification below + } + + +###################### +# ADD=5111111111111 confirmation before deletion of conference record +###################### + +if ($ADD==5111111111111) + { + echo ""; + + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) ) + { + echo "
CONFERENCE NOT DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
Conference must be at least 2 characters in length\n"; + echo "
IP do Servidor be at least 7 characters in length\n"; + } + else + { + echo "
CONFERENCE DELETION CONFIRMATION: $conf_exten - $server_ip\n"; + echo "

Clique aqui para apagar este ramal $conf_exten - $server_ip


\n"; + } + $ADD='3111111111111'; # go to conference modification below + } + + +###################### +# ADD=51111111111111 confirmation before deletion of vicidial conference record +###################### + +if ($ADD==51111111111111) + { + echo ""; + + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) ) + { + echo "
VICIDIAL CONFERENCE NOT DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
Conference must be at least 2 characters in length\n"; + echo "
IP do Servidor be at least 7 characters in length\n"; + } + else + { + echo "
VICIDIAL CONFERENCE DELETION CONFIRMATION: $conf_exten - $server_ip\n"; + echo "

Clique aqui para apagar este ramal $conf_exten - $server_ip


\n"; + } + $ADD='31111111111111'; # go to vicidial conference modification below + } + + + +###################################################################################################### +###################################################################################################### +####### 6 series, delete records +###################################################################################################### +###################################################################################################### + + +###################### +# ADD=6 delete user record +###################### + +if ($ADD==6) + { + echo ""; + + if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) + { + echo "
USUÁRIO NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Usuário be at least 2 characters in length\n"; + } + else + { + $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; + $rslt=mysql_query($stmtA, $link); + + $stmt="DELETE from vicidial_campaign_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_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='USUÁRIOS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DO USUÁRIO CONCLUÍDA: $user\n"; + echo "

\n"; + } + + $ADD='0'; # go to user list + } + +###################### +# ADD=61 delete campaign record +###################### + +if ($ADD==61) + { + echo ""; + + if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) + { + echo "
CAMPANHA NÃO APAGADA - Por favor, volte e verifique os dados digitados\n"; + echo "
Campanha_id be at least 2 characters in length\n"; + } + else + { + $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; + $rslt=mysql_query($stmtA, $link); + + $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
REMOVENDO REGISTROS HOPPERS DO HOPPER DA CAMPANHA ANTIGA ($campaign_id)\n"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPANHA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DA CAMPANHA CONCLUÍDA: $campaign_id\n"; + echo "

\n"; + } + + $ADD='10'; # go to campaigns list + } + + +###################### +# ADD=62 Logout all agents from a campaign +###################### + +if ($ADD==62) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if (strlen($campaign_id) < 2) + { + echo "
AGENTES NÃO DESLIGADOS DA CAMPANHA - Por favor, volte e verifique os dados digitados\n"; + echo "
Campanha_id be at least 2 characters in length\n"; + } + else + { + $now_date_epoch = date('U'); + $inactive_epoch = ($now_date_epoch - 60); + $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time) from vicidial_live_agents where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "
$stmt\n";} + $vla_ct = mysql_num_rows($rslt); + $k=0; + while ($vla_ct > $k) + { + $row=mysql_fetch_row($rslt); + $VLA_user[$k] = $row[0]; + $VLA_campaign_id[$k] = $row[1]; + $VLA_update_time[$k] = $row[2]; + $k++; + } + + $k=0; + while ($vla_ct > $k) + { + if ($VLA_update_time[$k] > $inactive_epoch) + { + $lead_active=0; + $stmt = "SELECT agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status,dead_epoch,dead_sec from vicidial_agent_log where user='$VLA_user[$k]' order by agent_log_id desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "
$stmt\n";} + $val_ct = mysql_num_rows($rslt); + if ($val_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VAL_agent_log_id = $row[0]; + $VAL_user = $row[1]; + $VAL_server_ip = $row[2]; + $VAL_event_time = $row[3]; + $VAL_lead_id = $row[4]; + $VAL_campaign_id = $row[5]; + $VAL_pause_epoch = $row[6]; + $VAL_pause_sec = $row[7]; + $VAL_wait_epoch = $row[8]; + $VAL_wait_sec = $row[9]; + $VAL_talk_epoch = $row[10]; + $VAL_talk_sec = $row[11]; + $VAL_dispo_epoch = $row[12]; + $VAL_dispo_sec = $row[13]; + $VAL_status = $row[14]; + $VAL_user_group = $row[15]; + $VAL_comments = $row[16]; + $VAL_sub_status = $row[17]; + $VAL_dead_epoch = $row[18]; + $VAL_dead_sec = $row[19]; + + if ($DB) {echo "\n
VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} + + if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + { + $VAL_pause_sec = ( ($now_date_epoch - $VAL_pause_epoch) + $VAL_pause_sec); + $stmt = "UPDATE vicidial_agent_log SET wait_epoch='$now_date_epoch', pause_sec='$VAL_pause_sec' where agent_log_id='$VAL_agent_log_id';"; + } + else + { + if ($VAL_talk_epoch < 1) + { + $VAL_wait_sec = ( ($now_date_epoch - $VAL_wait_epoch) + $VAL_wait_sec); + $stmt = "UPDATE vicidial_agent_log SET talk_epoch='$now_date_epoch', wait_sec='$VAL_wait_sec' where agent_log_id='$VAL_agent_log_id';"; + } + else + { + $lead_active++; + $status_update_SQL=''; + if ( ( (strlen($VAL_status) < 1) or ($VAL_status == 'NULL') ) and ($VAL_lead_id > 0) ) + { + $status_update_SQL = ", status='PU'"; + $stmt="UPDATE vicidial_list SET status='PU' where lead_id='$VAL_lead_id';"; + if ($DB) {echo "
$stmt\n";} + $rslt=mysql_query($stmt, $link); + } + if ($VAL_dispo_epoch < 1) + { + $VAL_talk_sec = ($now_date_epoch - $VAL_talk_epoch); + $stmt = "UPDATE vicidial_agent_log SET dispo_epoch='$now_date_epoch', talk_sec='$VAL_talk_sec'$status_update_SQL where agent_log_id='$VAL_agent_log_id';"; + } + else + { + if ($VAL_dispo_sec < 1) + { + $VAL_dispo_sec = ($now_date_epoch - $VAL_dispo_epoch); + $stmt = "UPDATE vicidial_agent_log SET dispo_sec='$VAL_dispo_sec' where agent_log_id='$VAL_agent_log_id';"; + } + } + } + } + + if ($DB) {echo "
$stmt\n";} + $rslt=mysql_query($stmt, $link); + } + } + + $stmt="DELETE from vicidial_live_agents where user='$VLA_user[$k]';"; + if ($DB) {echo "
$stmt\n";} + $rslt=mysql_query($stmt, $link); + + if (strlen($VAL_user_group) < 1) + { + $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "
$stmt\n";} + $val_ct = mysql_num_rows($rslt); + if ($val_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VAL_user_group = $row[0]; + } + } + + $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VLA_user[$k]','LOGOUT','$VLA_campaign_id[$k]','$NOW_TIME','$now_date_epoch','$VAL_user_group');"; + if ($DB) {echo "
$stmt\n";} + $rslt=mysql_query($stmt, $link); + + + ############################################# + ##### START QUEUEMETRICS LOGGING LOOKUP ##### + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "
$stmt\n";} + $qm_conf_ct = mysql_num_rows($rslt); + if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_queuemetrics_logging = $row[0]; + $queuemetrics_server_ip = $row[1]; + $queuemetrics_dbname = $row[2]; + $queuemetrics_login = $row[3]; + $queuemetrics_pass = $row[4]; + $queuemetrics_log_id = $row[5]; + } + ##### END QUEUEMETRICS LOGGING LOOKUP ##### + ########################################### + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + + $agents='@agents'; + $agent_logged_in=''; + $time_logged_in=''; + + $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='AGENTLOGIN' order by time_id desc limit 1;"; + $rsltB=mysql_query($stmtB, $linkB); + if ($DB) {echo "
$stmtB\n";} + $qml_ct = mysql_num_rows($rsltB); + if ($qml_ct > 0) + { + $row=mysql_fetch_row($rsltB); + $agent_logged_in = $row[0]; + $time_logged_in = $row[1]; + } + + $time_logged_in = ($now_date_epoch - $time_logged_in); + if ($time_logged_in > 1000000) {$time_logged_in=1;} + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='$VLA_user[$k]$agents',data2='$time_logged_in';"; + if ($DB) {echo "
$stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } + + echo "\n"; + + $k++; + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='LOGOUT', record_id='$campaign_id', event_code='ADMIN LOGOUT CAMPANHA AGENTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
DESCONEXÃO DE AGENTES CONCLUÍDA: $campaign_id\n"; + echo "

\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD='31'; # go to campaign modification below + } + + +###################### +# ADD=63 Emergency VDAC Jam Clear +###################### + +if ($ADD==63) + { + if ($LOGmodify_campaigns==1) + { + if (eregi('IN',$stage)) + {$group_id=$campaign_id;} + echo ""; + + if (strlen($campaign_id) < 2) + { + echo "
VDAC NÃO LIMPO PARA CAMPANHA - Por favor, volte e verifique os dados digitados\n"; + echo "
Campanha_id be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' order by call_time limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHAS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPANHA JAM', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
ÚLTIMO REGISTRO VDAC LIMPO PARA CAMPANHA: $campaign_id\n"; + echo "

\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + # go to campaign modification below + if (eregi('IN',$stage)) + {$ADD='3111';} + else + {$ADD='31';} + } + + +###################### +# ADD=65 delete campaign lead recycle in the system +###################### + +if ($ADD==65) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + { + echo "
RECICLAGEM DE REGISTROS DA CAMPANHA NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
status deve ter entre 1 e 6 caracteres\n"; + echo "
tempo de tentativa deve ter pelo menos 120 segundos\n"; + echo "
quantidade máxima de tentativas deve ser entre 1 e 10\n"; + } + else + { + echo "
RECICLAGEM DE REGISTROS DA CAMPANHA REMOVIDO: $campaign_id - $status - $attempt_delay\n"; + + $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_RECYCLE', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPANHA LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Status: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=25; + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=66 delete auto alt dial status from the campaign +###################### + +if ($ADD==66) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\";"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
STATUS DE DISCAGEM PARA NÚM. ALT. NÃO REMOVIDO - este status de discagem do número alt. não está na campanha\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + { + echo "
STATUS DE DISCAGEM PARA NÚM. ALT. NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
status deve ter entre 1 e 6 caracteres\n"; + } + else + { + echo "
STATUS DE DISC. PARA NÚMERO ALT. REMOVIDO: $campaign_id - $status\n"; + + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + $auto_alt_dial_statuses = eregi_replace(" $status "," ",$row[0]); + $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_ALTDIALS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPANHA ALT DIAL', event_sql=\"$SQL_log\", event_notes='Status: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=26; + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=67 delete agent pause code in the system +###################### + +if ($ADD==67) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) ) + { + echo "
CÓDIGO DE PAUSA DA CAMPANHA NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
pause code must be between 1 and 6 characters in length\n"; + } + else + { + echo "
CAMPANHA PAUSE CODE DELETED: $campaign_id - $pause_code\n"; + + $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_PAUSECODES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPANHA PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Status: $pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $SUB=27; + $ADD=31; # go to campaign modification form below + } + + +###################### +# ADD=68 remove campaign dial status +###################### + +if ($ADD==68) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
STATUS DE DISCAGEM NÃO REMOVIDO - esse status de discagem não está selecionado para esta campanha\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + { + echo "
STATUS DE DISCAGEM NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
status deve ter entre 1 e 6 caracteres\n"; + } + else + { + echo "
STATUS DE DISCAGEM REMOVIDO: $campaign_id - $status\n"; + + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + $dial_statuses = eregi_replace(" $status "," ",$row[0]); + $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CAMPANHA_DIALSTATUS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPANHA DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Status: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + #$SUB=28; + $ADD=31; # go to campaign modification form below + } + +###################### +# ADD=611 delete list record and all leads within it +###################### + +if ($ADD==611) + { + echo ""; + + if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) + { + echo "
LISTA NÃO APAGADA - Por favor, volte e verifique os dados digitados\n"; + echo "
List_id be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + echo "
REMOVENDO REGISTROS HOPPERS DO HOPPER DA CAMPANHA ANTIGA ($list_id)\n"; + $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
REMOVENDO REGISTROS DA LISTA DA TABELA VICIDIAL_LIST\n"; + $stmt="DELETE from vicidial_list where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='LISTAS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DA LISTA CONCLUÍDA: $list_id\n"; + echo "

\n"; + } + + $ADD='100'; # go to lists list + } + +###################### +# ADD=6111 delete in-group record +###################### + +if ($ADD==6111) + { + echo ""; + + if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) + { + echo "
GRUPO DE ENTRADA NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Group_id be at least 2 characters in length\n"; + } + else + { + $stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') limit 1;"; + $rslt=mysql_query($stmtA, $link); + + $stmt="DELETE from vicidial_inbound_group_agents where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_live_inbound_agents where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_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='INGROUPS', event_type='DELETE', record_id='$group_id', event_code='ADMIN DELETE INGROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DE GRUPO DE ENTRADA CONCLUÍDA: $group_id\n"; + echo "

\n"; + } + + $ADD='1000'; # go to in-group list + } + + +###################### +# ADD=6311 delete did record +###################### + +if ($ADD==6311) + { + echo ""; + + if ( (strlen($did_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) ) + { + echo "
DDR NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
did_id be at least 1 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='DIDS', event_type='DELETE', record_id='$did_id', event_code='ADMIN DELETE DID', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DO DDR FINALIZADA: $did_id\n"; + echo "

\n"; + } + + $ADD='1300'; # go to did list + } + +###################### +# ADD=6511 delete call menu record +###################### + +if ($ADD==6511) + { + echo ""; + + if ( (strlen($menu_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) ) + { + echo "
MENU NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
menu_id be at least 1 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + $stmtA="DELETE from vicidial_call_menu_options where menu_id='$menu_id' limit 17;"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA"; + $SQL_log = ereg_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='CALLMENUS', event_type='DELETE', record_id='$menu_id', event_code='ADMIN DELETE CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DE MENU COMPLETADA: $menu_id\n"; + echo "

\n"; + } + + $ADD='1500'; # go to call menu list + } + +###################### +# ADD=61111 delete remote agent record +###################### + +if ($ADD==61111) + { + echo ""; + + if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) + { + echo "
AGENTE REMOTO NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Remote_agent_id be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='REMOTEAGENTS', event_type='DELETE', record_id='$remote_agent_id', event_code='ADMIN DELETE REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DE AGENTE REMOTO CONCLUÍDA: $remote_agent_id\n"; + echo "

\n"; + } + + $ADD='10000'; # go to remote agents list + } + +###################### +# ADD=611111 delete user group record +###################### + +if ($ADD==611111) + { + echo ""; + + if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) + { + echo "
GRUPO DE USUÁRIOS NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Usuário_group be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE GRUPO DE USUÁRIOS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DE GRUPO DE USUÁRIOS CONCLUÍDA: $user_group\n"; + echo "

\n"; + } + + $ADD='100000'; # go to user group list + } + +###################### +# ADD=6111111 delete script record +###################### + +if ($ADD==6111111) + { + echo ""; + + if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) + { + echo "
SCRIPT NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Script_id be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SCRIPTS', event_type='DELETE', record_id='$script_id', event_code='ADMIN DELETE SCRIPT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DE SCRIPT CONCLUÍDA: $script_id\n"; + echo "

\n"; + } + + $ADD='1000000'; # go to script list + } + + +###################### +# ADD=61111111 delete filter record +###################### + +if ($ADD==61111111) + { + echo ""; + + if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) + { + echo "
FILTRO NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do filtro deve ter pelo menos 2 caracteres de comprimento\n"; + } + else + { + $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='FILTROS', event_type='DELETE', record_id='$lead_filter_id', event_code='ADMIN DELETE FILTROS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DO FILTRO COMPLETADA $lead_filter_id\n"; + echo "

\n"; + } + + $ADD='10000000'; # go to filter list + } + + +###################### +# ADD=611111111 delete call times record +###################### + +if ($ADD==611111111) + { + echo ""; + + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + { + echo "
HORÁRIO DE CHAMADA NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do horário de cham. deve ter pelo menos 2 caracteres\n"; + } + else + { + $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CALLTIMES', event_type='DELETE', record_id='$call_time_id', event_code='ADMIN DELETE CALL TIME', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
HORÁRIO DE CHAM. REMOVIDO: $call_time_id\n"; + echo "

\n"; + } + + $ADD='100000000'; # go to call times list + } + + +###################### +# ADD=6111111111 delete state call times record +###################### + +if ($ADD==6111111111) + { + echo ""; + + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + { + echo "
HORÁRIO DE CHAM. POR ESTADO NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do horário de cham. deve ter pelo menos 2 caracteres\n"; + } + else + { + $stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; + $rslt=mysql_query($stmtA, $link); + + $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; + $rslt=mysql_query($stmt, $link); + $sct_to_print = mysql_num_rows($rslt); + $sct_list=''; + + $o=0; + while ($sct_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $sct_ids[$o] = "$rowx[0]"; + $sct_states[$o] = "$rowx[1]"; + $o++; + } + $o=0; + while ($sct_to_print > $o) + { + $sct_states[$o] = eregi_replace("\|$call_time_id\|",'|',$sct_states[$o]); + $stmt="UPDATE vicidial_call_times set ct_state_call_times='$sct_states[$o]' where call_time_id='$sct_ids[$o]';"; + $rslt=mysql_query($stmt, $link); + echo "$stmt\n"; + echo "Regra de Estado Removida: $sct_ids[$o]
\n"; + $o++; + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_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='CALLTIMES', event_type='DELETE', record_id='$call_time_id', event_code='ADMIN DELETE STATE CALL TIME', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DO HORÁRIO DE CHAM. POR ESTADO FINALIZADA: $call_time_id\n"; + echo "

\n"; + } + + $ADD='1000000000'; # go to call times list + } + + +###################### +# ADD=631111111 delete shift record +###################### + +if ($ADD==631111111) + { + echo ""; + + if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) ) + { + echo "
TURNO NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
Shift ID must be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_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='SHIFTS', event_type='DELETE', record_id='$shift_id', event_code='ADMIN DELETE SHIFT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DE TURNO FINALIZADA: $shift_id\n"; + echo "

\n"; + } + + $ADD='130000000'; # go to shifts list + } + + +###################### +# ADD=61111111111 delete phone record +###################### + +if ($ADD==61111111111) + { + echo ""; + + if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + { + echo "
RAMAL NÃO APAGADO - Por favor, volte e verifique os dados digitados\n"; + echo "
Extension be at least 2 characters in length\n"; + echo "
IP do Servidor be at least 7 characters in length\n"; + } + else + { + $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; + $rslt=mysql_query($stmt, $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_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='DELETE', record_id='$extension', event_code='ADMIN DELETE PHONE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DE RAMAL CONCLUÍDA: $extension - $server_ip\n"; + echo "

\n"; + } + $ADD='10000000000'; # go to phone list + } + + +###################### +# ADD=62111111111 delete phone alias record +###################### + +if ($ADD==62111111111) + { + echo ""; + + if ( (strlen($alias_id) < 2) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + { + echo "
ALIAS DE RAMAL NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
Alias ID must be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from phones_alias where alias_id='$alias_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_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='PHONEALIASES', event_type='DELETE', record_id='$alias_id', event_code='ADMIN REMOVER ALIAS DE RAMAL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DO ALIAS DE RAMAL CONCLUÍDA: $alias_id\n"; + echo "

\n"; + } + $ADD='12000000000'; # go to phone alias list + } + + +###################### +# ADD=63111111111 delete group alias record +###################### + +if ($ADD==63111111111) + { + echo ""; + + if ( (strlen($group_alias_id) < 2) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + { + echo "
ALIAS DE GRUPO NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do Alias must be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_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='GROUPALIASES', event_type='DELETE', record_id='$group_alias_id', event_code='ADMIN REMOVER ALIAS DE GRUPO', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DO ALIAS DE GRUPO FINALIZADA: $group_alias_id\n"; + echo "

\n"; + } + $ADD='13000000000'; # go to group alias list + } + + +###################### +# ADD=611111111111 delete server record +###################### + +if ($ADD==611111111111) + { + echo ""; + + if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + { + echo "
SERVIDOR NOT DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do Servidor be at least 2 characters in length\n"; + echo "
IP do Servidor be at least 7 characters in length\n"; + } + else + { + $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_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='SERVERS', event_type='DELETE', record_id='$server_id', event_code='ADMIN DELETE SERVER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
SERVIDOR DELETION COMPLETED: $server_id - $server_ip\n"; + echo "

\n"; + } + $ADD='100000000000'; # go to server list + } + + +###################### +# ADD=621111111111 delete vicidial server trunk record in the system +###################### + +if ($ADD==621111111111) + { + if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) ) + { + echo "
REGISTRO DE TRUNK VICIDIAL NAO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
campanha deve ter entre 3 e 8 caracteres de comprimento\n"; + echo "
delay do IP do servidor deve ser pelo menos 7 caracteres\n"; + } + else + { + echo "
REGISTRO DE TRUNK VICIDIAL REMOVIDO: $campaign_id - $server_ip\n"; + + $stmt="DELETE FROM vicidial_server_trunks where campaign_id='$campaign_id' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='SERVERTRUNKS', event_type='DELETE', record_id='$server_ip', event_code='ADMIN DELETE SERVIDOR TRUNK', event_sql=\"$SQL_log\", event_notes='Campanha: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + $ADD=311111111111; # go to server modification form below + } + + +###################### +# ADD=631111111111 delete conf template record +###################### + +if ($ADD==631111111111) + { + echo ""; + + if ( (strlen($template_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
TEMPLATE DE CONF NÃO REMOVIDO - Por favor, volte e verifique os dados digitados\n"; + echo "
ID do template deve ter pelo menos 2 caracteres\n"; + } + else + { + $stmt="UPDATE phones SET template_id='' where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE vicidial_server_carriers SET template_id='' where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_conf_templates where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CONFTEMPLATES', event_type='DELETE', record_id='$template_id', event_code='ADMIN REMOVER TEMPLATE CONF', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DO TEMPLATE DE CONF FINALIZADA: $server_id - $server_ip\n"; + echo "

\n"; + } + $ADD='130000000000'; # go to conf template list + } + + +###################### +# ADD=641111111111 delete carrier record +###################### + +if ($ADD==641111111111) + { + echo ""; + + if ( (strlen($carrier_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
OPERADORA NÃO REMOVIDA - Por favor, volte e verifique os dados digitados\n"; + echo "
O ID da operadora precisa ter pelo menos 2 caracteres\n"; + } + else + { + $stmt="SELECT server_ip from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $CARRIERserver_ip = $row[0]; + + $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$CARRIERserver_ip';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CARRIERS', event_type='DELETE', record_id='$carrier_id', event_code='ADMIN REMOVER OPERADORA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
REMOÇÃO DA OPERADORA FINALIZADA: $carrier_id\n"; + echo "

\n"; + } + $ADD='140000000000'; # go to carrier list + } + + +###################### +# ADD=651111111111 delete tts record +###################### + +if ($ADD==651111111111) + { + echo ""; + + if ( (strlen($tts_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
TTS entrada no DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
TTS ID be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='TTS', event_type='DELETE', record_id='$tts_id', event_code='ADMIN DELETE TTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
TTS DELETION COMPLETED: $tts_id\n"; + echo "

\n"; + } + $ADD='150000000000'; # go to tts entry list + } + + +###################### +# ADD=661111111111 delete music on hold record +###################### + +if ($ADD==661111111111) + { + echo ""; + + if ( (strlen($moh_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
MÚSICA EN ESPERA DE ENTRADA no se eliminan - Por favor, volte e verifique os dados digitados\n"; + echo "
MOH ID be at least 2 characters in length\n"; + } + else + { + $stmt="UPDATE vicidial_music_on_hold SET remove='Y' where moh_id='$moh_id';"; + $rslt=mysql_query($stmt, $link); + + $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|"; + $SQL_log = ereg_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='MOH', event_type='DELETE', record_id='$moh_id', event_code='ADMIN DELETE MOH', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
MÚSICA EN ESPERA SUPRESIÓN COMPLETA: $moh_id\n"; + echo "

\n"; + } + $ADD='160000000000'; # go to music on hold entry list + } + + +###################### +# ADD=671111111111 delete voicemail record +###################### + +if ($ADD==671111111111) + { + echo ""; + + if ( (strlen($voicemail_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
Contestador no se eliminan - Por favor, volte e verifique os dados digitados\n"; + echo "
ID de correo de voz be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="SELECT active_voicemail_server from system_settings;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $active_voicemail_server = $row[0]; + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$active_voicemail_server';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='VOICEMAIL', event_type='DELETE', record_id='$voicemail_id', event_code='ADMIN DELETE VOICEMAIL', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
Contestador SUPRESIÓN COMPLETA: $voicemail_id\n"; + echo "

\n"; + } + $ADD='170000000000'; # go to voicemail entry list + } + + +###################### +# ADD=6111111111111 delete conference record +###################### + +if ($ADD==6111111111111) + { + echo ""; + + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + { + echo "
CONFERENCE NOT DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
IP do Servidor be at least 7 characters in length\n"; + } + else + { + $stmt="DELETE from conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CONFERENCES', event_type='DELETE', record_id='$conf_exten', event_code='ADMIN DELETE CONFERENCE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
CONFERENCE DELETION COMPLETED: $conf_exten - $server_ip\n"; + echo "

\n"; + } + $ADD='1000000000000'; # go to conference list + } + + +###################### +# ADD=61111111111111 delete vicidial conference record +###################### + +if ($ADD==61111111111111) + { + echo ""; + + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + { + echo "
VICIDIAL CONFERENCE NOT DELETED - Por favor, volte e verifique os dados digitados\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
IP do Servidor be at least 7 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_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='CONFERENCES', event_type='DELETE', record_id='$conf_exten', event_code='ADMIN DELETE CONFERENCE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
VICIDIAL CONFERENCE DELETION COMPLETED: $conf_exten - $server_ip\n"; + echo "

\n"; + } + $ADD='10000000000000'; # go to vicidial conference list + } + + + + + +###################################################################################################### +###################################################################################################### +####### 3 series, record modification forms +###################################################################################################### +###################################################################################################### + + + + +###################### +# ADD=3 modify user info in the system +###################### + +if ($ADD==3) + { + if ($LOGmodify_users==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $user_id = $row[0]; + $user = $row[1]; + $pass = $row[2]; + $full_name = $row[3]; + $user_level = $row[4]; + $user_group = $row[5]; + $phone_login = $row[6]; + $phone_pass = $row[7]; + $delete_users = $row[8]; + $delete_user_groups = $row[9]; + $delete_lists = $row[10]; + $delete_campaigns = $row[11]; + $delete_ingroups = $row[12]; + $delete_remote_agents = $row[13]; + $load_leads = $row[14]; + $campaign_detail = $row[15]; + $ast_admin_access = $row[16]; + $ast_delete_phones = $row[17]; + $delete_scripts = $row[18]; + $modify_leads = $row[19]; + $hotkeys_active = $row[20]; + $change_agent_campaign =$row[21]; + $agent_choose_ingroups =$row[22]; + $scheduled_callbacks = $row[24]; + $agentonly_callbacks = $row[25]; + $agentcall_manual = $row[26]; + $vicidial_recording = $row[27]; + $vicidial_transfers = $row[28]; + $delete_filters = $row[29]; + $alter_agent_interface_options =$row[30]; + $closer_default_blended = $row[31]; + $delete_call_times = $row[32]; + $modify_call_times = $row[33]; + $modify_users = $row[34]; + $modify_campaigns = $row[35]; + $modify_lists = $row[36]; + $modify_scripts = $row[37]; + $modify_filters = $row[38]; + $modify_ingroups = $row[39]; + $modify_usergroups = $row[40]; + $modify_remoteagents = $row[41]; + $modify_servers = $row[42]; + $view_reports = $row[43]; + $vicidial_recording_override = $row[44]; + $alter_custdata_override = $row[45]; + $qc_enabled = $row[46]; + $qc_user_level = $row[47]; + $qc_pass = $row[48]; + $qc_finish = $row[49]; + $qc_commit = $row[50]; + $add_timeclock_log = $row[51]; + $modify_timeclock_log = $row[52]; + $delete_timeclock_log = $row[53]; + $alter_custphone_override = $row[54]; + $vdc_agent_api_access = $row[55]; + $modify_inbound_dids = $row[56]; + $delete_inbound_dids = $row[57]; + $active = $row[58]; + $alert_enabled = $row[59]; + $download_lists = $row[60]; + $agent_shift_enforcement_override = $row[61]; + $manager_shift_enforcement_override = $row[62]; + $export_reports = $row[64]; + $delete_from_dnc = $row[65]; + $email = $row[66]; + $user_code = $row[67]; + $territory = $row[68]; + $allow_alerts = $row[69]; + $agent_choose_territories = $row[70]; + $user_custom_one = $row[71]; + $user_custom_two = $row[72]; + $user_custom_three = $row[73]; + $user_custom_four = $row[74]; + $user_custom_five = $row[75]; + + if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) + { + echo "
Você não tem permissão de alterar este usuário: $user\n"; + } + else + { + echo "
ALTERAR REGISTRO DE USUÁRIO: $user\n"; + if ($LOGuser_level > 8) + {echo "\n";} + else + { + if ($LOGalter_agent_interface == "1") + {echo "\n";} + else + {echo "\n";} + } + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + if ($SSuser_territories_active > 0) + { + $stmt="SELECT vut.territory,vt.territory_description from vicidial_user_territories vut,vicidial_territories vt where user='$user' and vut.territory=vt.territory;"; + $rslt=mysql_query($stmt, $link); + $Uterrs_to_print = mysql_num_rows($rslt); + $Uterrs_list=''; + $o=0; + while ($Uterrs_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Uterrs_list .= "$rowx[0] - $rowx[1]
\n"; + $o++; + } + echo "\n"; + } + + if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) + { + echo "\n"; + echo "\n"; + if ($SSuser_territories_active > 0) + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + if ($SSqc_features_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + } + if ($LOGuser_level > 8) + { + echo "\n"; + + #9BB9FB + #B9CBFD + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + } + echo "\n"; + echo "
Número do usuário: $user$NWB#vicidial_users-user$NWE
Senha: $NWB#vicidial_users-pass$NWE
Nome Completo: $NWB#vicidial_users-full_name$NWE
Nível do Usuário: $NWB#vicidial_users-user_level$NWE
Grupo do Usuário: $NWB#vicidial_users-user_group$NWE
Login do Ramal: $NWB#vicidial_users-phone_login$NWE
Senha do Ramal: $NWB#vicidial_users-phone_pass$NWE
Ativo: $NWB#vicidial_users-active$NWE
Email:$NWB#vicidial_users-optional$NWE
Usuário Code: $NWB#vicidial_users-optional$NWE
Main Territorio: $NWB#vicidial_users-optional$NWE
Territorios de usuario: $Uterrs_list
OPÇÕES DA INTERFACE DO AGENTE:
Agente pode escolher Grupos de Entrada: $NWB#vicidial_users-agent_choose_ingroups$NWE
Agente Elija territorios: $NWB#vicidial_users-agent_choose_territories$NWE
Atalhos Ativos: $NWB#vicidial_users-hotkeys_active$NWE
Agendamento de Chamadas: $NWB#vicidial_users-scheduled_callbacks$NWE
Agendamento de Chamadas com Fidelização: $NWB#vicidial_users-agentonly_callbacks$NWE
Agente Manual: $NWB#vicidial_users-agentcall_manual$NWE
Gravação do Vicidial: $NWB#vicidial_users-vicidial_recording$NWE
Transferências do Vicidial: $NWB#vicidial_users-vicidial_transfers$NWE
Finalizador Padrão como Mesclado: $NWB#vicidial_users-closer_default_blended$NWE
Sobrepor Conf. de Gravação no VICIDIAL:$NWB#vicidial_users-vicidial_recording_override$NWE
Sobrepor Permissão de Alteração$NWB#vicidial_users-alter_custdata_override$NWE
Sobrepor Permissão de Alter. de Telefone:$NWB#vicidial_users-alter_custphone_override$NWE
Sobrepor Controle de Turno do Agente: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
Alerta Ativo: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
Permitir Alertas: $NWB#vicidial_users-allow_alerts$NWE
Rankings da Campanha:$NWB#vicidial_users-campaign_ranks$NWE
\n"; + echo "\n"; + echo "$RANKcampaigns_list"; + echo "
\n"; + echo "
Grupos de Entrada: $NWB#vicidial_users-closer_campaigns$NWE
\n"; + echo "\n"; + echo "$RANKgroups_list"; + echo "
\n"; + echo "
Custom 1: $NWB#vicidial_users-custom_one$NWE
Custom 2: $NWB#vicidial_users-custom_two$NWE
Custom 3: $NWB#vicidial_users-custom_three$NWE
Custom 4: $NWB#vicidial_users-custom_four$NWE
Custom 5: $NWB#vicidial_users-custom_five$NWE
CQ Ativado:$NWB#vicidial_users-qc_enabled$NWE
Nível de Usuário CQ:$NWB#vicidial_users-qc_user_level$NWE
Passou no CQ:$NWB#vicidial_users-qc_pass$NWE
Fim do CQ:$NWB#vicidial_users-qc_finish$NWE
Confirmado CQ:$NWB#vicidial_users-qc_commit$NWE
OPÇÕES DA INTERFACE ADMIN:
Mostrar Relatórios: $NWB#vicidial_users-view_reports$NWE
Alterar opções da Interface do Agente:$NWB#vicidial_users-alter_agent_interface_options$NWE
Alterar Usuários: $NWB#vicidial_users-modify_sections$NWE
Alterar a Campanha do Agente: $NWB#vicidial_users-change_agent_campaign$NWE
Apagar Usuários: $NWB#vicidial_users-delete_users$NWE
Alterar Grupos de Usuário: $NWB#vicidial_users-modify_sections$NWE
Apagar Grupos de Usuários: $NWB#vicidial_users-delete_user_groups$NWE
Alterar Listas: $NWB#vicidial_users-modify_sections$NWE
Apagar Listas: $NWB#vicidial_users-delete_lists$NWE
Carregar Registros: $NWB#vicidial_users-load_leads$NWE
Alterar Registros: $NWB#vicidial_users-modify_leads$NWE
Download de Listas: $NWB#vicidial_users-modify_leads$NWE
Exportar Relatórios: $NWB#vicidial_users-export_reports$NWE
Remover da Lista de Bloqueio: $NWB#vicidial_users-delete_from_dnc$NWE
Alterar Campanhas: $NWB#vicidial_users-modify_sections$NWE
Detalhes da Campanha: $NWB#vicidial_users-campaign_detail$NWE
Apagar Campanhas: $NWB#vicidial_users-delete_campaigns$NWE
Alterar Grupos de Ent.: $NWB#vicidial_users-modify_sections$NWE
Apagar Grupos de Entrada: $NWB#vicidial_users-delete_ingroups$NWE
Alterar DDRs:$NWB#vicidial_users-modify_sections$NWE
Remover DDRs:$NWB#vicidial_users-delete_ingroups$NWE
Alterar Agentes Remotos: $NWB#vicidial_users-modify_sections$NWE
Apagar Usuários Remotos: $NWB#vicidial_users-delete_remote_agents$NWE
Alterar Scripts: $NWB#vicidial_users-modify_sections$NWE
Apagar Scriptss: $NWB#vicidial_users-delete_scripts$NWE
Alterar Filtros: $NWB#vicidial_users-modify_sections$NWE
Apagar Filtros: $NWB#vicidial_users-delete_filters$NWE
Acesso Admin ao AGC: $NWB#vicidial_users-ast_admin_access$NWE
Apagar Ramais do AGC: $NWB#vicidial_users-ast_delete_phones$NWE
Alterar um Hor. de Cham.s: $NWB#vicidial_users-modify_call_times$NWE
RemoverHorários de Cham.: $NWB#vicidial_users-delete_call_times$NWE
Alterar Servidor: $NWB#vicidial_users-modify_sections$NWE
Agente para Acesso ao API:$NWB#vicidial_users-vdc_agent_api_access$NWE
Incluir Registro de Ponto: $NWB#vicidial_users-add_timeclock_log$NWE
Alterar Registro de Log do Ponto: $NWB#vicidial_users-modify_timeclock_log$NWE
Remover Registro de Log do Ponto: $NWB#vicidial_users-delete_timeclock_log$NWE
Sobrepor Controle de Turno do Gerente: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
\n"; + + if ($LOGdelete_users > 0) + { + echo "

APAGAR ESTE USUÁRIO\n"; + } + echo "

Clique aqui para a planilha de tempo do usuário\n"; + echo "

Clique aqui para o status do usuário\n"; + echo "

Clique aqui para ver o status do usuário\n"; + echo "

Clique aqui para um relatório de status de vários dias\n"; + echo "

Clique aqui para os registros de Chamada Agendada do usuário\n"; + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver alterações Admin para este registro
\n"; + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=31 modify campaign info in the system - Detail view +###################### + +if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Básico if not allowed + +if ( ($ADD==31) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPANHAS",$LOGallowed_campaigns)) ) ) + {$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list + +if ($ADD==31) + { + if ($LOGmodify_campaigns==1) + { + if ($stage=='show_dialable') + { + $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_dialable') + { + $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="SELECT enable_vtiger_integration,vtiger_url from system_settings;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration_LU = $row[0]; + $vtiger_url_LU = $row[1]; + + $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_name = $row[1]; + $dial_status_a = $row[3]; + $dial_status_b = $row[4]; + $dial_status_c = $row[5]; + $dial_status_d = $row[6]; + $dial_status_e = $row[7]; + $lead_order = $row[8]; + $web_form_address = stripslashes($row[11]); + $allow_closers = $row[12]; + $hopper_level = $row[13]; + $auto_dial_level = $row[14]; + $next_agent_call = $row[15]; + $local_call_time = $row[16]; + $voicemail_ext = $row[17]; + $dial_timeout = $row[18]; + $dial_prefix = $row[19]; + $campaign_cid = $row[20]; + $campaign_vdad_exten = $row[21]; + $campaign_rec_exten = $row[22]; + $campaign_recording = $row[23]; + $campaign_rec_filename = $row[24]; + $script_id = $row[25]; + $get_call_launch = $row[26]; + $am_message_exten = $row[27]; + $amd_send_to_vmx = $row[28]; + $xferconf_a_dtmf = $row[29]; + $xferconf_a_number = $row[30]; + $xferconf_b_dtmf = $row[31]; + $xferconf_b_number = $row[32]; + $alt_number_dialing = $row[33]; + $scheduled_callbacks = $row[34]; + $lead_filter_id = $row[35]; + if ($lead_filter_id=='') {$lead_filter_id='NONE';} + $drop_call_seconds = $row[36]; + $drop_action = $row[37]; + $safe_harbor_exten = $row[38]; + $display_dialable_count = $row[39]; + $wrapup_seconds = $row[40]; + $wrapup_message = $row[41]; + # $closer_campaigns = $row[42]; + $use_internal_dnc = $row[43]; + $allcalls_delay = $row[44]; + $omit_phone_code = $row[45]; + $dial_method = $row[46]; + $available_only_ratio_tally = $row[47]; + $adaptive_dropped_percentage = $row[48]; + $adaptive_maximum_level = $row[49]; + $adaptive_latest_server_time = $row[50]; + $adaptive_intensity = $row[51]; + $adaptive_dl_diff_target = $row[52]; + $concurrent_transfers = $row[53]; + $auto_alt_dial = $row[54]; + $auto_alt_dial_statuses = $row[55]; + $agent_pause_codes_active = $row[56]; + $campaign_description = $row[57]; + $campaign_changedate = $row[58]; + $campaign_stats_refresh = $row[59]; + $campaign_logindate = $row[60]; + $dial_statuses = $row[61]; + $disable_alter_custdata = $row[62]; + $no_hopper_leads_logins = $row[63]; + $list_order_mix = $row[64]; + $campaign_allow_inbound = $row[65]; + $manual_dial_list_id = $row[66]; + $default_xfer_group = $row[67]; + $queue_priority = $row[69]; + $drop_inbound_group = $row[70]; + $qc_enabled = $row[71]; + $qc_statuses = $row[72]; + $qc_lists = $row[73]; + $qc_shift_id = $row[74]; + $qc_get_record_launch = $row[75]; + $qc_show_recording = $row[76]; + $qc_web_form_address = stripslashes($row[77]); + $qc_script = $row[78]; + $survey_first_audio_file = $row[79]; + $survey_dtmf_digits = $row[80]; + $survey_ni_digit = $row[81]; + $survey_opt_in_audio_file = $row[82]; + $survey_ni_audio_file = $row[83]; + $survey_method = $row[84]; + $survey_no_response_action = $row[85]; + $survey_ni_status = $row[86]; + $survey_response_digit_map = $row[87]; + $survey_xfer_exten = $row[88]; + $survey_camp_record_dir = $row[89]; + $disable_alter_custphone = $row[90]; + $display_queue_count = $row[91]; + $manual_dial_filter = $row[92]; + $agent_clipboard_copy = $row[93]; + $agent_extended_alt_dial = $row[94]; + $use_campaign_dnc = $row[95]; + $three_way_call_cid = $row[96]; + $three_way_dial_prefix = $row[97]; + $web_form_target = $row[98]; + $vtiger_search_category = $row[99]; + $vtiger_create_call_record = $row[100]; + $vtiger_create_lead_record = $row[101]; + $vtiger_screen_login = $row[102]; + $cpd_amd_action = $row[103]; + $agent_allow_group_alias = $row[104]; + $default_group_alias = $row[105]; + $vtiger_search_dead = $row[106]; + $vtiger_status_call = $row[107]; + $survey_third_digit = $row[108]; + $survey_third_audio_file = $row[109]; + $survey_third_status = $row[110]; + $survey_third_exten = $row[111]; + $survey_fourth_digit = $row[112]; + $survey_fourth_audio_file = $row[113]; + $survey_fourth_status = $row[114]; + $survey_fourth_exten = $row[115]; + $drop_lockout_time = $row[116]; + $quick_transfer_button = $row[117]; + $prepopulate_transfer_preset = $row[118]; + $drop_rate_group = $row[119]; + $view_calls_in_queue = $row[120]; + $view_calls_in_queue_launch = $row[121]; + $grab_calls_in_queue = $row[122]; + $call_requeue_button = $row[123]; + $pause_after_each_call = $row[124]; + $no_hopper_dialing = $row[125]; + $agent_dial_owner_only = $row[126]; + $agent_display_dialable_leads = $row[127]; + $web_form_address_two = $row[128]; + $waitforsilence_options = $row[129]; + $agent_select_territories = $row[130]; + $campaign_calldate = $row[131]; + $crm_popup_login = $row[132]; + $crm_login_address = $row[133]; + $timer_action = $row[134]; + $timer_action_message = $row[135]; + $timer_action_seconds = $row[136]; + $start_call_url = $row[137]; + $dispo_call_url = $row[138]; + $xferconf_c_number = $row[139]; + $xferconf_d_number = $row[140]; + $xferconf_e_number = $row[141]; + + if (ereg("DISABLED",$list_order_mix)) + {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} + else + {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} + + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE'"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $mixes_list="\n"; + $mixname_list["DISABLED"] = "DISABLED"; + } + else + { + ##### get list_mix listings for dynamic pulldown + $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $rslt=mysql_query($stmt, $link); + $mixes_to_print = mysql_num_rows($rslt); + $mixes_list="\n"; + + $o=0; + while ($mixes_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $mixes_list .= "\n"; + $mixname_list["ACTIVE"] = "$rowx[0] - $rowx[1]"; + $o++; + } + } + + $dial_statuses = preg_replace("/ -$/","",$dial_statuses); + $Dstatuses = explode(" ", $dial_statuses); + $Ds_to_print = (count($Dstatuses) -1); + + $qc_statuses = preg_replace("/^ | -$/","",$qc_statuses); + $QCstatuses = explode(" ", $qc_statuses); + $QCs_to_print = (count($QCstatuses) -0); + + $qc_lists = preg_replace("/^ | -$/","",$qc_lists); + $QClists = explode(" ", $qc_lists); + $QCL_to_print = (count($QClists) -0); + + ##### get status listings for dynamic pulldown + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $statuses_list=''; + $dial_statuses_list=''; + $qc_statuses_list=''; + $survey_ni_status_list=''; + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_list .= "\n"; + if ($rowx[0] != 'CBHOLD') + { + $dial_statuses_list .= "\n"; + if ($survey_ni_status == $rowx[0]) + { + $survey_ni_status_list .= "\n"; + } + else + { + $survey_ni_status_list .= "\n"; + } + } + $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; + if (eregi("Y",$rowx[2])) + {$HKstatuses_list .= "\n";} + + $qc_statuses_list .= " $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_list .= "\n"; + if ($rowx[0] != 'CBHOLD') {$dial_statuses_list .= "\n";} + $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; + if (eregi("Y",$rowx[2])) + {$HKstatuses_list .= "\n";} + + $qc_statuses_list .= " $o) + { + $rowx=mysql_fetch_row($rslt); + $Dgroups_menu .= "\n"; + $o++; + } + if ($Dgroups_selected < 1) + {$Dgroups_menu .= "\n";} + else + {$Dgroups_menu .= "\n";} + + + ##### get in-groups listings for dynamic transfer group pulldown list menu + $stmt="SELECT group_id,group_name from vicidial_inbound_groups $xfer_groupsSQL order by group_id"; + $rslt=mysql_query($stmt, $link); + $Xgroups_to_print = mysql_num_rows($rslt); + $Xgroups_menu=''; + $Xgroups_selected=0; + $o=0; + while ($Xgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xgroups_menu .= "\n"; + $o++; + } + if ($Xgroups_selected < 1) + {$Xgroups_menu .= "\n";} + else + {$Xgroups_menu .= "\n";} + + + if ($SUB<1) {$camp_detail_color=$subcamp_color;} + else {$camp_detail_color=$campaigns_color;} + if ($SUB==22) {$camp_statuses_color=$subcamp_color;} + else {$camp_statuses_color=$campaigns_color;} + if ($SUB==23) {$camp_hotkeys_color=$subcamp_color;} + else {$camp_hotkeys_color=$campaigns_color;} + if ($SUB==25) {$camp_recycle_color=$subcamp_color;} + else {$camp_recycle_color=$campaigns_color;} + if ($SUB==26) {$camp_autoalt_color=$subcamp_color;} + else {$camp_autoalt_color=$campaigns_color;} + if ($SUB==27) {$camp_pause_color=$subcamp_color;} + else {$camp_pause_color=$campaigns_color;} + if ($SUB==28) {$camp_qc_color=$subcamp_color;} + else {$camp_qc_color=$campaigns_color;} + if ($SUB==29) {$camp_listmix_color=$subcamp_color;} + else {$camp_listmix_color=$campaigns_color;} + if ($SUB=='20A') {$camp_survey_color=$subcamp_color;} + else {$camp_survey_color=$campaigns_color;} + echo "\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + if ($SSqc_features_active > 0) + { + echo ""; + } + if ($SSoutbound_autodial_active < 1) + { + echo "\n"; + } + echo "\n"; + echo "
$row[0]: Básico Detalhes StatusAtalhosLead RecyclingDiscar Num. Alt.Mesclagem de ListaPesquisaCódigos de PausaQC Tempo Real
\n"; + + echo "
\n"; + echo ""; + + echo "
\n"; + + if ($SUB < 1) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($SSenable_second_webform > 0) + { + echo "\n"; + } + echo "\n"; + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + + $o=0; + while ($Ds_to_print > $o) + { + $o++; + $Dstatus = $Dstatuses[$o]; + + echo "\n"; + } + else + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVER\n"; + } + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + + echo "\n"; + + + + echo "\n"; + } + + echo "\n"; + + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + $eswHTML=''; + if ($SSenable_second_webform > 0) + {$eswHTML = '';} + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + + echo "\n"; + } + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + } + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($SSuser_territories_active > 0) + { + echo "\n"; + } + echo "\n"; + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($agent_allow_group_alias == 'Y') + { + ##### get groups_alias listings for dynamic default group alias pulldown list menu + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' order by group_alias_id"; + $rslt=mysql_query($stmt, $link); + $group_alias_to_print = mysql_num_rows($rslt); + $group_alias_menu=''; + $group_alias_selected=0; + $o=0; + while ($group_alias_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $group_alias_menu .= "\n"; + $o++; + } + + echo "\n"; + } + + if ($SSenable_vtiger_integration > 0) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + } + else + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($campaign_allow_inbound == 'Y') + { + echo "\n"; + } + + echo "\n"; + + if ($allow_closers == 'Y') + { + echo "\n"; + } + + echo "\n"; + echo "
ID da Campanha: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nome da Campanha: $NWB#vicidial_campaigns-campaign_name$NWE
Descrição da Campanha: $NWB#vicidial_campaigns-campaign_description$NWE
Campanha Data da Alter.: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campanha Data do Login: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Campanha Call Date: $campaign_calldate   $NWB#vicidial_campaigns-campaign_calldate$NWE
Ativo: $NWB#vicidial_campaigns-active$NWE
Extensão de Estacionamento: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Formulário Web: $NWB#vicidial_campaigns-web_form_address$NWE
Formulário Web Two: $NWB#vicidial_campaigns-web_form_address$NWE
Target do Form. Web: $NWB#vicidial_campaigns-web_form_target$NWE
Permitir Finalizadores (Closers): $NWB#vicidial_campaigns-allow_closers$NWE
Permitir Entrantes e Blended:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Status de Discagem$o: \n"; + + if ($DEFstatusDISABLED > 0) + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVE
Add A Dial Status:   \n"; + echo "     $NWB#vicidial_campaigns-dial_status$NWE
Ordem da Lista: $NWB#vicidial_campaigns-lead_order$NWE
Mesclagem de Lista: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtro de registros: $NWB#vicidial_campaigns-lead_filter_id$NWE
Tiempo de caída de bloqueo: $NWB#vicidial_campaigns-drop_lockout_time$NWE
Nível do Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Forçar Reset do Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Método de Discagem: $NWB#vicidial_campaigns-dial_method$NWE
Nível de Discagem Automática: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       SOBREPOR ADAPT
Somente Lista Autom.: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Limite de Derrubadas (drop): % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Nível Máximo de Discagem: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Horário Final do Servidor: 4 somente dígitos $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Modificador de Intensidade : $NWB#vicidial_campaigns-adaptive_intensity$NWE
Alvo de Diferença de Nível: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Transferências Simultâneas: $NWB#vicidial_campaigns-concurrent_transfers$NWE
Prioridade da Fila: $NWB#vicidial_campaigns-queue_priority$NWE
Varias campañas Drop Rate Grupo: $NWB#vicidial_campaigns-drop_rate_group$NWE
Auto Discar Alternativo: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Próximo Agente a chamar: $NWB#vicidial_campaigns-next_agent_call$NWE
Horário Local da Chamada: $NWB#vicidial_campaigns-local_call_time$NWE
Tempo de Espera da Discagem: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Prefixo de Discagem: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Omitir Código de Telefone: $NWB#vicidial_campaigns-omit_phone_code$NWE
CallerID da Campanha: $NWB#vicidial_campaigns-campaign_cid$NWE\n"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y';"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] > 0) + {echo " LIST OVERRIDE ACTIVE";} + echo "
Extensão VDAD da Campanha: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Extensão de Gravação da Campanha: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Gravação da Campanha: $NWB#vicidial_campaigns-campaign_recording$NWE
Nome do Arquivo de Gravação da Campanha: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Atraso de Gravação: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE\n"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y';"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] > 0) + {echo " LIST OVERRIDE ACTIVE";} + echo "
Pegar lançamento da chamada: $NWB#vicidial_campaigns-get_call_launch$NWE
Mensagem na Secretária Eletrônica: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] > 0) + {echo " LIST OVERRIDE ACTIVE";} + echo "
Opciones WaitForSilence: $NWB#vicidial_campaigns-waitforsilence_options$NWE
Extensão para enviar AMD: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
Ação CPD AMD: $NWB#vicidial_campaigns-cpd_amd_action$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Número Transfer-Conf 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Número Transfer-Conf 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Número Transfer-Conf 3: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Número Transfer-Conf 4: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Número Transfer-Conf 5: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Rápida transferencia Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
Transferencia de rellenar previamente Preset: $NWB#vicidial_campaigns-prepopulate_transfer_preset$NWE
Temporizador de Acción de: $NWB#vicidial_campaigns-timer_action$NWE
Temporizador de mensaje de acción: $NWB#vicidial_campaigns-timer_action_message$NWE
Temporizador Segundos Acción: $NWB#vicidial_campaigns-timer_action_seconds$NWE
Discagem para número alternativo: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Agendamento de Chamadas: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Tempo até derrubar(DROP): $NWB#vicidial_campaigns-drop_call_seconds$NWE
Ação de Drop:$NWB#vicidial_campaigns-drop_action$NWE
Extensão do Porto Seguro: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Correio de Voz: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
Grupo de Transferência de Drop:$NWB#vicidial_campaigns-drop_inbound_group$NWE\n"; + $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y';"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] > 0) + {echo " LIST OVERRIDE ACTIVE";} + echo "
Tempo de pós atendimento: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Mensagem de pós atendimento: $NWB#vicidial_campaigns-wrapup_message$NWE
Usar lista de bloqueio interna: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Usar Lista de Bloqueio: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
AgentCódigos de PausaAtivo: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Campanha Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
Desabilitar Alteração de Dados do Cliente:$NWB#vicidial_campaigns-disable_alter_custdata$NWE
Desab. Alterar Telefone do Cliente :$NWB#vicidial_campaigns-disable_alter_custphone$NWE
Permitir Logar Sem Registros no Hopper: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
N marcado Hopper: $NWB#vicidial_campaigns-no_hopper_dialing$NWE
Único propietario de marcado: $NWB#vicidial_campaigns-agent_dial_owner_only$NWE
Agente Seleccione territorios: $NWB#vicidial_campaigns-agent_select_territories$NWE
Agente de pantalla Dialable Leads: $NWB#vicidial_campaigns-agent_display_dialable_leads$NWE
Mostrar Clientes em Espera ao Agente:$NWB#vicidial_campaigns-display_queue_count$NWE
Agente Pide Ver en cola: $NWB#vicidial_campaigns-view_calls_in_queue$NWE
Ver las llamadas en cola de lanzamiento: $NWB#vicidial_campaigns-view_calls_in_queue_launch$NWE
Agente Pide Agarre en cola: $NWB#vicidial_campaigns-grab_calls_in_queue$NWE
Agente de Call Re-Cola Button: $NWB#vicidial_campaigns-call_requeue_button$NWE
Agente de pausa después de cada llamada: $NWB#vicidial_campaigns-pause_after_each_call$NWE
ID da Lista Manual :$NWB#vicidial_campaigns-manual_dial_list_id$NWE
Filtro de Discagem Manual:$NWB#vicidial_campaigns-manual_dial_filter$NWE
Cópia p/ Área de Transf. do Agente: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
Discagem Extendida na tela do Agente : $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
CallerID de Chamada a 3: $NWB#vicidial_campaigns-three_way_call_cid$NWE
Prefixo para chamadas a 3: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
Alias de Grupo Permitido: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
Alias de Grupo Padrão: $NWB#vicidial_campaigns-default_group_alias$NWE
Categoria de Pesquisa Vtiger: $NWB#vicidial_campaigns-vtiger_search_category$NWE
Pesquisar contas Mortas no Vtiger: $NWB#vicidial_campaigns-vtiger_search_dead$NWE
Criar Registro de Chamada no Vtiger: $NWB#vicidial_campaigns-vtiger_create_call_record$NWE
Criar Registro de Tel. no Vtiger: $NWB#vicidial_campaigns-vtiger_create_lead_record$NWE
Status da Chamada no Vtiger: $NWB#vicidial_campaigns-vtiger_status_call$NWE
Tela de Login do Vtiger: $NWB#vicidial_campaigns-vtiger_screen_login$NWE
CRM Popup Login: $NWB#vicidial_campaigns-crm_popup_login$NWE
CRM Dirección Popup: $NWB#vicidial_campaigns-crm_login_address$NWE
Iniciar llamada URL: $NWB#vicidial_campaigns-start_call_url$NWE
Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
Grupos De entrada Permitidos:
"; + echo " $NWB#vicidial_campaigns-closer_campaigns$NWE
\n"; + echo "$groups_list"; + echo "
Grupo de Transferência Padrão:$NWB#vicidial_campaigns-default_xfer_group$NWE
Grupos de Transferência Permitidos:
"; + echo " $NWB#vicidial_campaigns-xfer_groups$NWE
\n"; + echo "$XFERgroups_list"; + echo "
\n"; + + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "
LISTAS DESTA CAMPANHA:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPANHAlink='stage=CAMPANHADOWN'; + $CALLDATElink='stage=CALLDATEDOWN'; + $SQLorder='order by list_id'; + if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} + if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} + if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} + if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} + if (eregi("ACTIVEDOWN",$stage)) {$SQLorder='order by active desc'; $ACTIVElink='stage=ACTIVEUP';} + if (eregi("CAMPANHAUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPANHAlink='stage=CAMPANHADOWN';} + if (eregi("CAMPANHADOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPANHAlink='stage=CAMPANHAUP';} + if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} + if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "\n"; + echo "
ID DA LISTANOME DA LISTADESCRIÇÃOTOTAL DE REG.ATIVOÚLTIMA CHAMADAALTERAR
$row[0] $row[1] $row[2] $row[3] $row[4]"; + + if (ereg('Y',$row[4])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + echo ""; + } + else + { + $inactive_lists++; + echo ""; + echo " $row[5]ALTERAR

\n"; + + echo "
\n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Esta campanha tem$active_lists listas ativas e$inactive_lists listas inativas

\n"; + + if ($display_dialable_count == 'Y') + { + ### call function to calculate and print dialable leads + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + echo " - ESCONDER

"; + } + else + { + echo "Popup Dialable Leads Count"; + echo " - MOSTRAR

"; + } + + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $hopper_leads = "$rowx[0]"; + + echo "Esta campanha tem$hopper_leads registros no hopper

\n"; + echo "Clique aqui para ver quais registros estão no hopper agora

\n"; + echo "Clique aqui para ver um relatório VDAD para esta campanha

\n"; + } + echo "Clique aqui para visualizar todos os registros de Chamada Agendada para esta campanha

\n"; + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver alterações Admin para esta campanha
\n"; + } + echo "
\n"; + } + + + ##### CAMPANHA CUSTOM STATUS ##### + if ($SUB==22) + { + + ##### get status category listings for dynamic pulldown + $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; + $rslt=mysql_query($stmt, $link); + $cats_to_print = mysql_num_rows($rslt); + $cats_list=""; + + $o=0; + while ($cats_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $cats_list .= "\n"; + $catsname_list["$rowx[0]"] = substr($rowx[1],0,20); + $o++; + } + + + echo "
\n"; + echo "
STATUS CUSTOMIZADOS PARA ESSA CAMPANHA:   $NWB#vicidial_campaign_statuses$NWE
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id'"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $AScategory = $rowx[5]; + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
STATUSDESCRIÇÃOSELECIONÁVELRESPOSTA HUMANOACATEGORIAMODIFY-DELETE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$rowx[0]
\n"; + echo "\n"; + echo "         \n"; + echo "   \n"; + echo "APAGAR\n"; + echo "
\n"; + + echo "  Sale:   \n"; + echo "  DNC:   \n"; + echo "  Customer Contact:   \n"; + echo "  Not Interested:   \n"; + echo "  Unworkable:   \n"; + + echo "
\n"; + + echo "
INCLUIR NOVO STATUS DE CAMPANHA
\n"; + echo "\n"; + echo "\n"; + echo "Status:   \n"; + echo "Descrição:   \n"; + echo "Selecionável:  
\n"; + echo "Resposta Humana:   \n"; + echo "Sale:   \n"; + echo "DNC:   \n"; + echo "Customer Contact:  
\n"; + echo "Not Interested:   \n"; + echo "Unworkable:   \n"; + echo "Categoria:\n"; + echo "  
\n"; + echo "
\n"; + + echo "

\n"; + } + + ##### CAMPANHA HOTKEYS ##### + if ($SUB==23) + { + echo "
ATALHOS DE TECLADO DESTA CAMPANHA:   $NWB#vicidial_campaign_hotkeys$NWE
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT status,hotkey,status_name,selectable,campaign_id from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + + } + + echo "
ATALHOSTATUSDESCRIÇÃOAPAGAR
$rowx[1]$rowx[0]$rowx[2]APAGAR
\n"; + + echo "
INCLUIR NOVO ATALHO DE TECLADO DA CAMPANHA
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Hotkey:   \n"; + echo "Status:   \n"; + echo "
\n"; + echo "

\n"; + } + + ##### CAMPANHA LEAD RECYCLING ##### + if ($SUB==25) + { + ### display counts on leads that have hit the limit in this campaign + $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";} + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + + $stmt="SELECT recycle_id,campaign_id,status,attempt_delay,attempt_maximum,active from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; + $rslt=mysql_query($stmt, $link); + $recycle_to_print = mysql_num_rows($rslt); + $o=0; + while ($recycle_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $RECYCLE_status[$o] = $rowx[2]; + $RECYCLE_delay[$o] = $rowx[3]; + $RECYCLE_attempt[$o] = $rowx[4]; + $RECYCLE_active[$o] = $rowx[5]; + $RECYCLE_count[$o] = "'Y','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'"; + if ($RECYCLE_attempt[$o]==1) {$RECYCLE_count[$o] = "'Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";} + if ($RECYCLE_attempt[$o]==2) {$RECYCLE_count[$o] = "'Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";} + if ($RECYCLE_attempt[$o]==3) {$RECYCLE_count[$o] = "'Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";} + if ($RECYCLE_attempt[$o]==4) {$RECYCLE_count[$o] = "'Y4','Y5','Y6','Y7','Y8','Y9','Y10'";} + if ($RECYCLE_attempt[$o]==5) {$RECYCLE_count[$o] = "'Y5','Y6','Y7','Y8','Y9','Y10'";} + if ($RECYCLE_attempt[$o]==6) {$RECYCLE_count[$o] = "'Y6','Y7','Y8','Y9','Y10'";} + if ($RECYCLE_attempt[$o]==7) {$RECYCLE_count[$o] = "'Y7','Y8','Y9','Y10'";} + if ($RECYCLE_attempt[$o]==8) {$RECYCLE_count[$o] = "'Y8','Y9','Y10'";} + if ($RECYCLE_attempt[$o]==9) {$RECYCLE_count[$o] = "'Y9','Y10'";} + if ($RECYCLE_attempt[$o]>9) {$RECYCLE_count[$o] = "'Y10'";} + $o++; + } + $o=0; + + echo "

RECICLAGEM DE REGISTROS DESTA CAMPANHA:   $NWB#vicidial_lead_recycle$NWE
\n"; + echo "\n"; + echo "\n"; + + while ($recycle_to_print > $o) + { + $recycle_limit=0; + if (strlen($camp_lists) > 2) + { + $stmt="SELECT count(*) from vicidial_list where status='$RECYCLE_status[$o]' and list_id IN($camp_lists) and called_since_last_reset IN($RECYCLE_count[$o]);"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $counts_to_print = mysql_num_rows($rslt); + if ($counts_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $recycle_limit = $rowx[0]; + } + } + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o++; + } + + echo "
STATUSTEMPO DE TENTATIVAQUANTIDADE MÁXIMA DE TENTATIVASREGISTROS NO LIMITEATIVO APAGAR
  $RECYCLE_status[$o]
\n"; + echo "\n"; + echo "\n"; + echo "
$recycle_limit   APAGAR
\n"; + + echo "
INCLUIR RECICLAGEM DE REGISTROS DA CAMPANHA
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Status:   \n"; + echo "Tempo de Tentativa: \n"; + echo "Quantidade Máxima de Tentativas: \n"; + echo "
\n"; + + echo "

\n"; + echo "
\n"; + echo "* Contagem de registros tirada das listas ativas nesta campanha.\n"; + } + + ##### CAMPANHA AUTO-ALT-NUMBER DIALING ##### + if ($SUB==26) + { + echo "

DISCAR NÚMERO ALT. NESTA CAMPANHA:   $NWB#vicidial_auto_alt_dial_statuses$NWE
\n"; + echo "\n"; + echo "\n"; + + $auto_alt_dial_statuses = preg_replace("/ -$/","",$auto_alt_dial_statuses); + $AADstatuses = explode(" ", $auto_alt_dial_statuses); + $AADs_to_print = (count($AADstatuses) -1); + + $o=0; + while ($AADs_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + $o++; + + echo "\n"; + echo "\n"; + } + + echo "
STATUSAPAGAR
$AADstatuses[$o]APAGAR
\n"; + + echo "
INCLUIR NOVO STATUS PARA DISCAGEM DE NÚM. ALT.
\n"; + echo "\n"; + echo "\n"; + echo "Status:   \n"; + echo "
\n"; + + echo "

\n"; + } + + ##### CAMPANHA CÓDIGOS DE PAUSA ##### + if ($SUB==27) + { + echo "

CÓDIGOS DE PAUSA PARA CAMPANHA:   $NWB#vicidial_pause_codes$NWE
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT pause_code,pause_code_name,billable,campaign_id from vicidial_pause_codes where campaign_id='$campaign_id' order by pause_code"; + $rslt=mysql_query($stmt, $link); + $pause_codes_to_print = mysql_num_rows($rslt); + $o=0; + while ($pause_codes_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
CÓDIGOS DE PAUSACOBRÁVELALTERARAPAGAR
$rowx[0]\n"; + echo "\n"; + echo "\n"; + echo "  \n"; + echo "
APAGAR
\n"; + + echo "
NOVO CÓDIGO DE PAUSA
\n"; + echo "\n"; + echo "\n"; + echo "Código de Pausa: \n"; + echo "Nome do Código de Pausa: \n"; + echo "   Cobrável: \n"; + echo "
\n"; + + echo "

\n"; + } + + ##### CAMPANHA QC SETTINGS ##### + if ( ($SUB==28) and ($SSqc_features_active > 0) ) + { + $stmt="SELECT list_id,list_name,active from vicidial_lists where campaign_id='$campaign_id'"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $qc_lists_list=''; + + $p=0; + while ($lists_to_print > $p) + { + $rowx=mysql_fetch_row($rslt); + $qc_lists_list .= " $o) + { + $rowx=mysql_fetch_row($rslt); + $QCscripts_list .= "\n"; + $scriptname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + ##### get shifts listings for pulldown + $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $rslt=mysql_query($stmt, $link); + $shifts_to_print = mysql_num_rows($rslt); + $QCshifts_list=""; + $o=0; + while ($shifts_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $QCshifts_list .= "\n"; + $shiftname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + + echo "

CONFIGURAÇÕES DE CQ PARA CAMPANHA:
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; +# echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "\n"; + echo "CQ Ativado: $NWB#vicidial_campaigns-qc_enabled$NWE
Status de CQ:
$NWB#vicidial_campaigns-qc_statuses$NWE
$qc_statuses_list
QC Lists:
$NWB#vicidial_campaigns-qc_lists$NWE
$qc_lists_list
WebForm de CQ:$NWB#vicidial_campaigns-qc_web_form_address$NWE
Script de CQ: $NWB#vicidial_campaigns-qc_script$NWE
Turno de CQ: $NWB#vicidial_campaigns-qc_shift_id$NWE
Entrada de registro CQ: $NWB#vicidial_campaigns-qc_get_record_launch$NWE
Mostrar Gravações CQ: $NWB#vicidial_campaigns-qc_show_recording$NWE
\n"; + echo "

\n"; + } + + ##### CAMPANHA SURVEY SETTINGS ##### + if ($SUB=='20A') + { + + echo "

CONFIG. DE PESQUISA PARA ESTA CAMPANHA:
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "\n"; + + echo "
Primeiro Arquivo de Audio: audio chooser $NWB#vicidial_campaigns-survey_first_audio_file$NWE
Dígitos DTMF: $NWB#vicidial_campaigns-survey_dtmf_digits$NWE
Dígito p/ Não Interessado: $NWB#vicidial_campaigns-survey_ni_digit$NWE
Arquivo de Audio para Interessado: audio chooser $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
Arquivo de Audio para não Interessado: audio chooser $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
Método de Pesquisa: $NWB#vicidial_campaigns-survey_method$NWE
Ação p/ sem Resposta: $NWB#vicidial_campaigns-survey_no_response_action$NWE
Status p/ Não Interessado: $NWB#vicidial_campaigns-survey_ni_status$NWE
Terceiro Dígito: $NWB#vicidial_campaigns-survey_third_digit$NWE
Terceiro Arquivo de Audio: audio chooser $NWB#vicidial_campaigns-survey_third_audio_file$NWE
Terceiro Status: $NWB#vicidial_campaigns-survey_third_status$NWE
Terceira Extensão: $NWB#vicidial_campaigns-survey_third_exten$NWE
Quarto Dígito: $NWB#vicidial_campaigns-survey_fourth_digit$NWE
Quarto Arquivo de Audio: audio chooser $NWB#vicidial_campaigns-survey_fourth_audio_file$NWE
Quarto Status: $NWB#vicidial_campaigns-survey_fourth_status$NWE
Quarta Extensão: $NWB#vicidial_campaigns-survey_fourth_exten$NWE
Mapa de Digitos: $NWB#vicidial_campaigns-survey_response_digit_map$NWE
Pesquisa Extensão de Transfer.: $NWB#vicidial_campaigns-survey_xfer_exten$NWE
Diretório de Gravações da Pesquisa: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
Correio de Voz: voicemail chooser $NWB#vicidial_campaigns-voicemail_ext$NWE
\n"; + echo "

\n"; + } + + + if ($SUB < 1) + { + echo "

\n"; + echo "DESCONECTAR TODOS OS AGENTES DESTA CAMPANHA

\n"; + echo "EMERGENCY VDAC CLEAR FOR THIS CAMPANHA

\n"; + + if ($LOGdelete_campaigns > 0) + { + echo "

APAGAR ESTA CAMPANHA\n"; + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } +} + + +###################### +# ADD=34 modify campaign info in the system - Basic View +###################### + +if ( ($ADD==34) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPANHAS",$LOGallowed_campaigns)) ) ) + {$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list + +if ($ADD==34) + { + if ($LOGmodify_campaigns==1) + { + if ($stage=='show_dialable') + { + $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + if ($stage=='hide_dialable') + { + $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $dial_status_a = $row[3]; + $dial_status_b = $row[4]; + $dial_status_c = $row[5]; + $dial_status_d = $row[6]; + $dial_status_e = $row[7]; + $lead_order = $row[8]; + $hopper_level = $row[13]; + $auto_dial_level = $row[14]; + $next_agent_call = $row[15]; + $local_call_time = $row[16]; + $voicemail_ext = $row[17]; + $dial_timeout = $row[18]; + $dial_prefix = $row[19]; + $campaign_cid = $row[20]; + $campaign_vdad_exten = $row[21]; + $script_id = $row[25]; + $get_call_launch = $row[26]; + $lead_filter_id = $row[35]; + if ($lead_filter_id=='') {$lead_filter_id='NONE';} + $display_dialable_count = $row[39]; + $dial_method = $row[46]; + $adaptive_intensity = $row[51]; + $campaign_description = $row[57]; + $campaign_changedate = $row[58]; + $campaign_stats_refresh = $row[59]; + $campaign_logindate = $row[60]; + $dial_statuses = $row[61]; + $list_order_mix = $row[64]; + $default_xfer_group = $row[67]; + $campaign_allow_inbound = $row[65]; + $default_xfer_group = $row[67]; + $drop_lockout_time = $row[116]; + + if (ereg("DISABLED",$list_order_mix)) + {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} + else + {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} + + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $statuses_list=''; + $dial_statuses_list=''; + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_list .= "\n"; + if ($rowx[0] != 'CBHOLD') {$dial_statuses_list .= "\n";} + $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; + if (eregi("Y",$rowx[2])) + {$HKstatuses_list .= "\n";} + $o++; + } + + $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $rslt=mysql_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_list .= "\n"; + if ($rowx[0] != 'CBHOLD') {$dial_statuses_list .= "\n";} + $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; + if (eregi("Y",$rowx[2])) + {$HKstatuses_list .= "\n";} + $o++; + } + + $dial_statuses = preg_replace("/ -$/","",$dial_statuses); + $Dstatuses = explode(" ", $dial_statuses); + $Ds_to_print = (count($Dstatuses) -1); + + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE'"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $mixes_list="\n"; + $mixname_list["DISABLED"] = "DISABLED"; + } + else + { + ##### get list_mix listings for dynamic pulldown + $stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1"; + $rslt=mysql_query($stmt, $link); + $mixes_to_print = mysql_num_rows($rslt); + $mixes_list="\n"; + + $o=0; + while ($mixes_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $mixes_list .= "\n"; + $mixname_list["ACTIVE"] = "$rowx[0] - $rowx[1]"; + $o++; + } + } + + if ($SUB<1) {$camp_detail_color=$subcamp_color;} + else {$camp_detail_color=$campaigns_color;} + if ($SUB==22) {$camp_statuses_color=$subcamp_color;} + else {$camp_statuses_color=$campaigns_color;} + if ($SUB==23) {$camp_hotkeys_color=$subcamp_color;} + else {$camp_hotkeys_color=$campaigns_color;} + if ($SUB==25) {$camp_recycle_color=$subcamp_color;} + else {$camp_recycle_color=$campaigns_color;} + if ($SUB==26) {$camp_autoalt_color=$subcamp_color;} + else {$camp_autoalt_color=$campaigns_color;} + if ($SUB==27) {$camp_pause_color=$subcamp_color;} + else {$camp_pause_color=$campaigns_color;} + if ($SUB==29) {$camp_listmix_color=$subcamp_color;} + else {$camp_listmix_color=$campaigns_color;} + echo "\n"; + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + } + echo "\n"; + echo "\n"; + if ($SSoutbound_autodial_active < 1) + { + echo ""; + } + echo "
$row[0]: Visão Básica Visão Detalhada Mesclagem de Lista Tela de Tempo Real  
\n"; + + if ($SUB < 1) + { + echo "
\n"; + echo ""; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + + $o=0; + while ($Ds_to_print > $o) + { + $o++; + $Dstatus = $Dstatuses[$o]; + + echo "\n"; + } + else + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVER\n"; + } + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + } + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
ID da Campanha: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nome da Campanha: $NWB#vicidial_campaigns-campaign_name$NWE
Descrição da Campanha: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
Campanha Data da Alter.: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campanha Data do Login: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Ativo: $NWB#vicidial_campaigns-active$NWE
Extensão de Estacionamento: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Formulário Web: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Permitir Finalizadores (Closers): $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Grupo de Transferência Padrão:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
Permitir Entrantes e Blended:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Status de Discagem$o: \n"; + if ($DEFstatusDISABLED > 0) + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVE
Add A Dial Status:   \n"; + echo "     $NWB#vicidial_campaigns-dial_status$NWE
Ordem da Lista: $NWB#vicidial_campaigns-lead_order$NWE
Mesclagem de Lista: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtro de registros: $NWB#vicidial_campaigns-lead_filter_id$NWE
Nível do Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Forçar Reset do Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Método de Discagem: $NWB#vicidial_campaigns-dial_method$NWE
Nível de Discagem Automática: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Modificador de Intensidade : $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
Pegar lançamento da chamada: $get_call_launch
\n"; + + echo "
\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
LISTAS DESTA CAMPANHA:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPANHAlink='stage=CAMPANHADOWN'; + $CALLDATElink='stage=CALLDATEDOWN'; + $SQLorder='order by list_id'; + if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} + if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} + if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} + if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} + if (eregi("ACTIVEDOWN",$stage)) {$SQLorder='order by active desc'; $ACTIVElink='stage=ACTIVEUP';} + if (eregi("CAMPANHAUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPANHAlink='stage=CAMPANHADOWN';} + if (eregi("CAMPANHADOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPANHAlink='stage=CAMPANHAUP';} + if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} + if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o++; + } + + echo "\n"; + echo "
ID DA LISTANOME DA LISTADESCRIÇÃOTOTAL DE REG.ATIVOÚLTIMA CHAMADAALTERAR
$row[0] $row[1] $row[2] $row[3] $row[4]"; + + if (ereg('Y',$row[4])) + { + $active_lists++; + $camp_lists .= "'$row[0]',"; + echo ""; + } + else + { + $inactive_lists++; + echo ""; + echo " $row[5]ALTERAR

\n"; + echo "
\n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = preg_replace("/\\\\/","",$filterSQL); + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Esta campanha tem$active_lists listas ativas e$inactive_lists listas inativas

\n"; + + + if ($display_dialable_count == 'Y') + { + ### call function to calculate and print dialable leads + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL); + echo " - ESCONDER

"; + } + else + { + echo "Popup Dialable Leads Count"; + echo " - MOSTRAR

"; + } + + + + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $hopper_leads = "$rowx[0]"; + + echo "Esta campanha tem$hopper_leads registros no hopper

\n"; + echo "Clique aqui para ver quais registros estão no hopper agora

\n"; + echo "Clique aqui para ver um relatório VDAD para esta campanha

\n"; + } + echo "Clique aqui para visualizar todos os registros de Chamada Agendada para esta campanha

\n"; + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver alterações Admin para esta campanha
\n"; + } + + echo "
\n"; + + echo "
\n"; + + ### list of agent rank or skill-level for this campaign + echo "
\n"; + echo "
RANKING DO AGENTE NA CAMPANHA:
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;"; + $rsltx=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($users_to_print > $o) { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
USER     RANK     CALLS TODAY
$rowx[0] - $rowx[3]$rowx[1]$rowx[2]

\n"; + + + echo "DESCONECTAR TODOS OS AGENTES DESTA CAMPANHA

\n"; + + + if ($LOGdelete_campaigns > 0) + { + echo "

APAGAR ESTA CAMPANHA\n"; + } + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } +} + + +###################### +# ADD=31 or 34 and SUB=29 for list mixes +###################### +if ( ( ($ADD==34) or ($ADD==31) ) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPANHAS",$LOGallowed_campaigns)) ) ) + {$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list + +if ( ($ADD==34) or ($ADD==31) ) +{ + if ($LOGmodify_campaigns==1) + { + ##### CAMPANHA LIST MIX SETTINGS ##### + if ($SUB==29) + { + ##### get list_id listings for dynamic pulldown + $stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' order by list_id"; + $rslt=mysql_query($stmt, $link); + $mixlists_to_print = mysql_num_rows($rslt); + $mixlists_list=""; + + $o=0; + while ($mixlists_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $mixlists_list .= "\n"; + $mixlistsname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + + + echo "

MESCLAGEM DE LISTAS PARA ESTA CAMPANHA:  $NWB#vicidial_campaigns-list_order_mix$NWE
\n"; + + echo "
ATENÇÃO, só recomendamos Mesclagem de Listas para usuários avançados, Por favor leia o Manual de Gerente do Vicidial
\n"; + + $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id'"; + $rslt=mysql_query($stmt, $link); + $statuses = mysql_num_rows($rslt); + if ($statuses > 0) + { + $rowy=mysql_fetch_row($rslt); + $LMdial_statuses=$rowy[0]; + } + + $stmt="SELECT vcl_id,vcl_name,campaign_id,list_mix_container,mix_method,status from vicidial_campaigns_list_mix where campaign_id='$campaign_id' order by status, vcl_id"; + $rslt=mysql_query($stmt, $link); + $listmixes = mysql_num_rows($rslt); + $o=0; + while ($listmixes > $o) + { + $rowx=mysql_fetch_row($rslt); + $vcl_id=$rowx[0]; + $o++; + + if ($o < 2) + {$tablecolor='bgcolor="#99FF99"'; $bgcolor='bgcolor="#CCFFCC"';} + else + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$tablecolor='bgcolor="#B9CBFD"'; $bgcolor='bgcolor="#9BB9FB"';} + else + {$tablecolor='bgcolor="#9BB9FB"'; $bgcolor='bgcolor="#B9CBFD"';} + } + echo "
\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + } + else + {echo "$rowx[5]\n";} + echo "\n"; + echo "\n"; + +# list_id|order|percent|statuses|:list_id|order|percent|statuses|:... +# 101|1|40| A B NA -|:102|2|25| NEW -|:103|3|30| DROP CALLBK -|:101|4|5| DROP -| +# INSERT INTO vicidial_campaigns_list_mix values('TESTMIX','TESTCAMP List Mix','TESTCAMP','101|1|40| A B NA -|:102|2|25| NEW -|:103|3|30| DROP CALLBK -|:101|4|5| DROP -|','IN_ORDER','ACTIVE'); +# INSERT INTO vicidial_campaigns_list_mix values('TESTMIX2','TESTCAMP List Mix2','TESTCAMP','101|1|20| A B -|:102|2|45| NEW -|:103|3|30| DROP CALLBK -|:101|4|5| DROP -|','IN_ORDER','ACTIVE'); +# INSERT INTO vicidial_campaigns_list_mix values('TESTMIX3','TESTCAMP List Mix3','TESTCAMP','101|1|30| A NA -|:102|2|35| NEW -|:103|3|30| DROP CALLBK -|:101|4|5| DROP -|','IN_ORDER','ACTIVE'); + + $MIXentries = $MT; + $MIXentries = explode(":", $rowx[3]); + $Ms_to_print = (count($MIXentries) - 0); + $q=0; + while ($Ms_to_print > $q) + { + $MIXdetails = explode('|', $MIXentries[$q]); + $MIXdetailsLIST = $MIXdetails[0]; + + $dial_statuses = preg_replace("/ -$/","",$dial_statuses); + $Dstatuses = explode(" ", $dial_statuses); + $Ds_to_print = (count($Dstatuses) - 0); + $Dsql = ''; + $r=0; + while ($Ds_to_print > $r) + { + $r++; + $Dsql .= "'$Dstatuses[$r]',"; + } + $Dsql = preg_replace("/,$/","",$Dsql); + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + echo "\n"; + echo "\n"; + + + echo "\n"; + + + $q++; + + } + + + + + echo "\n"; + + echo "\n"; + + + echo "\n"; + + $X='X'; + echo "\n"; + echo "
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$vcl_id:\n"; + echo "\n"; + echo "     DELETE LIST MIX
Status: \n"; + if ($rowx[5]=='INACTIVE') + { + echo "$rowx[5]\n"; + echo "ATIVARMethod:\n"; + echo "
ID DA LISTAPRIORIDADE% MIXSTATUS
\n"; + echo "\n"; + echo "List: $MIXdetailsLIST   REMOVER\n"; + + + + echo " \n"; + echo "ADD   \n"; + echo "REMOVER\n"; + echo "
\n"; + echo "Difference %: \n"; + echo "   \n"; + echo "\n"; + echo "
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "List: \n"; + + if ($q > 39) {$AE_disabled = 'DISABLED';} + else {$AE_disabled = '';} + echo "\n"; + echo "
\n"; + echo "
\n"; + echo "\n"; + echo "
CHANGE: \n"; + echo "ALL   \n"; + echo "EMPTY\n"; + echo "
\n"; + echo " \n"; + echo "ADD   \n"; + echo "REMOVER\n"; + echo "
\n"; + } + + + echo "

NOVA LISTA MIX
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Mix ID: Mix Name: Mix Method: "; + echo "
List: Dial Status:  
\n"; + + echo "
\n"; + + } + } + echo "
\n"; +} + + +###################### +# ADD=30 campaign not allowed +###################### + +if ($ADD==30) +{ +echo "
\n"; + echo ""; +echo "You do not have permission to view campaign $campaign_id\n"; +} + + +###################### +# ADD=32 display all campaign statuses +###################### +if ($ADD==32) +{ +echo "
\n"; + echo ""; + +echo "
LISTA DE STATUS CUSTOMIZADOS:\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + +echo "
CAMPANHANOMESTATUSALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY STATUS
\n"; +} + + +###################### +# ADD=33 display all campaign hotkeys +###################### +if ($ADD==33) +{ +echo "
\n"; + echo ""; + +echo "
LISTA DE ATALHOS DA CAMPANHA:\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + +echo "
CAMPANHANOMEHOTKEYSALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by status"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY HOTKEYS
\n"; +} + + +###################### +# ADD=35 display all campaign lead recycle entries +###################### +if ($ADD==35) +{ +echo "
\n"; + echo ""; + +echo "
LISTA DE RECICLAGEM DE REGISTROS:\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + +echo "
CAMPANHANOMERECICLAGEM DE REGISTROSALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY RECICLAGEM DE REGISTROS
\n"; +} + + +###################### +# ADD=36 display all campaign auto-alt dial entries +###################### +if ($ADD==36) +{ +echo "
\n"; + echo ""; + +echo "
LISTA DE DISC. ALTERN. DE REG.:\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + +echo "
CAMPANHANOMEAUTO-ALT DIALALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if (strlen($row[0])<3) + {echo "NONE";} + echo "MODIFY AUTO-ALT DIAL
\n"; +} + + +###################### +# ADD=37 display all campaign agent pause codes +###################### +if ($ADD==37) +{ +echo "
\n"; + echo ""; + +echo "
LISTA DE CÓDIGOS DE PAUSA DE AGENTE:\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + +echo "
CAMPANHANOMECÓDIGOS DE PAUSAALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY CÓDIGOS DE PAUSA
\n"; +} + + +###################### +# ADD=39 display all campaign list mixes +###################### +if ($ADD==39) +{ +echo "
\n"; + echo ""; + +echo "
LISTA DE MESCLAGEM DE LISTA DE REGISTROS:\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; + } + + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + +echo "
CAMPANHANOMELIST MIXALTERAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY LIST MIX
\n"; +} + + + + + +###################### +# ADD=311 modify list info in the system +###################### + +if ($ADD==311) + { + if ($LOGmodify_lists==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $list_name = $row[1]; + $campaign_id = $row[2]; + $active = $row[3]; + $list_description = $row[4]; + $list_changedate = $row[5]; + $list_lastcalldate = $row[6]; + $reset_time = $row[7]; + $agent_script_override = $row[8]; + $campaign_cid_override = $row[9]; + $am_message_exten_override = $row[10]; + $drop_inbound_group_override = $row[11]; + $xferconf_a_number = $row[12]; + $xferconf_b_number = $row[13]; + $xferconf_c_number = $row[14]; + $xferconf_d_number = $row[15]; + $xferconf_e_number = $row[16]; + + # grab names of global statuses and statuses in the selected campaign + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + + $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $rslt=mysql_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statuses_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + # end grab status names + + ##### get scripts listings for pulldown + $Lscripts_list = "\n"; + $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $rslt=mysql_query($stmt, $link); + $scripts_to_print = mysql_num_rows($rslt); + $o=0; + while ($scripts_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Lscripts_list .= "\n"; + $scriptname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + + ##### get in-groups listings for dynamic drop in-group pulldown + $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $rslt=mysql_query($stmt, $link); + $Dgroups_to_print = mysql_num_rows($rslt); + $Dgroups_menu=''; + $Dgroups_selected=0; + $o=0; + while ($Dgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Dgroups_menu .= "\n"; + $o++; + } + if ($Dgroups_selected < 1) + {$Dgroups_menu .= "\n";} + else + {$Dgroups_menu .= "\n";} + + + echo "
ALTERAR REGISTRO DA LISTA: $list_id
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + echo "\n"; + echo "
ID da Lista: $list_id$NWB#vicidial_lists-list_id$NWE
Nome da Lista: $NWB#vicidial_lists-list_name$NWE
Descrição da Lista: $NWB#vicidial_lists-list_description$NWE
Campanha: $NWB#vicidial_lists-campaign_id$NWE
Ativo: $NWB#vicidial_lists-active$NWE
Reiniciar Status dos registros de chamada para esta Lista: $NWB#vicidial_lists-reset_list$NWE
Perdí Times: $NWB#vicidial_lists-reset_time$NWE
Data da Alteração: $list_changedate   $NWB#vicidial_lists-list_changedate$NWE
Data da última chamada da lista: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
Agente de secuencias de comandos Reemplazar: $NWB#vicidial_lists-agent_script_override$NWE
Campaña CID Override: $NWB#vicidial_lists-campaign_cid_override$NWE
Contestador automático de mensajes Override: audio chooser $NWB#vicidial_lists-am_message_exten_override$NWE
Drop de entrada Grupo de Override: $NWB#vicidial_lists-drop_inbound_group_override$NWE
Número Transfer-Conf 1 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
Número Transfer-Conf 2 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
Número Transfer-Conf 3 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
Número Transfer-Conf 4 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
Número Transfer-Conf 5 Override: $NWB#vicidial_lists-xferconf_a_dtmf$NWE
\n"; + + echo "
\n"; + echo "
STATUS DESTA LISTA:
\n"; + echo "\n"; + echo "\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $CLE=""; + } + else + { + $CLB=''; + $CLE=''; + } + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
STATUSNOME DO STATUSCHAMADONÃO CHAMADO
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + + + echo "
\n"; + echo "
FUSOS HORÁRIOS DESTA CAMPANHA:
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $plus='+'; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + if ($lead_list['count'] > 0) + { + while (list($tzone,) = each($lead_list[$since_reset])) + { + $LOCALzone=3600 * $tzone; + $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); + + if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} + else {$DISPtzone = "$tzone";} + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + } + + echo "\n"; + echo "\n"; + + echo "
DIFERENÇA PARA GMT AGORA (horário local)CHAMADONÃO CHAMADO
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + + + echo "
\n"; + echo "
PROPIETARIOS dentro de esta lista:
\n"; + echo "\n"; + echo "\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by owner,called_since_last_reset order by owner,called_since_last_reset"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
OWNERCHAMADONÃO CHAMADO
$CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + + + echo "
\n"; + echo "
RANKS dentro de esta lista:
\n"; + echo "\n"; + echo "\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT rank,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by rank,called_since_last_reset order by rank,called_since_last_reset"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($ranks_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($rank,) = each($lead_list[$since_reset])) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
RANKCHAMADONÃO CHAMADO
$CLB$rank$CLE".$lead_list['Y'][$rank]."".$lead_list['N'][$rank]."
SUBTOTAIS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT status, if(called_count >= 100, 100, called_count), count(*) from vicidial_list where list_id='$list_id' group by status, if(called_count >= 100, 100, called_count) order by status,called_count"; + $rslt=mysql_query($stmt, $link); + $status_called_to_print = mysql_num_rows($rslt); + + $o=0; + $sts=0; + $first_row=1; + $all_called_first=1000; + $all_called_last=0; + while ($status_called_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $leads_in_list = ($leads_in_list + $rowx[2]); + $count_statuses[$o] = $rowx[0]; + $count_called[$o] = $rowx[1]; + $count_count[$o] = $rowx[2]; + $all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]); + + if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") ) + { + if ($first_row) {$first_row=0;} + else {$sts++;} + $status[$sts] = "$rowx[0]"; + $status_called_first[$sts] = "$rowx[1]"; + if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];} + } + $leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]); + $status_called_last[$sts] = "$rowx[1]"; + if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];} + + $o++; + } + + + echo "
\n"; + echo "
CHAMADAS EFETUADAS DESTA LISTA:
\n"; + echo "\n"; + echo ""; + $first = $all_called_first; + while ($first <= $all_called_last) + { + if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} + else{$AB='bgcolor="#E0FFFF"';} + if ($first >= 100) {$Fplus='+';} + else {$Fplus='';} + echo ""; + $first++; + } + echo "\n"; + + $sts=0; + $statuses_called_to_print = count($status); + while ($statuses_called_to_print > $sts) + { + $Pstatus = $status[$sts]; + if (eregi("1$|3$|5$|7$|9$", $sts)) + {$bgcolor='bgcolor="#B9CBFD"'; $AB='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#9BB9FB"'; $AB='bgcolor="#B9CBFD"';} + # echo "$status[$sts]|$status_called_first[$sts]|$status_called_last[$sts]|$leads_in_sts[$sts]|\n"; + # echo "$status[$sts]|"; + echo ""; + + $first = $all_called_first; + while ($first <= $all_called_last) + { + if (eregi("1$|3$|5$|7$|9$", $sts)) + { + if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';} + else{$AB='bgcolor="#B9CBFD"';} + } + else + { + if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';} + else{$AB='bgcolor="#B9CBFD"';} + } + + $called_printed=0; + $o=0; + while ($status_called_to_print > $o) + { + if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") ) + { + $called_printed++; + echo ""; + } + + $o++; + } + if (!$called_printed) + {echo "";} + $first++; + } + echo "\n\n"; + + $sts++; + } + + echo ""; + $first = $all_called_first; + while ($first <= $all_called_last) + { + if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} + else{$AB='bgcolor="#E0FFFF"';} + echo ""; + $first++; + } + echo "\n"; + + echo "
STATUSNOME DO STATUS$first$FplusSUBTOTAL
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
TOTAL$all_called_count[$first]$leads_in_list

\n"; + + + + + + echo "
\n"; + + echo "

Clique aqui para ver todos os registros de Callback para esta lista

\n"; + echo "

Clique aqui para fazer download desta lista

\n"; + + if ($LOGdelete_lists > 0) + { + echo "

APAGAR ESTA LISTA\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver alterações Admin para esta lista
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + +###################### +# ADD=3111 modify in-group info in the system +###################### + +if ($ADD==3111) + { + if ($LOGmodify_ingroups==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_inbound_groups where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $group_name = $row[1]; + $group_color = $row[2]; + $active = $row[3]; + $web_form_address = stripslashes($row[4]); + $voicemail_ext = $row[5]; + $next_agent_call = $row[6]; + $fronter_display = $row[7]; + $script_id = $row[8]; + $get_call_launch = $row[9]; + $xferconf_a_dtmf = $row[10]; + $xferconf_a_number = $row[11]; + $xferconf_b_dtmf = $row[12]; + $xferconf_b_number = $row[13]; + $drop_call_seconds = $row[14]; + $drop_action = $row[15]; + $drop_exten = $row[16]; + $call_time_id = $row[17]; + $after_hours_action = $row[18]; + $after_hours_message_filename = $row[19]; + $after_hours_exten = $row[20]; + $after_hours_voicemail = $row[21]; + $welcome_message_filename = $row[22]; + $moh_context = $row[23]; + $onhold_prompt_filename = $row[24]; + $prompt_interval = $row[25]; + $agent_alert_exten = $row[26]; + $agent_alert_delay = $row[27]; + $default_xfer_group = $row[28]; + $queue_priority = $row[29]; + $drop_inbound_group = $row[30]; + $ingroup_recording_override = $row[31]; + $ingroup_rec_filename = $row[32]; + $afterhours_xfer_group = $row[33]; + $qc_enabled = $row[34]; + $qc_statuses = $row[35]; + $qc_shift_id = $row[36]; + $qc_get_record_launch = $row[37]; + $qc_show_recording = $row[38]; + $qc_web_form_address = stripslashes($row[39]); + $qc_script = $row[40]; + $play_place_in_line = $row[41]; + $play_estimate_hold_time = $row[42]; + $hold_time_option = $row[43]; + $hold_time_option_seconds = $row[44]; + $hold_time_option_exten = $row[45]; + $hold_time_option_voicemail = $row[46]; + $hold_time_option_xfer_group = $row[47]; + $hold_time_option_callback_filename = $row[48]; + $hold_time_option_callback_list_id = $row[49]; + $hold_recall_xfer_group = $row[50]; + $no_delay_call_route = $row[51]; + $play_welcome_message = $row[52]; + $answer_sec_pct_rt_stat_one = $row[53]; + $answer_sec_pct_rt_stat_two = $row[54]; + $default_group_alias = $row[55]; + $no_agent_no_queue = $row[56]; + $no_agent_action = $row[57]; + $no_agent_action_value = $row[58]; + $web_form_address_two = stripslashes($row[59]); + $timer_action = $row[60]; + $timer_action_message = $row[61]; + $timer_action_seconds = $row[62]; + $start_call_url = $row[63]; + $dispo_call_url = $row[64]; + $xferconf_c_number = $row[65]; + $xferconf_d_number = $row[66]; + $xferconf_e_number = $row[67]; + + ##### get in-groups listings for dynamic pulldown + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $rslt=mysql_query($stmt, $link); + $Xgroups_to_print = mysql_num_rows($rslt); + $Xgroups_menu=''; + $Xgroups_selected=0; + $Dgroups_menu=''; + $Dgroups_selected=0; + $Agroups_menu=''; + $Agroups_selected=0; + $Hgroups_menu=''; + $Hgroups_selected=0; + $Tgroups_menu=''; + $Tgroups_selected=0; + $o=0; + while ($Xgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xgroups_menu .= "\n"; + $Dgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; + if ($group_id!=$rowx[0]) + { + $Agroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; + $Tgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; + $Hgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; + } + $o++; + } + if ($Xgroups_selected < 1) + {$Xgroups_menu .= "\n";} + else + {$Xgroups_menu .= "\n";} + if ($Dgroups_selected < 1) + {$Dgroups_menu .= "\n";} + else + {$Dgroups_menu .= "\n";} + if ($Agroups_selected < 1) + {$Agroups_menu .= "\n";} + else + {$Agroups_menu .= "\n";} + if ($Tgroups_selected < 1) + {$Tgroups_menu .= "\n";} + else + {$Tgroups_menu .= "\n";} + if ($Hgroups_selected < 1) + {$Hgroups_menu .= "\n";} + else + {$Hgroups_menu .= "\n";} + + + echo "
ALTERAR REGISTRO DE GRUPOS: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($SSenable_second_webform > 0) + { + echo "\n"; + } + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + $eswHTML=''; + if ($SSenable_second_webform > 0) + {$eswHTML = '';} + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + ##### get groups_alias listings for dynamic default group alias pulldown list menu + $stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' order by group_alias_id"; + $rslt=mysql_query($stmt, $link); + $group_alias_to_print = mysql_num_rows($rslt); + $group_alias_menu=''; + $group_alias_selected=0; + $o=0; + while ($group_alias_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $group_alias_menu .= "\n"; + $o++; + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + echo "\n"; + + if ($SSqc_features_active > 0) + { + echo "\n"; + echo "\n"; + + ##### get status listings for dynamic pulldown + $qc_statuses = preg_replace("/^ | -$/","",$qc_statuses); + $QCstatuses = explode(" ", $qc_statuses); + $QCs_to_print = (count($QCstatuses) -0); + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $qc_statuses_list=''; + + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $qc_statuses_list .= " $o) + { + $rowx=mysql_fetch_row($rslt); + if (!ereg("\"$rowx[0]\"",$qc_statuses_list)) + { + $qc_statuses_list .= " $o) + { + $rowx=mysql_fetch_row($rslt); + $QCscripts_list .= "\n"; + $scriptname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + ##### get shifts listings for pulldown + $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $rslt=mysql_query($stmt, $link); + $shifts_to_print = mysql_num_rows($rslt); + $QCshifts_list=""; + $o=0; + while ($shifts_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $QCshifts_list .= "\n"; + $shiftname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
ID do Grupo: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Nome do Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Cor do Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
Ativo: $NWB#vicidial_inbound_groups-active$NWE
Formulário Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Formulário Web Two: $NWB#vicidial_inbound_groups-web_form_address$NWE
Próximo Agente a chamar: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Prioridade da Fila: $NWB#vicidial_inbound_groups-queue_priority$NWE
Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Pegar lançamento da chamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Número Transfer-Conf 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Número Transfer-Conf 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Número Transfer-Conf 3: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Número Transfer-Conf 4: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Número Transfer-Conf 5: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Temporizador de Acción de: $NWB#vicidial_inbound_groups-timer_action$NWE
Temporizador de mensaje de acción: $NWB#vicidial_inbound_groups-timer_action_message$NWE
Temporizador Segundos Acción: $NWB#vicidial_inbound_groups-timer_action_seconds$NWE
Tempo até derrubar(DROP): $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Ação de Drop:$NWB#vicidial_inbound_groups-drop_action$NWE
Exten de Drop: $NWB#vicidial_inbound_groups-drop_exten$NWE
Correio de Voz: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
Grupo de Transferência de Drop:$NWB#vicidial_inbound_groups-drop_inbound_group$NWE
Horário de Chamada:$NWB#vicidial_inbound_groups-call_time_id$NWE
Ação Fora do Expediente:$NWB#vicidial_inbound_groups-after_hours_action$NWE
Arquivo Fora do Expediente: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Extensão Fora do Expediente:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
Correio de Voz Fora do Expediente: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Grupo de Transferência Fora do Exped.:$NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
N de colas n Agentes: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE
No No Acción cola de agente: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n"; + + echo "
"; + echo "\n"; + + if ($no_agent_action=='CALLMENU') + { + echo ""; + echo "Menu:"; + echo ""; + echo " \n"; + } + if ($no_agent_action=='INGROUP') + { + if (strlen($no_agent_action_value) < 10) + {$no_agent_action_value = 'SALESLINE,CID,LB,998,TESTCAMP,1';} + $IGno_agent_action_value = explode(",",$no_agent_action_value); + $IGgroup_id = $IGno_agent_action_value[0]; + $IGhandle_method = $IGno_agent_action_value[1]; + $IGsearch_method = $IGno_agent_action_value[2]; + $IGlist_id = $IGno_agent_action_value[3]; + $IGcampaign_id = $IGno_agent_action_value[4]; + $IGphone_code = $IGno_agent_action_value[5]; + echo ""; + echo "In-Group:"; + echo ""; + echo " "; + echo "   Handle Method: \n"; + echo "
Search Method: \n"; + echo "   ID da Lista: "; + echo "
ID da Campanha: \n"; + echo "   Phone Code: "; + } + if ($no_agent_action=='DID') + { + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$no_agent_action_value';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $did_id = $row[0]; + + echo ""; + echo "DID:"; + echo ""; + echo " \n"; + } + if ($no_agent_action=='MESSAGE') + { + if (strlen($no_agent_action_value) < 3) + {$no_agent_action_value = 'nbdy-avail-to-take-call|vm-goodbye';} + echo "Audio File: audio chooser\n"; + } + if ($no_agent_action=='EXTENSION') + { + if (strlen($no_agent_action_value) < 3) + {$no_agent_action_value = '8304,default';} + $EXno_agent_action_value = explode(",",$no_agent_action_value); + $EXextension = $EXno_agent_action_value[0]; + $EXcontext = $EXno_agent_action_value[1]; + echo "Extensão:   Context: \n"; + } + if ($no_agent_action=='VOICEMAIL') + { + echo "Caixa do Correio de Voz: voicemail chooser\n"; + } + + echo "
+
 
Arquivo de Boas Vindas: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Tocar Mens. de Boas Vindas:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
Contexto da Música de Espera: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
Arquivo de Aviso de Espera audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
Intervalo de Aviso de Espera:$NWB#vicidial_inbound_groups-prompt_interval$NWE
Tocar Lugar na Fila:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
Tocar Tempo Estimado:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
Opção de Espera:$NWB#vicidial_inbound_groups-hold_time_option$NWE
Tempo de Opção de Espera:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
Extensão de Opção de Espera:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
Correio de Voz da Opção de Espera: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Grupo de Entrada da Opção de Espera:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
Arq. de Agend. da Opção de Espera: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Lista de Agend. da Opção de Espera:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
Agente de Alerta Nombre de archivo: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
Atraso de Alerta ao Agente:$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
Grupo de Transferência Padrão:$NWB#vicidial_inbound_groups-default_xfer_group$NWE
Alias de Grupo Padrão: $NWB#vicidial_inbound_groups-default_group_alias$NWE
Grupo de Transferência de Rechamada:$NWB#vicidial_inbound_groups-hold_recall_xfer_group$NWE
Rotear sem Atrasos:$NWB#vicidial_inbound_groups-no_delay_call_route$NWE
Sobrepor Config. de Grav. de Entr.:$NWB#vicidial_inbound_groups-ingroup_recording_override$NWE
Arquivo de Gravação de Entrada:$NWB#vicidial_inbound_groups-ingroup_rec_filename$NWE
Percentual Estatístico de Chamadas Atendidas em X seg 1: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
Percentual Estatístico de Chamadas Atendidas em X seg 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
Iniciar llamada URL: $NWB#vicidial_inbound_groups-start_call_url$NWE
Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
 
Config. de CQ para Entrantes:
CQ Ativado: $NWB#vicidial_inbound_groups-qc_enabled$NWE
Status de CQ:
$NWB#vicidial_inbound_groups-qc_statuses$NWE
$qc_statuses_list
WebForm de CQ:$NWB#vicidial_inbound_groups-qc_web_form_address$NWE
Script de CQ: $NWB#vicidial_inbound_groups-qc_script$NWE
Turno de CQ: $NWB#vicidial_inbound_groups-qc_shift_id$NWE
Entrada de registro CQ: $NWB#vicidial_inbound_groups-qc_get_record_launch$NWE
Mostrar Gravações CQ: $NWB#vicidial_inbound_groups-qc_show_recording$NWE
\n"; + echo "

\n"; + + + ### list of agent rank or skill-level for this inbound group + echo "
\n"; + echo "
AGENTE RANKS FOR THIS ENTRANTE GROUP:
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $rsltx=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
USER     RANK     CALLS TODAY
$rowx[0] - $rowx[3]$rowx[1]$rowx[2]

\n"; + + echo "

\n"; + + echo "
Clique aqui para ver um relatório deste grupo de entrada

\n"; + + echo "
\n"; + + echo "DIDS USING THIS IN-GROUP:
\n"; + echo "\n"; + + $stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where group_id='$group_id' and did_route='IN_GROUP';"; + $rslt=mysql_query($stmt, $link); + $dids_to_print = mysql_num_rows($rslt); + $o=0; + while ($dids_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[1] $row[2]

\n"; + echo "CALL MENUS USING THIS IN-GROUP:
\n"; + echo "\n"; + + $stmt="SELECT distinct vm.menu_id,menu_name from vicidial_call_menu vm,vicidial_call_menu_options vmo where vm.menu_id=vmo.menu_id and option_route='INGROUP' and option_route_value='$group_id';"; + $rslt=mysql_query($stmt, $link); + $cms_to_print = mysql_num_rows($rslt); + $o=0; + while ($cms_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]

\n"; + echo "CAMPAÑAS QUE PERMITA EN ESTE GRUPO:
\n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\";"; + $rslt=mysql_query($stmt, $link); + $campin_to_print = mysql_num_rows($rslt); + $o=0; + while ($campin_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]
\n"; + + if ($LOGdelete_ingroups > 0) + { + echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; + echo "

APAGAR ESTE GRUPO DE ENTRADA\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver alterações Admin para este grupo de entrada\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + +###################### +# ADD=3311 modify did info in the system +###################### + +if ($ADD==3311) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + $didSQL = "did_id='$did_id'"; + if ( (strlen($did_id)<1) and (strlen($did_pattern)>0) ) + {$didSQL = "did_pattern='$did_pattern'";} + $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id from vicidial_inbound_dids where $didSQL;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $did_id = $row[0]; + $did_pattern = $row[1]; + $did_description = $row[2]; + $did_active = $row[3]; + $did_route = $row[4]; + $extension = $row[5]; + $exten_context = $row[6]; + $voicemail_ext = $row[7]; + $phone = $row[8]; + $server_ip = $row[9]; + $user = $row[10]; + $user_unavailable_action = $row[11]; + $user_route_settings_ingroup = $row[12]; + $group_id = $row[13]; + $call_handle_method = $row[14]; + $agent_search_method = $row[15]; + $list_id = $row[16]; + $campaign_id = $row[17]; + $phone_code = $row[18]; + $menu_id = $row[19]; + + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + $campaigns_list=''; + $o=0; + while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "\n"; + $o++; + } + + ##### get in-groups listings for dynamic pulldown + $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $rslt=mysql_query($stmt, $link); + $Xgroups_to_print = mysql_num_rows($rslt); + $Xgroups_menu=''; + $Xgroups_selected=0; + $o=0; + while ($Xgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xgroups_menu .= "\n"; + $o++; + } + if ($Xgroups_selected < 1) + {$Xgroups_menu .= "\n";} + else + {$Xgroups_menu .= "\n";} + + + ##### get in-groups listings for dynamic pulldown + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $rslt=mysql_query($stmt, $link); + $Dgroups_to_print = mysql_num_rows($rslt); + $Dgroups_menu=''; + $Dgroups_selected=0; + $o=0; + while ($Dgroups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Dgroups_menu .= "\n"; + $o++; + } + if ($Dgroups_selected < 1) + {$Dgroups_menu .= "\n";} + else + {$Dgroups_menu .= "\n";} + + + echo "
ALTERAR UM REGISTRO DDR:$row[0]
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu;"; + $rslt=mysql_query($stmt, $link); + $menus_to_print = mysql_num_rows($rslt); + $menu_list=''; + $i=0; + while ($i < $menus_to_print) + { + $row=mysql_fetch_row($rslt); + $menu_list .= ""; + $i++; + } + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Extensão DDR:$NWB#vicidial_inbound_dids-did_pattern$NWE
Descrição DDR:$NWB#vicidial_inbound_dids-did_description$NWE
Ativo: $NWB#vicidial_inbound_dids-did_active$NWE
Rota DDR:$NWB#vicidial_inbound_dids-did_route$NWE
Extensão:$NWB#vicidial_inbound_dids-extension$NWE
Contexto da Extensão:$NWB#vicidial_inbound_dids-exten_context$NWE
Caixa do Correio de Voz: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
Extensão do Ramal:$NWB#vicidial_inbound_dids-phone$NWE
IP do Servidor: $NWB#vicidial_inbound_dids-server_ip$NWE
Menu: $NWB#vicidial_inbound_dids-menu_id$NWE
Agente:$NWB#vicidial_inbound_dids-user$NWE
Ação p/ Agente não Disponível:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
Config. de Rota de Entrada do Agente:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
In-ID do Grupo: $NWB#vicidial_inbound_dids-group_id$NWE
Método de Manuseio de Chamada Entrante:$NWB#vicidial_inbound_dids-call_handle_method$NWE
Método de Busca de Agente p/ Ch. Entr.:$NWB#vicidial_inbound_dids-agent_search_method$NWE
ID da Lista de Entrada:$NWB#vicidial_inbound_dids-list_id$NWE
ID da Campanha de Entrada:$NWB#vicidial_inbound_dids-campaign_id$NWE
Código do Ramal de Entrada:$NWB#vicidial_inbound_dids-phone_code$NWE
\n"; + echo "

\n"; + + echo "
Haga clic aquí para ver un informe de tráfico para este DID

\n"; + + if ($LOGdelete_dids > 0) + { + echo "

REMOVER DDR\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver alterações Admin para este DDR\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + +###################### +# ADD=3511 modify call menu info in the system +###################### + +if ($ADD==3511) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group from vicidial_call_menu where menu_id='$menu_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $menu_name = $row[0]; + $menu_prompt = $row[1]; + $menu_timeout = $row[2]; + $menu_timeout_prompt = $row[3]; + $menu_invalid_prompt = $row[4]; + $menu_repeat = $row[5]; + $menu_time_check = $row[6]; + $call_time_id = $row[7]; + $track_in_vdac = $row[8]; + $custom_dialplan_entry= $row[9]; + $tracking_group = $row[10]; + + + echo "
ALTERAR O REGISTRO DE MENU: $menu_id
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + + $j=0; + $stmtA="SELECT option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$menu_id' order by option_value;"; + $rslt=mysql_query($stmtA, $link); + $menus_to_print = mysql_num_rows($rslt); + + while ($menus_to_print > $j) + { + $row=mysql_fetch_row($rslt); + $Aoption_value[$j] = $row[0]; + $Aoption_description[$j] = $row[1]; + $Aoption_route[$j] = $row[2]; + $Aoption_route_value[$j] = $row[3]; + $Aoption_route_value_context[$j] = $row[4]; + $j++; + } + + $j=0; + while ($menus_to_print > $j) + { + $choose_height = (($j * 40) + 400); + $option_value = $Aoption_value[$j]; + $option_description = $Aoption_description[$j]; + $option_route = $Aoption_route[$j]; + $option_route_value = $Aoption_route_value[$j]; + $option_route_value_context = $Aoption_route_value_context[$j]; + + $dtmf_list = ""; + + if (eregi("1$|3$|5$|7$|9$", $j)) + {$bgcolor='bgcolor="#CCFFFF"';} + else + {$bgcolor='bgcolor="#99FFCC"';} + + echo "\n"; + $j++; + } + + while ($j <= 18) + { + $choose_height = (($j * 40) + 400); + $dtmf_list = ""; + + if (eregi("1$|3$|5$|7$|9$", $j)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + $j++; + } + + if ($SSallow_custom_dialplan > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + + echo "\n"; + echo "
ID do Menu: $menu_id $NWB#vicidial_call_menu-menu_id$NWE
Nome do Menu: $NWB#vicidial_call_menu-menu_name$NWE
Audio do Menu: audio chooser $NWB#vicidial_call_menu-menu_prompt$NWE
Tempo max do menu: $NWB#vicidial_call_menu-menu_timeout$NWE
Audio de tempo excedido do menu: audio chooser $NWB#vicidial_call_menu-menu_timeout_prompt$NWE
Audio de Opção Inválida do menu: audio chooser $NWB#vicidial_call_menu-menu_invalid_prompt$NWE
Repetir Menu: $NWB#vicidial_call_menu-menu_repeat$NWE
Verif. Horário de Menu: $NWB#vicidial_call_menu-menu_time_check$NWE
Horário de Chamada:$NWB#vicidial_call_menu-call_time_id$NWE
Rastrear Chamadas no Relat. Tempo-Real: $NWB#vicidial_call_menu-track_in_vdac$NWE
Grupo de seguimiento de: $NWB#vicidial_call_menu-tracking_group$NWE
Opções do Menu:
+ Opção: $dtmf_list   + Descrição: + Route: $NWB#vicidial_call_menu-option_value$NWE
+ + \n"; + + if ($option_route=='CALLMENU') + { + echo ""; + echo "Menu:"; + echo ""; + echo " \n"; + } + if ($option_route=='INGROUP') + { + if (strlen($option_route_value_context) < 10) + {$option_route_value_context = 'CID,LB,998,TESTCAMP,1';} + $IGoption_route_value_context = explode(",",$option_route_value_context); + $IGhandle_method = $IGoption_route_value_context[0]; + $IGsearch_method = $IGoption_route_value_context[1]; + $IGlist_id = $IGoption_route_value_context[2]; + $IGcampaign_id = $IGoption_route_value_context[3]; + $IGphone_code = $IGoption_route_value_context[4]; + echo ""; + echo "In-Group:"; + echo ""; + echo " "; + echo " "; + echo "   Handle Method: \n"; + echo "
Search Method: \n"; + echo "   ID da Lista: "; + echo "
ID da Campanha: \n"; + echo "   Phone Code: "; + } + if ($option_route=='DID') + { + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $did_id = $row[0]; + + echo ""; + echo "DID:"; + echo ""; + echo " \n"; + } + if ($option_route=='HANGUP') + { + echo "Audio File: audio chooser\n"; + } + if ($option_route=='EXTENSION') + { + echo "Extensão:   Context: \n"; + } + if ($option_route=='PHONE') + { + echo "Phone: \n"; + } + if ($option_route=='VOICEMAIL') + { + echo "Caixa do Correio de Voz: voicemail chooser\n"; + } + if ($option_route=='AGI') + { + echo "AGI: \n"; + } + + echo "
+
 
+ Opção: $dtmf_list   + Descrição: + Route: + $NWB#vicidial_call_menu-option_value$NWE
+ + \n"; + echo " +
 
Custom Plano de Discagem:
$NWB#vicidial_call_menu-custom_dialplan_entry$NWE
Custom Plano de Discagem: Disabled $NWB#vicidial_call_menu-custom_dialplan_entry$NWE
\n"; + echo "

\n"; + + echo "DIDS USING THIS CALL MENU:
\n"; + echo "\n"; + + $stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where menu_id='$menu_id' and did_route='CALLMENU';"; + $rslt=mysql_query($stmt, $link); + $dids_to_print = mysql_num_rows($rslt); + $o=0; + while ($dids_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[1] $row[2]

\n"; + + echo "CALL MENUS USING THIS CALL MENU:
\n"; + echo "\n"; + + $stmt="SELECT distinct vm.menu_id,menu_name from vicidial_call_menu vm,vicidial_call_menu_options vmo where vm.menu_id=vmo.menu_id and option_route='CALLMENU' and option_route_value='$menu_id';"; + $rslt=mysql_query($stmt, $link); + $cms_to_print = mysql_num_rows($rslt); + $o=0; + while ($cms_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]
\n"; + + + if ($LOGdelete_dids > 0) + { + echo "

REMOVER ESTE MENU\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações deste MENU
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + +###################### +# ADD=31111 modify remote agents info in the system +###################### + +if ($ADD==31111) + { + if ($LOGmodify_remoteagents==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $remote_agent_id = $row[0]; + $user_start = $row[1]; + $number_of_lines = $row[2]; + $server_ip = $row[3]; + $conf_exten = $row[4]; + $status = $row[5]; + $campaign_id = $row[6]; + + echo "
ALTERAR AGENTES REMOTOS: $row[0]
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Início do ID do Usuário: (somente números, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Número de linhas: (somente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP do Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
Extensão Externa: (número do plano de discagem para ligar para agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campanha: $NWB#vicidial_remote_agents-campaign_id$NWE
Grupos de Entrada: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; + echo "AVISO: Pode demorar até 30 segundos para que as alterações enviadas por essa tela se tornem ativas\n"; + + + if ($LOGdelete_remote_agents > 0) + { + echo "

APAGAR ESTE USUÁRIO REMOTO\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver alterações Admin para este Agente Remoto
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=311111 modify user group info in the system +###################### + +if ($ADD==311111) + { + if ($LOGmodify_usergroups==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT user_group,group_name,allowed_campaigns,qc_allowed_campaigns,qc_allowed_inbound_groups,group_shifts,forced_timeclock_login,shift_enforcement,agent_status_viewable_groups,agent_status_view_time from vicidial_user_groups where user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + $VGROUP_vgroups = $row[8]; + $agent_status_view_time = $row[9]; + + echo ""; + + echo "
ALTERAR O REGISTRO DE GRUPO DE USUÁRIOS\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + echo "\n"; + + + echo "\n"; + + echo "\n"; + + if ($SSqc_features_active > 0) + { + echo "\n"; + echo "\n"; + } + + echo "\n"; + echo "
Grupo: (sem espaços ou pontos)$NWB#vicidial_user_groups-user_group$NWE
Descrição: (descrição do grupo)$NWB#vicidial_user_groups-group_name$NWE
Forçar Login no Ponto: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
Controle de Turno: $NWB#vicidial_user_groups-shift_enforcement$NWE
Campanhas Permitidas:
$NWB#vicidial_user_groups-allowed_campaigns$NWE
\n"; + echo "$campaigns_list
 "; + echo "
Turnos do Grupo:
$NWB#vicidial_user_groups-group_shifts$NWE
\n"; + $stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id"; + $rslt=mysql_query($stmt, $link); + $shifts_to_print = mysql_num_rows($rslt); + $o=0; + while ($shifts_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $shift_id_value = $rowx[0]; + $shift_name_value = $rowx[1]; + echo " $shift_id_value - $shift_name_value
\n"; + $o++; + } + echo "
 
Estado del agente visible Grupos:
$NWB#vicidial_user_groups-agent_status_viewable_groups$NWE
\n"; + echo "ALL-GROUPS - All user groups in the system
\n"; + echo "CAMPANHA-AGENTS - All users logged into the same campaign as the agent
\n"; + + $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; + $rslt=mysql_query($stmt, $link); + $view_groups_to_print = mysql_num_rows($rslt); + $o=0; + while ($view_groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vgroups_id_value = $rowx[0]; + $vgroups_name_value = $rowx[1]; + echo " $vgroups_id_value - $vgroups_name_value
\n"; + $o++; + } + echo "
 
Ver estado del agente de turno: $NWB#vicidial_user_groups-agent_status_view_time$NWE
Campanhas Permitidas no CQ:
$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
\n"; + echo "$qc_campaigns_list"; + echo "
 
Grupos de Entrada para CQ:
$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
\n"; + echo "$qc_groups_list"; + echo "
 
\n"; + + + ### list of users in this user group + + $active_confs = 0; + $stmt="SELECT user,full_name,user_level,active from vicidial_users where user_group='$user_group'"; + $rsltx=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + echo "
\n"; + echo "
USUÁRIOS DESTE GRUPO: $users_to_print
\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
USERNOME COMPLETONÍVELATIVO
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; + + + echo "

Clique aqui para ver todos os registros de CallBack para este grupo de usuários

\n"; + echo "

Clique aqui para ver o Status de Relógio de ponto para este usuário

\n"; + + if ($LOGdelete_user_groups > 0) + { + echo "

APAGAR ESTE GRUPO DE USUÁRIOS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para este Grupo de usuários
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=3111111 modify script info in the system +###################### + +if ($ADD==3111111) + { + if ($LOGmodify_scripts==1) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; + + $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $script_name = $row[1]; + $script_comments = $row[2]; + $script_text = stripslashes($row[3]); + $active = $row[4]; + echo ""; + + echo "
ALTERAR SCRIPT\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Script: $script_id$NWB#vicidial_scripts-script_name$NWE
Nome do Script: (título do script)$NWB#vicidial_scripts-script_name$NWE
Comentários do Script: $NWB#vicidial_scripts-script_comments$NWE
Ativo: $NWB#vicidial_scripts-active$NWE
Texto do Script:

Pré-Visualizar Script
"; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n"; + + + + echo "


\n"; + echo " CAMPANHAS USING THIS SCRIPT:
\n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id';"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]


\n"; + echo " GRUPOS DE ENTR. USING THIS SCRIPT:
\n"; + echo "\n"; + + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id';"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]


\n"; + echo " LIST OVERRIDES USING THIS SCRIPT:
\n"; + echo "\n"; + + $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id';"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]
\n"; + + + if ($LOGdelete_scripts > 0) + { + echo "

APAGAR ESTE SCRIPT\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para este script\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=31111111 modify filter info in the system +###################### + +if ($ADD==31111111) + { + if ($LOGmodify_filters==1) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; + + $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_comments,lead_filter_sql from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $lead_filter_name = $row[1]; + $lead_filter_comments = $row[2]; + $lead_filter_sql = stripslashes($row[3]); + echo ""; + + echo "
ALTERAR FILTRO\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Filtro:$lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nome do Filtro: (descrição simples do filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Comentários do filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filtro SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; + + ##### get campaigns listing for dynamic pulldown + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + $campaigns_list=''; + + $o=0; + while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "\n"; + $o++; + } + + echo "

"; + echo "
TESTAR A CAMPANHA:
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + if ($LOGdelete_filters > 0) + { + echo "

APAGAR ESTE FILTRO\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para este Filtro\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=321111111 modify call time definition info in the system +###################### + +if ($ADD==321111111) + { + if ($LOGmodify_call_times==1) + { + if ( ($stage=="ADD") and (strlen($state_rule)>0) ) + { + $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $ct_state_call_times = $row[0]; + + if (eregi("\|$",$ct_state_call_times)) + {$ct_state_call_times = "$ct_state_call_times$state_rule\|";} + else + {$ct_state_call_times = "$ct_state_call_times\|$state_rule\|";} + $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + echo "Regra de Estado Adicionada: $state_rule
\n"; + } + if ( ($stage=="REMOVE") and (strlen($state_rule)>0) ) + { + $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $ct_state_call_times = $row[0]; + + $ct_state_call_times = eregi_replace("\|$state_rule\|",'|',$ct_state_call_times); + $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + echo "Regra de Estado Removida: $state_rule
\n"; + } + + $ADD=311111111; + } + else + { + echo "Você não esta autorizado a visualizar esta página. Por favor retorne."; + } + } + + +###################### +# ADD=311111111 modify call time definition info in the system +###################### + +if ($ADD==311111111) + { + if ($LOGmodify_call_times==1) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $ct_srs=1; + $b=0; + $srs_SQL =''; + if (strlen($ct_state_call_times)>2) + { + $state_rules = explode('|',$ct_state_call_times); + $ct_srs = ((count($state_rules)) - 1); + } + echo "\n"; + echo "\n"; + while($ct_srs >= $b) + { + if (strlen($state_rules[$b])>0) + { + $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + echo "\n"; + $srs_SQL .= "'$state_rules[$b]',"; + $srs_state_SQL .= "'$row[0]',"; + } + $b++; + } + if (strlen($srs_SQL)>2) + { + $srs_SQL = "$srs_SQL''"; + $srs_state_SQL = "$srs_state_SQL''"; + $srs_SQL = "where state_call_time_id NOT IN($srs_SQL) and state_call_time_state NOT IN($srs_state_SQL)"; + } + else + {$srs_SQL='';} + $stmt="SELECT state_call_time_id,state_call_time_name from vicidial_state_call_times $srs_SQL order by state_call_time_id;"; + $rslt=mysql_query($stmt, $link); + $sct_to_print = mysql_num_rows($rslt); + $sct_list=''; + + $o=0; + while ($sct_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $sct_list .= "\n"; + $o++; + } + echo "\n"; + echo "\n"; + + echo "
\n"; + echo ""; + + $stmt="SELECT call_time_id,call_time_name,call_time_comments,ct_default_start,ct_default_stop,ct_sunday_start,ct_sunday_stop,ct_monday_start,ct_monday_stop,ct_tuesday_start,ct_tuesday_stop,ct_wednesday_start,ct_wednesday_stop,ct_thursday_start,ct_thursday_stop,ct_friday_start,ct_friday_stop,ct_saturday_start,ct_saturday_stop,ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $call_time_name = $row[1]; + $call_time_comments = $row[2]; + $ct_default_start = $row[3]; + $ct_default_stop = $row[4]; + $ct_sunday_start = $row[5]; + $ct_sunday_stop = $row[6]; + $ct_monday_start = $row[7]; + $ct_monday_stop = $row[8]; + $ct_tuesday_start = $row[9]; + $ct_tuesday_stop = $row[10]; + $ct_wednesday_start = $row[11]; + $ct_wednesday_stop = $row[12]; + $ct_thursday_start = $row[13]; + $ct_thursday_stop = $row[14]; + $ct_friday_start = $row[15]; + $ct_friday_stop = $row[16]; + $ct_saturday_start = $row[17]; + $ct_saturday_stop = $row[18]; + $ct_state_call_times = $row[19]; + + echo ""; + + echo "
ALTERAR UM HOR. DE CHAM.\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Horário de Cham.: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Nome do Horário de Cham.: (descrição curta do horário de chamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentários do Horário de cham.: $NWB#vicidial_call_times-call_time_comments$NWE
Padrão de Início: Padrão de Fim: $NWB#vicidial_call_times-ct_default_start$NWE
Início no Domingo: Fim no Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Segunda: Fim na Segunda: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Terça: Fim na Terça: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Quarta: Fim na Quarta: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Quinta: Fim na Quinta: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Sexta: Fim na Sexta: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início no Sábado: Fim no Sábado: $NWB#vicidial_call_times-ct_sunday_start$NWE
Configuração de Horário de Chamada por estado para este Registro:  
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Add state call time rule:


\n"; + echo "CAMPANHAS QUE USAM ESTE HORÁRIO DE CHAMADA:
\n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]
\n"; + echo "ENTRANTE GROUPS USING THIS CALL TIME:
\n"; + echo "\n"; + + $stmt="SELECT group_id,group_name from vicidial_inbound_groups where call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]
\n"; + echo "

\n"; + + if ($LOGdelete_call_times > 0) + { + echo "

APAGAR ESTA CONFIGURAÇÃO DE HORÁRIO DE CHAMADA\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para este Horário de Chamada\n"; + } + } + else + { + echo "Você não esta autorizado a visualizar esta página. Por favor retorne."; + } + + } + + +###################### +# ADD=3111111111 modify state call time definition info in the system +###################### + +if ($ADD==3111111111) + { + if ($LOGmodify_call_times==1) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo ""; + + $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,state_call_time_comments,sct_default_start,sct_default_stop,sct_sunday_start,sct_sunday_stop,sct_monday_start,sct_monday_stop,sct_tuesday_start,sct_tuesday_stop,sct_wednesday_start,sct_wednesday_stop,sct_thursday_start,sct_thursday_stop,sct_friday_start,sct_friday_stop,sct_saturday_start,sct_saturday_stop from vicidial_state_call_times where state_call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $state_call_time_state =$row[1]; + $call_time_name = $row[2]; + $call_time_comments = $row[3]; + $ct_default_start = $row[4]; + $ct_default_stop = $row[5]; + $ct_sunday_start = $row[6]; + $ct_sunday_stop = $row[7]; + $ct_monday_start = $row[8]; + $ct_monday_stop = $row[9]; + $ct_tuesday_start = $row[10]; + $ct_tuesday_stop = $row[11]; + $ct_wednesday_start = $row[12]; + $ct_wednesday_stop = $row[13]; + $ct_thursday_start = $row[14]; + $ct_thursday_stop = $row[15]; + $ct_friday_start = $row[16]; + $ct_friday_stop = $row[17]; + $ct_saturday_start = $row[18]; + $ct_saturday_stop = $row[19]; + + echo ""; + + echo "
ALTERAR HOR. CHAM. P/ ESTADO
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Horário de Cham.: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
Nome do horário de chamada por estado: (descrição curta do horário de chamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentários do horário de chamada por estado: $NWB#vicidial_call_times-call_time_comments$NWE
Padrão de Início: Padrão de Fim: $NWB#vicidial_call_times-ct_default_start$NWE
Início no Domingo: Fim no Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Segunda: Fim na Segunda: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Terça: Fim na Terça: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Quarta: Fim na Quarta: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Quinta: Fim na Quinta: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início na Sexta: Fim na Sexta: $NWB#vicidial_call_times-ct_sunday_start$NWE
Início no Sábado: Fim no Sábado: $NWB#vicidial_call_times-ct_sunday_start$NWE


\n"; + echo "TEMPOS DE CHAMADA USANDO HORÁRIOS DE CHAMADA POR ESTADO:
\n"; + echo "\n"; + + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]
\n"; + echo "

\n"; + + if ($LOGdelete_call_times > 0) + { + echo "

APAGAR ESTE HORÁRIO DE CHAMADA POR ESTADO\n"; + } + } + else + { + echo "Você não esta autorizado a visualizar esta página. Por favor retorne."; + } + } + + +###################### +# ADD=331111111 modify shift definition info in the system +###################### + +if ($ADD==331111111) + { + if ($LOGmodify_call_times==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where shift_id='$shift_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $shift_name = $row[1]; + $shift_start_time = $row[2]; + $shift_length = $row[3]; + $shift_weekdays = $row[4]; + + $shift_start_hour = substr($shift_start_time,0,2); + $shift_start_min = substr($shift_start_time,2,2); + $shift_length_hour = substr($shift_length,0,2); + $shift_length_min = substr($shift_length,3,2); + $shift_end_hour = ($shift_start_hour + $shift_length_hour); + $shift_end_min = ($shift_start_min + $shift_length_min); + if ($shift_end_min >=60) + { + $shift_end_min = ($shift_end_min - 60); + $shift_end_hour++; + } + if ($shift_end_hour >=24) + { + $shift_end_hour = ($shift_end_hour - 24); + } + $shift_end_hour = sprintf("%02s", $shift_end_hour); + $shift_end_min = sprintf("%02s", $shift_end_min); + $shift_end = "$shift_end_hour$shift_end_min"; + + echo ""; + + echo "
ALTERAR TURNO\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Turno:$shift_id
Nome do Turno: (descrição curta do turno)$NWB#vicidial_shifts-shift_name$NWE
Início do Turno:\n"; + echo "   Final do Turno:\n"; + echo " $NWB#vicidial_shifts-shift_start_time$NWE
Duração do Turno: $NWB#vicidial_shifts-shift_length$NWE
Dias do Turno:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; + echo "Domingo
\n"; + echo "Segunda
\n"; + echo "Terça
\n"; + echo "Quarta
\n"; + echo "Quinta
\n"; + echo "Sexta
\n"; + echo "Sábado
\n"; + echo "
\n"; + + echo "


\n"; + echo "GRUPOS DE USUÁRIO USANDO ESTE TURNO:
\n"; + echo "\n"; + + $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\";"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]
\n"; + echo "

\n"; + + if ($LOGdelete_call_times > 0) + { + echo "

REMOVER ESTE TURNO\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para este Turno\n"; + } + } + else + { + echo "Você não esta autorizado a visualizar esta página. Por favor retorne."; + } + + } + + +###################### +# ADD=31111111111 modify phone record in the system +###################### + +if ($ADD==31111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email from phones where extension='$extension' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + echo "
ALTERAR UM REGISTRO DE RAMAL: $row[1]\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
Extensão do Ramal: $NWB#phones-extension$NWE (Agent Screen Login do Ramal)
Número no Plano de Discagem: (somente dígitos)$NWB#phones-dialplan_number$NWE
Caixa do Correio de Voz: (somente dígitos)$NWB#phones-voicemail_id$NWE
CallerID de Saída: (somente dígitos)$NWB#phones-outbound_cid$NWE
Endereço IP do Ramal: (optional)$NWB#phones-phone_ip$NWE
Endereço IP do Computador: (optional)$NWB#phones-computer_ip$NWE
IP do Servidor: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Senha: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Conta Ativa: $NWB#phones-active$NWE
Tipo de Ramal: $NWB#phones-phone_type$NWE
Nome Completo: $NWB#phones-fullname$NWE
Email: $NWB#phones-email$NWE
Eliminar correo de voz después del email: $NWB#phones-delete_vm_after_email$NWE
Empresa: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Mensagens Novas: $row[14]$NWB#phones-messages$NWE
Mensagens Antigas: $row[15]$NWB#phones-old_messages$NWE
Protocolo do Cliente: $NWB#phones-protocol$NWE
GMT Local: (NÃO ajuste para o horário de verão)$NWB#phones-local_gmt$NWE
Teléfono Anillo de tiempo de espera: $NWB#phones-phone_ring_timeout$NWE
Login do Gerente: $NWB#phones-ASTmgrUSERNAME$NWE
Senha do Gerente: $NWB#phones-ASTmgrSECRET$NWE
Usuário padrão do VICIDIAL: $NWB#phones-login_user$NWE
Senha padrão do VICIDIAL: $NWB#phones-login_pass$NWE
Campanha padrão do VICIDIAL: $NWB#phones-login_campaign$NWE
Exten de Estacionamento: $NWB#phones-park_on_extension$NWE
Exten de Conferência: $NWB#phones-conf_on_extension$NWE
Extensão de estacionamento do VICIDIAL: $NWB#phones-VICIDIAL_park_on_extension$NWE
Arquivo de estacionamento do VICIDIAL: $NWB#phones-VICIDIAL_park_on_filename$NWE
Prefixo de Monitoramento: $NWB#phones-monitor_prefix$NWE
Exten de Gravação: $NWB#phones-recording_exten$NWE
Exten de Correio de Voz Principal: $NWB#phones-voicemail_exten$NWE
Exten de Correio de Voz: $NWB#phones-voicemail_dump_exten$NWE
Contexto do Exten: $NWB#phones-ext_context$NWE
Teléfono Contexto: $NWB#phones-phone_context$NWE
Conf. Archivo Secreto: $NWB#phones-conf_secret$NWE
Canal de envio do DTMF: $NWB#phones-dtmf_send_extension$NWE
Grupo de Saída de Chamadas: $NWB#phones-call_out_number_group$NWE
Localização do Navegador: $NWB#phones-client_browser$NWE
Caminho de Instalação: $NWB#phones-install_directory$NWE
URL do CallerID: $NWB#phones-local_web_callerID_URL$NWE
URL Padrão do VICIDIAL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
Troca de Usuário: $NWB#phones-user_switching_enabled$NWE
Conferências: $NWB#phones-conferencing_enabled$NWE
Hang Up do Admin: $NWB#phones-admin_hangup_enabled$NWE
Captura do Admin: $NWB#phones-admin_hijack_enabled$NWE
Monitoramento do Admin: $NWB#phones-admin_monitor_enabled$NWE
Estacionamento de Chamada: $NWB#phones-call_parking_enabled$NWE
Verificar Atualizador: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Permitir Filas: $NWB#phones-QUEUE_ACTION_enabled$NWE
Popup do CallerID: $NWB#phones-CallerID_popup_enabled$NWE
Botão CxPostal : $NWB#phones-voicemail_button_enabled$NWE
Atualizar Rápido: $NWB#phones-enable_fast_refresh$NWE
Taxa da Atualização Rápida: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Discar próximo número: $NWB#phones-auto_dial_next_number$NWE
Parar de gravar após cada chamada: $NWB#phones-VDstop_rec_after_each_call$NWE
Habilitar Mensagens SIPSAK: $NWB#phones-enable_sipsak_messages$NWE
Servidor do DBX: (Primário DB Server)$NWB#phones-DBX_server$NWE
Base de dados do DBX: (Primário Server Database)$NWB#phones-DBX_database$NWE
Usuário do DBX: (Primário DB Login)$NWB#phones-DBX_user$NWE
Senha do DBX: (Primário DB Secret)$NWB#phones-DBX_pass$NWE
Porta do DBX: (Primário DB Port)$NWB#phones-DBX_port$NWE
Servidor do DBY: (Secundário DB Server)$NWB#phones-DBY_server$NWE
Base de dados do DBY: (Secundário Server Database)$NWB#phones-DBY_database$NWE
Usuário do DBY: (Secundário DB Login)$NWB#phones-DBY_user$NWE
Senha do DBY: (Secundário DB Secret)$NWB#phones-DBY_pass$NWE
Porta do DBY: (Secundário DB Port)$NWB#phones-DBY_port$NWE
ID do Template: $NWB#phones-template_id$NWE
Sobrepor Conf: $NWB#phones-conf_override$NWE
\n"; + + echo "

Clique aqui para statísticas do ramal\n"; + + if ($LOGast_delete_phones > 0) + { + echo "

APAGAR ESTE RAMAL\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=32111111111 modify phone alias record in the system +###################### + +if ($ADD==32111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT alias_id,alias_name,logins_list from phones_alias where alias_id='$alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + echo "
ALTERAR UM ALIAS DE RAMAL: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Alias:$row[0] $NWB#phones-alias_id$NWE
Nome do Alias: $NWB#phones-alias_name$NWE
Phones Logins List: (comma separated)$NWB#phones-logins_list$NWE
\n"; + + + ### list of phones in this phones alias + $phone_alias_SQL = ereg_replace(',',"','",$row[2]); + + echo "
\n"; + echo "
RAMAIS DESTE ALIAS:
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL');"; + if ($DB) {echo "|$stmt|";} + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($lists_to_print > $o) { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
LOGINEXTENSÃOSERVERPROTOCOLIP
$rowx[0]$rowx[1]$rowx[2]$rowx[3]$rowx[4]

\n"; + + if ($LOGast_delete_phones > 0) + { + echo "

REMOVER ESTE ALIAS DE RAMAL\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para este Alias de Ramal
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=33111111111 modify group alias record in the system +###################### + +if ($ADD==33111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias where group_alias_id='$group_alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + echo "
ALTERAR ALIAS DE GRUPO: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Alias: $row[0] $NWB#phones-group_alias_id$NWE
Nome do Alias: $NWB#phones-group_alias_name$NWE
Número CallerID: $NWB#phones-caller_id_number$NWE
Nome CallerID: $NWB#phones-caller_id_name$NWE
Ativo:
\n"; + + + if ($LOGast_delete_phones > 0) + { + echo "

REMOVER ESTE ALIAS DE GRUPO\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para este Alias de Grupo
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=311111111111 modify server record in the system +###################### + +if ($ADD==311111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,local_gmt,voicemail_dump_exten,answer_transfer_agent,ext_context,sys_perf_log,vd_server_logs,agi_output,vicidial_balance_active,balance_trunks_offlimits,recording_web_link,alt_server_ip,active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,outbound_calls_per_second,sysload,channels_total,cpu_idle_percent,disk_usage,sounds_update,vicidial_recording_limit,carrier_logging_active,vicidial_balance_rank,rebuild_music_on_hold,active_agent_login_server,conf_secret from servers where server_id='$server_id' or server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $server_id = $row[0]; + $server_description = $row[1]; + $server_ip = $row[2]; + $active = $row[3]; + $asterisk_version = $row[4]; + $max_vicidial_trunks = $row[5]; + $telnet_host = $row[6]; + $telnet_port = $row[7]; + $ASTmgrUSERNAME = $row[8]; + $ASTmgrSECRET = $row[9]; + $ASTmgrUSERNAMEupdate = $row[10]; + $ASTmgrUSERNAMElisten = $row[11]; + $ASTmgrUSERNAMEsend = $row[12]; + $local_gmt = $row[13]; + $voicemail_dump_exten = $row[14]; + $answer_transfer_agent = $row[15]; + $ext_context = $row[16]; + $sys_perf_log = $row[17]; + $vd_server_logs = $row[18]; + $agi_output = $row[19]; + $vicidial_balance_active = $row[20]; + $balance_trunks_offlimits = $row[21]; + $recording_web_link = $row[22]; + $alt_server_ip = $row[23]; + $active_asterisk_server = $row[24]; + $generate_vicidial_conf = $row[25]; + $rebuild_conf_files = $row[26]; + $outbound_calls_per_second = $row[27]; + $sysload = $row[28]; + $channels_total = $row[29]; + $cpu_idle_percent = $row[30]; + $disk_usage = $row[31]; + $sounds_update = $row[32]; + $vicidial_recording_limit = $row[33]; + $carrier_logging_active = $row[34]; + $vicidial_balance_rank = $row[35]; + $rebuild_music_on_hold = $row[36]; + $active_agent_login_server = $row[37]; + $conf_secret = $row[38]; + + $cpu = (100 - $cpu_idle_percent); + $disk_usage = preg_replace("/ /"," - ",$disk_usage); + $disk_usage = preg_replace("/\|/","%     ",$disk_usage); + + echo "
ALTERAR O REGISTRO DO SERVIDOR: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "
ID do Servidor: $NWB#servers-server_id$NWE
Descrição do Servidor: $NWB#servers-server_description$NWE
Endereço IP do Servidor: $NWB#servers-server_ip$NWE
Ativo: $NWB#servers-active$NWE
Carga do Sistema: $sysload - $cpu%   $NWB#servers-sysload$NWE
Canais Falando: $channels_total   $NWB#servers-channels_total$NWE
Uso do HD: $disk_usage   $NWB#servers-disk_usage$NWE
Versão do Asterisk: $NWB#servers-asterisk_version$NWE
Máx. Trunks no VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
Máx. de Chamadas por Segundo: $NWB#servers-outbound_calls_per_second$NWE
Discagem Balanceada do VICIDIAL: $NWB#servers-vicidial_balance_active$NWE
Balance Vicidial Rango:$NWB#servers-vicidial_balance_rank$NWE
Limite de Balanceamento do VICIDIAL: $NWB#servers-balance_trunks_offlimits$NWE
Host Telnet: $NWB#servers-telnet_host$NWE
Porta Telnet: $NWB#servers-telnet_port$NWE
Usuário do Manager (AMI): $NWB#servers-ASTmgrUSERNAME$NWE
Senha do Gerente: $NWB#servers-ASTmgrSECRET$NWE
Usuário do Atualizador do Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuário de Listen do Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuário de Send do Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Conf. Archivo Secreto: $NWB#servers-conf_secret$NWE
GMT Local: (NÃO ajuste para o horário de verão)$NWB#servers-local_gmt$NWE
Extensão para descarregar Correio de Voz : $NWB#servers-voicemail_dump_exten$NWE
Extensão do AD do VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Contexto Padrão: $NWB#servers-ext_context$NWE
Performance do Sistema: $NWB#servers-sys_perf_log$NWE
Logs do Servidor: $NWB#servers-vd_server_logs$NWE
Saída do AGI: $NWB#servers-agi_output$NWE
Portador de registro activo: $NWB#servers-carrier_logging_active$NWE
Link Web de Gravação: $NWB#servers-recording_web_link$NWE
Alternate Recording IP do Servidor: $NWB#servers-alt_server_ip$NWE
Servidor Asterisk Ativo: $NWB#servers-active_asterisk_server$NWE
Ativo Server Agent: $NWB#servers-active_agent_login_server$NWE
Gerar Arquivos Conf: $NWB#servers-generate_vicidial_conf$NWE
Reconstruir Arquivos Conf: $NWB#servers-rebuild_conf_files$NWE
Volver a generar música en espera: $NWB#servers-rebuild_music_on_hold$NWE
Actualización de los sonidos: $NWB#servers-sounds_update$NWE
Grabación Vicidial Límite: $NWB#servers-vicidial_recording_limit$NWE
\n"; + + + ### vicidial server trunk records for this server + echo "

TRUNKS DO VICIDIAL PARA ESTE SERVIDOR:   $NWB#vicidial_server_trunks$NWE
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT server_ip,campaign_id,dedicated_trunks,trunk_restriction from vicidial_server_trunks where server_ip='$server_ip' order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $recycle_to_print = mysql_num_rows($rslt); + $o=0; + while ($recycle_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
CAMPANHA TRUNKS RESTRIÇÃO DELETE
$rowx[1]
\n"; + echo "\n"; + echo "\n"; + echo "
APAGAR
\n"; + + echo "
INCLUIR TRUNK DO SERVIDOR VICIDIAL
\n"; + echo "\n"; + echo "\n"; + echo "TRUNKS:
\n"; + echo "CAMPANHA:
\n"; + echo "RESTRICTION:
\n"; + echo "
\n"; + + echo "

\n"; + + + ### list of carriers on this server + echo "
\n"; + echo "
OPERADORAS NESTE SERVIDOR:
\n"; + echo "\n"; + echo "\n"; + + $active_carriers = 0; + $inactive_carriers = 0; + $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]'"; + $rsltx=mysql_query($stmt, $link); + $carriers_to_print = mysql_num_rows($rsltx); + $camp_lists=''; + + $o=0; + while ($carriers_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + if (ereg("Y", $rowx[3])) {$active_carriers++;} + if (ereg("N", $rowx[3])) {$inactive_carriers++;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
CARRIER IDNOMEREGISTRATIONATIVO
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; + + + ### list of phones on this server + echo "
\n"; + echo "
RAMAIS DESTE SERVIDOR:
\n"; + echo "\n"; + echo "\n"; + + $active_phones = 0; + $inactive_phones = 0; + $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $camp_lists=''; + + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + if (ereg("Y", $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_phones++;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
EXTENSÃONOMEATIVO
$rowx[0]$rowx[2]$rowx[1]

\n"; + + + ### list of conferences on this server + echo "
\n"; + echo "
CONFERENCES WITHIN THIS SERVER:
\n"; + echo "\n"; + echo "\n"; + + $active_confs = 0; + $stmt="SELECT conf_exten,extension from conferences where server_ip='$row[2]'"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $camp_lists=''; + + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + $active_confs++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
CONFERENCEEXTENSÃO
$rowx[0]$rowx[2]

\n"; + + + ### list of vicidial conferences on this server + echo "
\n"; + echo "
VICIDIAL CONFERENCES WITHIN THIS SERVER:
\n"; + echo "\n"; + echo "\n"; + + $active_vdconfs = 0; + $stmt="SELECT conf_exten,extension from vicidial_conferences where server_ip='$row[2]'"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $camp_lists=''; + + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + $active_vdconfs++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
VD CONFERENCEEXTENSÃO
$rowx[0]$rowx[2]

\n"; + + + echo "
\n"; + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Este servidor tem $active_carriers active carriers and $inactive_carriers inactive carriers

\n"; + echo "Este servidor tem $active_phones ramais ativos e $inactive_phones ramais inativos

\n"; + echo "Este servidor tem $active_confs active conferences

\n"; + echo "Este servidor tem $active_vdconfs active vicidial conferences

\n"; + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

REMOVER ESTE SERVIDOR\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para este Servidor
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=331111111111 modify conf template record in the system +###################### + +if ($ADD==331111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT template_id,template_name,template_contents from vicidial_conf_templates where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $template_id = $row[0]; + $template_name = $row[1]; + $template_contents = $row[2]; + + echo "
ALTERAR UM REGISTRO DE TEMPLATE DE CONF: $row[0]
\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID do Template: $template_id
Nome do Template: $NWB#vicidial_conf_templates-template_name$NWE
Conteúdo do Template: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + + echo "
\n"; + + ### list of phones using this conf template + echo "
\n"; + echo "
RAMAIS USANDO ESTA TEMPLATE DE CONF:
\n"; + echo "\n"; + echo "\n"; + + $active_phones = 0; + $inactive_phones = 0; + $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id'"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $camp_lists=''; + + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + if (ereg("Y", $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_phones++;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
EXTENSÃONOMESERVERATIVO
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; + + ### list of carriers using this conf template + echo "
\n"; + echo "
OPERADORAS USANDO ESTA TEMPLATE DE CONF:
\n"; + echo "\n"; + echo "\n"; + + $active_phones = 0; + $inactive_phones = 0; + $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id'"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $camp_lists=''; + + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + if (ereg("Y", $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_phones++;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
CARRIERNOMESERVERATIVO
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; + + + + if ($LOGast_delete_phones > 0) + { + echo "

REMOVER TEMPLATE DE CONF\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para este template de conf
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=341111111111 modify carrier record in the system +###################### + +if ($ADD==341111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $carrier_id = $row[0]; + $carrier_name = $row[1]; + $registration_string = $row[2]; + $template_id = $row[3]; + $account_entry = $row[4]; + $protocol = $row[5]; + $globals_string = $row[6]; + $dialplan_entry = $row[7]; + $server_ip = $row[8]; + $active = $row[9]; + $carrier_description = $row[10]; + + echo "
ALTERAR OPERADORA: $row[0]\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID da Operadora: $carrier_id
Nome da Operadora: $NWB#vicidial_server_carriers-carrier_name$NWE
Descripción Carrier: $NWB#vicidial_server_carriers-carrier_description$NWE
String de Registro: $NWB#vicidial_server_carriers-registration_string$NWE
ID do Template: $NWB#vicidial_server_carriers-template_id$NWE
Dados da Conta: $NWB#vicidial_server_carriers-account_entry$NWE
Protocolo: $NWB#vicidial_server_carriers-protocol$NWE
String Global: $NWB#vicidial_server_carriers-globals_string$NWE
Plano de Discagem: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP do Servidor: $NWB#vicidial_server_carriers-server_ip$NWE
Ativo: $NWB#vicidial_server_carriers-active$NWE
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

REMOVER OPERADORA\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para esta Operadora
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=351111111111 modify tts record in the system +###################### + +if ($ADD==351111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts where tts_id='$tts_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $tts_id = $row[0]; + $tts_name = $row[1]; + $active = $row[2]; + $tts_text = $row[3]; + + echo "
TTS MODIFICAR UN RECORD: $tts_id\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
TTS ID: $tts_id
Nombre TTS: $NWB#vicidial_tts_prompts-tts_name$NWE
Ativo: $NWB#vicidial_tts_prompts-active$NWE
TTS Texto: $NWB#vicidial_tts_prompts-tts_text$NWE
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

ELIMINAR ESTA ENTRADA TTS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver chages Admin a esta entrada a TTS
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=361111111111 modify music on hold record in the system +###################### + +if ($ADD==361111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where moh_id='$moh_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $moh_id = $row[0]; + $moh_name = $row[1]; + $active = $row[2]; + $random = $row[3]; + + echo "
MODIFY A MUSIC ON HOLD RECORD: $moh_id\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
Música en espera de identificación: $moh_id
Música en espera Nombre: $NWB#vicidial_music_on_hold-moh_name$NWE
Ativo: $NWB#vicidial_music_on_hold-active$NWE
Orden aleatorio: $NWB#vicidial_music_on_hold-random$NWE
Archivos de Audio: \n"; + ##### get files listing for rank/delete options + $stmt="SELECT filename,rank from vicidial_music_on_hold_files where moh_id='$moh_id' order by rank;"; + $rsltx=mysql_query($stmt, $link); + $mohfiles_to_print = mysql_num_rows($rsltx); + $ranks = ($mohfiles_to_print + 2); + $o=0; + while ($mohfiles_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + echo "Rango:\n"; + + echo "   $rowx[0] - APAGAR
\n"; + $o++; + } + + echo "
Añadir un archivo de audio: audio chooser $NWB#vicidial_music_on_hold-filename$NWE
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

DELETE MÚSICA EN ESPERA DE ENTRADA\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver chages de administración para esta música en espera de entrada
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=371111111111 modify voicemail box in the system +###################### + +if ($ADD==371111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $voicemail_id = $row[0]; + $pass = $row[1]; + $fullname = $row[2]; + $active = $row[3]; + $email = $row[4]; + $messages = $row[5]; + $old_messages = $row[6]; + $delete_vm_after_email = $row[7]; + + echo "
MODIFICAR UN contestador: $tts_id\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
ID de correo de voz: $voicemail_id
Senha: $NWB#vicidial_voicemail-pass$NWE
Name: $NWB#vicidial_voicemail-fullname$NWE
Email:$NWB#vicidial_voicemail-email$NWE
Ativo: $NWB#vicidial_voicemail-active$NWE
Eliminar correo de voz después del email: $NWB#vicidial_voicemail-delete_vm_after_email$NWE
Mensagens Novas: $messages
Mensagens Antigas: $old_messages
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

Este mensaje de voz DELETE BOX\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver chages de administración para esta casilla de correo de voz
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=3111111111111 modify conference record in the system +###################### + +if ($ADD==3111111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT conf_exten,server_ip,extension from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $conf_exten = $row[0]; + $server_ip = $row[1]; + + echo "
ALTERAR O REGISTRO DA CONFERÊNCIA: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Conferência: $NWB#conferences-conf_exten$NWE
IP do Servidor: $NWB#conferences-server_ip$NWE
Extensão Atual:
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

REMOVER ESTA CONFERÊNCIA\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=31111111111111 modify vicidial conference record in the system +###################### + +if ($ADD==31111111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT conf_exten,server_ip,extension,leave_3way,leave_3way_datetime from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $conf_exten = $row[0]; + $server_ip = $row[1]; + + echo "
MODIFY A VICIDIAL CONFERENCE RECORD: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Conferência: $NWB#conferences-conf_exten$NWE
IP do Servidor: $NWB#conferences-server_ip$NWE
Extensão Atual:
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

REMOVER ESTA CONFERÊNCIA VICIDIAL\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + +###################### +# ADD=311111111111111 modify vicidial system settings +###################### + +if ($ADD==311111111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform from system_settings;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $version = $row[0]; + $install_date = $row[1]; + $use_non_latin = $row[2]; + $webroot_writable = $row[3]; + $enable_queuemetrics_logging = $row[4]; + $queuemetrics_server_ip = $row[5]; + $queuemetrics_dbname = $row[6]; + $queuemetrics_login = $row[7]; + $queuemetrics_pass = $row[8]; + $queuemetrics_url = $row[9]; + $queuemetrics_log_id = $row[10]; + $queuemetrics_eq_prepend = $row[11]; + $vicidial_agent_disable = $row[12]; + $allow_sipsak_messages = $row[13]; + $admin_home_url = $row[14]; + $enable_agc_xfer_log = $row[15]; + $db_schema_version = $row[16]; + $auto_user_add_value = $row[17]; + $timeclock_end_of_day = $row[18]; + $timeclock_last_reset_date = $row[19]; + $vdc_header_date_format = $row[20]; + $vdc_customer_date_format = $row[21]; + $vdc_header_phone_format = $row[22]; + $vdc_agent_api_active = $row[23]; + $qc_last_pull_time = $row[24]; + $enable_vtiger_integration = $row[25]; + $vtiger_server_ip = $row[26]; + $vtiger_dbname = $row[27]; + $vtiger_login = $row[28]; + $vtiger_pass = $row[29]; + $vtiger_url = $row[30]; + $qc_features_active = $row[31]; + $outbound_autodial_active = $row[32]; + $outbound_calls_per_second = $row[33]; + $enable_tts_integration = $row[34]; + $agentonly_callback_campaign_lock = $row[35]; + $sounds_central_control_active = $row[36]; + $sounds_web_server = $row[37]; + $sounds_web_directory = $row[38]; + $active_voicemail_server = $row[39]; + $auto_dial_limit = $row[40]; + $user_territories_active = $row[41]; + $allow_custom_dialplan = $row[42]; + $db_schema_update_date = $row[43]; + $enable_second_webform = $row[44]; + + echo "
ALTERAR CONFIG. DE SISTEMA DO VICIDIAL\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Versão: $version
DB Schema Versão: $db_schema_version
DB Schema Update Date: $db_schema_update_date
Auto Usuário-add Value: $auto_user_add_value
Data da Instalação: $install_date
Uso Não-Latino: $NWB#settings-use_non_latin$NWE
Raiz Web Gravável: $NWB#settings-webroot_writable$NWE
Mostrar Bloqueio ao Agente VICIDIAL:$NWB#settings-vicidial_agent_disable$NWE
Permitir Mensagens SIPSAK$NWB#settings-allow_sipsak_messages$NWE
URL Home do Admin: $NWB#settings-admin_home_url$NWE
Habilitar Log de Transferências: $NWB#settings-enable_agc_xfer_log$NWE
Relógio Ponto Final do Dia:$NWB#settings-timeclock_end_of_day$NWE
Último Sair Automático do Ponto: $timeclock_last_reset_date
Formato da Data no Cabeçalho da tela do Agente: $NWB#settings-vdc_header_date_format$NWE
Formato da Data do Cliente na tela do Agente: $NWB#settings-vdc_customer_date_format$NWE
Formato do Número do Telefone na tela do Agente: $NWB#settings-vdc_header_phone_format$NWE
API do Agente Ativa:$NWB#settings-vdc_agent_api_active$NWE
Trava para Agendamento Vinculado: $NWB#settings-agentonly_callback_campaign_lock$NWE
Controle Central de Audio Ativado: $NWB#settings-sounds_central_control_active$NWE
Servidor Web de Sons: $NWB#settings-sounds_web_server$NWE
Diretório Web de Sons: $sounds_web_directory $NWB#settings-sounds_web_directory$NWE
Servidor de correo de voz activo: $NWB#settings-active_voicemail_server$NWE
Marcado automático de límite de: $NWB#settings-auto_dial_limit$NWE
Discagem Automática Ativa: $NWB#settings-outbound_autodial_active$NWE
Máx. de Cham. Trasnf. por Segundo: $NWB#settings-outbound_calls_per_second$NWE
Permitir Custom Dialplan entradas: $NWB#settings-allow_custom_dialplan$NWE
Territorios de usuario de Ativo: $NWB#settings-user_territories_active$NWE
Formulario de Asistencia Segunda Habilitar: $NWB#settings-enable_second_webform$NWE
Habilitar TTS Integración: $NWB#settings-enable_tts_integration$NWE
Recursos de CQ Ativos: $NWB#settings-qc_features_active$NWE
Última Hora de Retirada do CQ: $qc_last_pull_time
Habilitar Log para o QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
IP do Servidor QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
Nome do BD do QueueMetrics: $NWB#settings-queuemetrics_dbname$NWE
Login do BD do QueueMetrics: $NWB#settings-queuemetrics_login$NWE
Senha do BD do QueueMetrics: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
ID do Log do QueueMetrics: $NWB#settings-queuemetrics_log_id$NWE
Prefixo QueueMetrics EnterQueue: $NWB#settings-queuemetrics_eq_prepend$NWE
Habilitar Integração com Vtiger: $NWB#settings-enable_vtiger_integration$NWE\n"; + echo "   Clique aqui para sincronizar usuários com o Vtiger\n"; + echo "
IP do Servidor Vtiger: $NWB#settings-vtiger_server_ip$NWE
Vtiger DB Name: $NWB#settings-vtiger_dbname$NWE
Vtiger DB Login: $NWB#settings-vtiger_login$NWE
Vtiger DB Senha: $NWB#settings-vtiger_pass$NWE
URL do Vtiger: $NWB#settings-vtiger_url$NWE
\n"; + echo "\n"; + if ($LOGuser_level >= 9) + { + echo "

Clique aqui para ver as alterações Admin para esta Configuração de sistema
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + + + + +###################### +# ADD=321111111111111 modify vicidial system statuses +###################### + +if ($ADD==321111111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
\n"; + echo "ESTADOS DE VICIDIAL DENTRO DE ESTE SISTEMA:  $NWB#vicidial_statuses$NWE
\n"; + echo "\n"; + echo "\n"; + + ##### get status category listings for dynamic pulldown + $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc"; + $rslt=mysql_query($stmt, $link); + $cats_to_print = mysql_num_rows($rslt); + $cats_list=""; + + $o=0; + while ($cats_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $cats_list .= "\n"; + $catsname_list["$rowx[0]"] = substr($rowx[1],0,20); + $o++; + } + + + $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $AScategory = $rowx[4]; + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
STATUSDESCRIÇÃOSELECT-
ABLE
HUMANO
RESPOSTA
CATEGORIAMODIFY/DELETE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$rowx[0]
\n"; + echo "\n"; + echo "         \n"; + echo "   \n"; + + if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0])) + { + echo "APAGAR\n"; + } + else + { + echo "APAGAR\n"; + } + + echo "
\n"; + + echo "  Sale:   \n"; + echo "  DNC:   \n"; + echo "  Customer Contact:   \n"; + echo "  Not Interested:   \n"; + echo "  Unworkable:   \n"; + + echo "
\n"; + + echo "
INCLUIR STATUS DE SISTEMA
\n"; + echo "\n"; + echo "Status:   \n"; + echo "Descrição:
\n"; + echo "Selecionável:   \n"; + echo "Resposta Humana:   \n"; + echo "Sale:   \n"; + echo "DNC:   \n"; + echo "Customer Contact:  
\n"; + echo "Not Interested:   \n"; + echo "Unworkable:   \n"; + echo "Categoria:\n"; + echo "  
\n"; + echo "
\n"; + + echo "

\n"; + + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + + + +###################### +# ADD=331111111111111 modify vicidial status categories +###################### + +if ($ADD==331111111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
\n"; + echo "VICIDIAL CATEGORIA DE STATUS:   $NWB#vicidial_status_categories$NWE
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT vsc_id,vsc_name,vsc_description,tovdad_display,sale_category,dead_lead_category from vicidial_status_categories order by vsc_id;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Avsc_id[$o] = $rowx[0]; + $Avsc_name[$o] = $rowx[1]; + $Avsc_description[$o] = $rowx[2]; + $Atovdad_display[$o] = $rowx[3]; + $Asale_category[$o] = $rowx[4]; + $Adead_lead_category[$o] = $rowx[5]; + $o++; + } + $p=0; + while ($o > $p) + { + if (eregi("1$|3$|5$|7$|9$", $p)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CATstatuses=''; + $stmt="SELECT status from vicidial_statuses where category='$Avsc_id[$p]' order by status;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $CATstatuses.=" $rowx[0]"; + $q++; + } + $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' order by status;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $q=0; + while ($statuses_to_print > $q) + { + $rowx=mysql_fetch_row($rslt); + $CATstatuses.=" $rowx[0]"; + $q++; + } + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $p++; + } + + echo "
CATEGORIANOMESTATUS NESTA CATEGORIA
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$Avsc_id[$p]
\n"; + echo "$CATstatuses"; + echo "
TO VDAD Mostrar:     Categoria de Venda:     Categoria de Registro Ruim:  
Descrição:
        \n"; + echo "   APAGAR
 
\n"; + + echo "
INCLUIR CATEG. DE STATUS
\n"; + echo "\n"; + echo "Category ID:   \n"; + echo "Name:  
\n"; + echo "TimeOnVDAD Mostrar:   \n"; + echo "Categoria de Venda:   \n"; + echo "Categoria de Registro Ruim:  
\n"; + echo "Descrição:   \n"; + echo "
\n"; + + echo "

\n"; + + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + + + +###################### +# ADD=341111111111111 modify vicidial QC status code +###################### + +if ($ADD==341111111111111) + { + if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) + { + echo "
\n"; + echo ""; + + echo "
\n"; + echo "CÓDIGOS DE STATUS DE CQ NESTE SISTEMA VICIDIAL:  $NWB#vicidial_qc_status_codes$NWE
\n"; + echo "\n"; + echo "\n"; + + ##### go through each QC status code + $stmt="SELECT count(*) from vicidial_qc_codes;"; + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] > 0) + { + $stmt="SELECT code,code_name from vicidial_qc_codes order by code;"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $o=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + } + } + echo "
STATUS CODEDESCRIÇÃOMODIFY/DELETE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$rowx[0]
        \n"; + echo "   \n"; + + if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0])) + { + echo "APAGAR\n"; + } + else + { + echo "APAGAR\n"; + } + echo "
\n"; + + echo "
INCLUIR CÓDIGO DE CQ
\n"; + echo "\n"; + echo "Status:   \n"; + echo "Descrição:
\n"; + echo "
\n"; + + echo "

\n"; + + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + + + + + +###################### +# ADD=550 user search form +###################### + +if ($ADD==550) + { + echo "
\n"; + echo ""; + + echo "
PESQUISAR USUÁRIO
\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Número do usuário:
Nome Completo:
Nível do Usuário:
Grupo do Usuário:
\n"; + } + +###################### +# ADD=660 user search results +###################### + +if ($ADD==660) + { + echo "
\n"; + echo ""; + + $SQL = ''; + if ($user) {$SQL .= " user LIKE \"%$user%\" and";} + if ($full_name) {$SQL .= " full_name LIKE \"%$full_name%\" and";} + if ($user_level > 0) {$SQL .= " user_level LIKE \"%$user_level%\" and";} + if ($user_group) {$SQL .= " user_group = '$user_group' and";} + $SQL = eregi_replace(" and$", "", $SQL); + if (strlen($SQL)>5) {$SQL = "and $SQL";} + + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts from vicidial_users where user_level <= $LOGuser_level $SQL order by full_name desc;"; +# echo "\n|$stmt|\n"; + $rslt=mysql_query($stmt, $link); + $people_to_print = mysql_num_rows($rslt); + + echo "
RESULTADOS DA PESQUISA:\n"; + echo "
\n"; + + $o=0; + while ($people_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo "\n"; + $o++; + } + + echo "
$row[1]$row[3]$row[4]$row[5]ALTERAR | ESTATÍSTICAS | STATUS | TIME
\n"; + + } + + +###################################################################################################### +###################################################################################################### +####### 8 series, Callback lists +###################################################################################################### +###################################################################################################### + +###################### +# ADD=8 find all callbacks on hold by a User +###################### +if ($ADD==8) + { + if ($LOGmodify_users==1) + { + if ($SUB==89) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user='$user' and status IN('LIVE','ACTIVE') and callback_time < '$past_month_date';"; + $rslt=mysql_query($stmt, $link); + echo "
Usuário($user) callback listings LIVE for more than one month have been made INACTIVE\n"; + } + if ($SUB==899) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user='$user' and status IN('LIVE','ACTIVE') and callback_time < '$past_week_date';"; + $rslt=mysql_query($stmt, $link); + echo "
Usuário($user) callback listings LIVE for more than one week have been made INACTIVE\n"; + } + } + $CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this user
Remove LIVE Callbacks older than one week for this user
"; + + echo ""; + + $CBquerySQLwhere = "and user='$user'"; + + echo "
USER CALLBACK HOLD LISTINGS: $user\n"; + $oldADD = "ADD=8&user=$user"; + $ADD='82'; + } + +###################### +# ADD=81 find all callbacks on hold within a Campaign +###################### +if ($ADD==81) + { + if ($LOGmodify_campaigns==1) + { + if ($SUB==89) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where campaign_id='$campaign_id' and status IN('LIVE','ACTIVE') and callback_time < '$past_month_date';"; + $rslt=mysql_query($stmt, $link); + echo "
campaign($campaign_id) callback listings LIVE for more than one month have been made INACTIVE\n"; + } + if ($SUB==899) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where campaign_id='$campaign_id' and status IN('LIVE','ACTIVE') and callback_time < '$past_week_date';"; + $rslt=mysql_query($stmt, $link); + echo "
campaign($campaign_id) callback listings LIVE for more than one week have been made INACTIVE\n"; + } + } + $CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this campaign
Remove LIVE Callbacks older than one week for this campaign
"; + + echo ""; + + $CBquerySQLwhere = "and campaign_id='$campaign_id'"; + + echo "
CAMPANHA CALLBACK HOLD LISTINGS: $campaign_id\n"; + $oldADD = "ADD=81&campaign_id=$campaign_id"; + $ADD='82'; + } + +###################### +# ADD=811 find all callbacks on hold within a List +###################### +if ($ADD==811) + { + if ($LOGmodify_lists==1) + { + if ($SUB==89) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where list_id='$list_id' and status IN('LIVE','ACTIVE') and callback_time < '$past_month_date';"; + $rslt=mysql_query($stmt, $link); + echo "
list($list_id) callback listings LIVE for more than one month have been made INACTIVE\n"; + } + if ($SUB==899) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where list_id='$list_id' and status IN('LIVE','ACTIVE') and callback_time < '$past_week_date';"; + $rslt=mysql_query($stmt, $link); + echo "
list($list_id) callback listings LIVE for more than one week have been made INACTIVE\n"; + } + } + $CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this list
Remove LIVE Callbacks older than one week for this list
"; + + echo ""; + + $CBquerySQLwhere = "and list_id='$list_id'"; + + echo "
LIST CALLBACK HOLD LISTINGS: $list_id\n"; + $oldADD = "ADD=811&list_id=$list_id"; + $ADD='82'; + } + +###################### +# ADD=8111 find all callbacks on hold within a user group +###################### +if ($ADD==8111) + { + if ($LOGmodify_usergroups==1) + { + if ($SUB==89) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user_group='$user_group' and status IN('LIVE','ACTIVE') and callback_time < '$past_month_date';"; + $rslt=mysql_query($stmt, $link); + echo "
user group($user_group) callback listings LIVE for more than one month have been made INACTIVE\n"; + } + if ($SUB==899) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user_group='$user_group' and status IN('LIVE','ACTIVE') and callback_time < '$past_week_date';"; + $rslt=mysql_query($stmt, $link); + echo "
user group($user_group) callback listings LIVE for more than one week have been made INACTIVE\n"; + } + } + $CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this user group
Remove LIVE Callbacks older than one week for this user group
"; + + echo ""; + + $CBquerySQLwhere = "and user_group='$user_group'"; + + echo "
GRUPO DE USUÁRIOS CALLBACK HOLD LISTINGS: $list_id\n"; + $oldADD = "ADD=8111&user_group=$user_group"; + $ADD='82'; + } + +###################### +# ADD=82 display all callbacks on hold +###################### +if ($ADD==82) + { + $USERlink='stage=USERIDDOWN'; + $GROUPlink='stage=GROUPDOWN'; + $ENDATElink='stage=ENDATEDOWN'; + $SQLorder='order by '; + if (eregi("USERIDDOWN",$stage)) {$SQLorder='order by user desc,'; $USERlink='stage=USERIDUP';} + if (eregi("GROUPDOWN",$stage)) {$SQLorder='order by user_group desc,'; $NAMElink='stage=NAMEUP';} + if (eregi("ENDATEDOWN",$stage)) {$SQLorder='order by entry_time desc,'; $NÍVELlink='stage=NÍVELUP';} + + $stmt="SELECT callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where status IN('ACTIVE','LIVE') $CBquerySQLwhere $SQLorder recipient,status desc,callback_time"; + $rslt=mysql_query($stmt, $link); + $cb_to_print = mysql_num_rows($rslt); + + echo "
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($cb_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
LEADLIST CAMPANHAENTRY DATACALLBACK DATAUSERRECIPIENTSTATUSGROUP
$row[1]$row[2]$row[3]$row[5]$row[6]$row[8]$row[9]$row[4]$row[11]
\n"; + + echo "$CBinactiveLINK"; + } + + + +###################################################################################################### +###################################################################################################### +####### 0 series, displays and searches +###################################################################################################### +###################################################################################################### + +###################### +# ADD=0 display all active users +###################### +if ($ADD==0) + { + echo "
\n"; + echo ""; + echo "
LISTA DE USUÁRIOS: "; + if (ereg('display_all',$status)) + { + $SQLstatus = ''; + echo "   mostrar somente usuários ativos\n"; + } + else + { + $SQLstatus = "and active='Y'"; + echo "   mostrar todos usuários\n"; + } + + $USERlink='stage=USERIDDOWN'; + $NAMElink='stage=NAMEDOWN'; + $NÍVELlink='stage=NÍVELDOWN'; + $GROUPlink='stage=GROUPDOWN'; + $SQLorder='order by full_name'; + if (eregi("USERIDUP",$stage)) {$SQLorder='order by user asc'; $USERlink='stage=USERIDDOWN';} + if (eregi("USERIDDOWN",$stage)) {$SQLorder='order by user desc'; $USERlink='stage=USERIDUP';} + if (eregi("NAMEUP",$stage)) {$SQLorder='order by full_name asc'; $NAMElink='stage=NAMEDOWN';} + if (eregi("NAMEDOWN",$stage)) {$SQLorder='order by full_name desc'; $NAMElink='stage=NAMEUP';} + if (eregi("NÍVELUP",$stage)) {$SQLorder='order by user_level asc'; $NÍVELlink='stage=NÍVELDOWN';} + if (eregi("NÍVELDOWN",$stage)) {$SQLorder='order by user_level desc'; $NÍVELlink='stage=NÍVELUP';} + if (eregi("GROUPUP",$stage)) {$SQLorder='order by user_group asc'; $GROUPlink='stage=GROUPDOWN';} + if (eregi("GROUPDOWN",$stage)) {$SQLorder='order by user_group desc'; $GROUPlink='stage=GROUPUP';} + $stmt="SELECT user,full_name,user_level,user_group,active from vicidial_users where user_level <= $LOGuser_level $SQLstatus $SQLorder"; + $rslt=mysql_query($stmt, $link); + $people_to_print = mysql_num_rows($rslt); + + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($people_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
ID DO USUÁRIONOME COMPLETONÍVELGROUPATIVOLINKS
$row[0]$row[1]$row[2]$row[3]$row[4]
ALTERAR | ESTATÍSTICAS | STATUS | TIME
\n"; + } + +###################### +# ADD=10 display all campaigns +###################### +if ($ADD==10) + { + echo "
\n"; + echo ""; + + $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + echo "
LISTA DE CAMPANHAS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "\n"; + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "\n"; + $o++; + } + + echo "
ID
NOME
ACTIVE   MÉTODO DE DISC.   NÍVEL   ORDEM DOS REG.   STATUS DE DISC.   ALTERAR
$row[0]   $row[1]   $row[2]   $row[3]   $row[4]   $row[5]   $row[6]ALTERAR
\n"; + } + + +###################### +# ADD=100 display all lists +###################### +if ($ADD==100) + { + echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPANHAlink='stage=CAMPANHADOWN'; + $CALLDATElink='stage=CALLDATEDOWN'; + $SQLorder='order by list_id'; + if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} + if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} + if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} + if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} + if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} + if (eregi("ACTIVEDOWN",$stage)) {$SQLorder='order by active desc'; $ACTIVElink='stage=ACTIVEUP';} + if (eregi("CAMPANHAUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPANHAlink='stage=CAMPANHADOWN';} + if (eregi("CAMPANHADOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPANHAlink='stage=CAMPANHAUP';} + if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} + if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id group by list_id $SQLorder"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + echo "
LISTAS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + + $lists_printed = ''; + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $lists_printed .= "'$row[0]',"; + $o++; + } + + $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'');"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
ID DA LISTANOME DA LISTADESCRIÇÃORTIMETOTAL DE REG.ATIVOÚLTIMA CHAMADACAMPANHAALTERAR
$row[0] $row[1] $row[2] $row[7] $row[3] $row[4] $row[5] $row[6]ALTERAR
$row[0] $row[1] $row[2] $row[7] $row[3] $row[4] $row[5] $row[6]ALTERAR
\n"; + } + + + +###################### +# ADD=1000 display all inbound groups +###################### +if ($ADD==1000) + { + echo "
\n"; + echo ""; + + $stmt="SELECT group_id,group_name,queue_priority,active,call_time_id,group_color from vicidial_inbound_groups order by group_id"; + $rslt=mysql_query($stmt, $link); + $ingroups_to_print = mysql_num_rows($rslt); + + echo "
LISTA DE GRUPOS DE ENTRADA:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($ingroups_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
IN-GROUPNOMEPRIORIDADEATIVOTIMECOLORALTERAR
$row[0] $row[1] $row[2] $row[3] $row[4]  ALTERAR
\n"; + } + + +###################### +# ADD=1300 display all inbound dids +###################### +if ($ADD==1300) + { + echo "
\n"; + echo ""; + + $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route from vicidial_inbound_dids order by did_pattern"; + $rslt=mysql_query($stmt, $link); + $dids_to_print = mysql_num_rows($rslt); + + echo "
ENTRANTE DID LISTINGS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($dids_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
#DIDDESCRIÇÃOATIVOROUTEALTERAR
$row[0] $row[1] $row[2] $row[3] $row[4]ALTERAR
\n"; + } + + +###################### +# ADD=1500 display all call menus +###################### +if ($ADD==1500) + { + echo "
\n"; + echo ""; + + $stmt="SELECT menu_id,menu_name,menu_prompt,menu_timeout from vicidial_call_menu order by menu_id"; + $rslt=mysql_query($stmt, $link); + $menus_to_print = mysql_num_rows($rslt); + + echo "
LISTA DE MENUS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + $menu_id = $MT; + + while ($menus_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $menu_id[$o] = $row[0]; + $menu_name[$o] = $row[1]; + $menu_prompt[$o] = $row[2]; + $menu_timeout[$o] = $row[3]; + $o++; + } + + $o=0; + while ($menus_to_print > $o) + { + $stmt="SELECT count(*) from vicidial_call_menu_options where menu_id=\"$menu_id[$o]\";"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
MENU IDNOMEPROMPTTIMEOUTOPTIONSALTERAR
$menu_id[$o] $menu_name[$o] $menu_prompt[$o] $menu_timeout[$o] $row[0]ALTERAR
\n"; + } + + +###################### +# ADD=10000 display all remote agents +###################### +if ($ADD==10000) + { + echo "
\n"; + echo ""; + + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + $rslt=mysql_query($stmt, $link); + $remoteagents_to_print = mysql_num_rows($rslt); + + echo "
LISTA DE AGENTES REMOTOS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($remoteagents_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
USERLINESSERVIDOR   CONF-EXTEN   STATUS   CAMPANHA   ALTERAR
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6]ALTERAR
\n"; + } + + +###################### +# ADD=100000 display all user groups +###################### +if ($ADD==100000) + { + echo "\n"; echo "
\n"; + echo ""; + + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; + $rslt=mysql_query($stmt, $link); + $usergroups_to_print = mysql_num_rows($rslt); + + echo "
GRUPOS DE USUÁRIOS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($usergroups_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
GRUPO DE USUÁRIOSNOME DO GRUPOFORÇAR PONTO   ALTERAR
$row[0] $row[1] $row[2]ALTERAR
\n"; + } + + +###################### +# ADD=1000000 display all scripts +###################### +if ($ADD==1000000) + { + echo "\n"; echo "\n"; +echo "
\n"; + echo ""; + + $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; + $rslt=mysql_query($stmt, $link); + $scripts_to_print = mysql_num_rows($rslt); + + echo "
LISTA DE SCRIPTS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($scripts_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
ID DO SCRIPTNOME DO SCRIPTACTIVE   ALTERAR
$row[0] $row[1] $row[2]ALTERAR
\n"; + } + + +###################### +# ADD=10000000 display all filters +###################### +if ($ADD==10000000) + { + echo "\n"; echo "
\n"; + echo ""; + + $stmt="SELECT lead_filter_id,lead_filter_name from vicidial_lead_filters order by lead_filter_id"; + $rslt=mysql_query($stmt, $link); + $filters_to_print = mysql_num_rows($rslt); + + echo "
Listagem de Filtros de Registro:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($filters_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
FILTER IDFILTER NAMEALTERAR
$row[0] $row[1]ALTERAR
\n"; + } + + +###################### +# ADD=100000000 display all call times +###################### +if ($ADD==100000000) + { + echo "\n"; echo "\n"; +echo "
\n"; + echo ""; + + $stmt="SELECT call_time_id,call_time_name,ct_default_start,ct_default_stop from vicidial_call_times order by call_time_id"; + $rslt=mysql_query($stmt, $link); + $calltimes_to_print = mysql_num_rows($rslt); + + echo "
LISTAGEM DE HORÁRIOS DE CHAMADA:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($calltimes_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
ID DO HORÁRIONOME DO HORÁRIOINÍCIO PADRÃOFIM PADRÃOALTERAR
$row[0] $row[1] $row[2] $row[3] ALTERAR
\n"; + } + +###################### +# ADD=1000000000 display all state call times +###################### +if ($ADD==1000000000) + { + echo "\n"; echo "
\n"; + echo ""; + + $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,sct_default_start,sct_default_stop from vicidial_state_call_times order by state_call_time_id"; + $rslt=mysql_query($stmt, $link); + $statecalltimes_to_print = mysql_num_rows($rslt); + + echo "
LISTAGEM DE HORÁRIOS DE CHAMADA POR ESTADO:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($statecalltimes_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
ID DO HORÁRIOCALLTIME STATENOME DO HORÁRIOINÍCIO PADRÃOFIM PADRÃOALTERAR
$row[0] $row[1] $row[2] $row[3] $row[4] ALTERAR
\n"; + } + +###################### +# ADD=130000000 display all shifts +###################### +if ($ADD==130000000) + { + echo "\n"; echo "\n"; +echo "
\n"; + echo ""; + + $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts order by shift_id"; + $rslt=mysql_query($stmt, $link); + $shifts_to_print = mysql_num_rows($rslt); + + echo "
LISTA DE TURNOS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($shifts_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
ID DO TURNONOME DO TURNOINÍCIO DO TURNOFIM DO TURNOSEMANALALTERAR
$row[0] $row[1] $row[2] $row[3] $row[4] ALTERAR
\n"; + } + +###################### +# ADD=10000000000 display all phones +###################### +if ($ADD==10000000000) + { + echo "\n"; echo "
\n"; + echo ""; + + $EXTENlink='stage=EXTENDOWN'; + $PROTOlink='stage=PROTODOWN'; + $SERVERlink='stage=SERVERDOWN'; + $STATUSlink='stage=STATUSDOWN'; + $SQLorder='order by extension,server_ip'; + if (eregi("EXTENUP",$stage)) {$SQLorder='order by extension asc'; $EXTENlink='stage=EXTENDOWN';} + if (eregi("EXTENDOWN",$stage)) {$SQLorder='order by extension desc'; $EXTENlink='stage=EXTENUP';} + if (eregi("PROTOUP",$stage)) {$SQLorder='order by protocol asc'; $PROTOlink='stage=PROTODOWN';} + if (eregi("PROTODOWN",$stage)) {$SQLorder='order by protocol desc'; $PROTOlink='stage=PROTOUP';} + if (eregi("SERVERUP",$stage)) {$SQLorder='order by server_ip asc'; $SERVERlink='stage=SERVERDOWN';} + if (eregi("SERVERDOWN",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink='stage=SERVERUP';} + if (eregi("STATUSUP",$stage)) {$SQLorder='order by status asc'; $STATUSlink='stage=STATUSDOWN';} + if (eregi("STATUSDOWN",$stage)) {$SQLorder='order by status desc'; $STATUSlink='stage=STATUSUP';} + $stmt="SELECT extension,protocol,server_ip,dialplan_number,voicemail_id,status,fullname,messages,old_messages from phones $SQLorder"; + $rslt=mysql_query($stmt, $link); + $phones_to_print = mysql_num_rows($rslt); + + echo "
LISTA DE RAMAIS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($phones_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo " + + + + + + + + "; + echo "\n"; + $o++; + } + + echo "
EXTENPROTOSERVERPLANO DE DISC.STATUSNOMEVMAILLINKS
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]ALTERAR | ESTATÍSTICAS
\n"; + } + +###################### +# ADD=12000000000 display all phones alias +###################### +if ($ADD==12000000000) + { + echo "\n"; echo "\n"; +echo "
\n"; + echo ""; + + $stmt="SELECT alias_id,alias_name,logins_list from phones_alias order by alias_id;"; + $rslt=mysql_query($stmt, $link); + $phonealias_to_print = mysql_num_rows($rslt); + + echo "
LISTAGEM DE ALIAS DE RAMAL:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($phonealias_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
ID DO ALIASNOME DO ALIASLISTA DE LOGINS DE RAMALALTERAR
$row[0]$row[1]$row[2]ALTERAR
\n"; + } + +###################### +# ADD=13000000000 display all group alias +###################### +if ($ADD==13000000000) + { + echo "
\n"; + echo ""; + + $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias order by group_alias_id;"; + $rslt=mysql_query($stmt, $link); + $phonealias_to_print = mysql_num_rows($rslt); + + echo "
LISTAS DE ALIAS DE GRUPO:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($phonealias_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
ID DO ALIAS DE GRUPONOME DO ALIAS DE GRUPONÚMERO CIDNOME CIDATIVOALTERAR
$row[0]$row[1]$row[2]$row[3]$row[4]ALTERAR
\n"; + } + +###################### +# ADD=100000000000 display all servers +###################### +if ($ADD==100000000000) + { + echo "
\n"; + echo ""; + + $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,local_gmt from servers order by server_id"; + $rslt=mysql_query($stmt, $link); + $servers_to_print = mysql_num_rows($rslt); + + echo "
LISTA DE SERVIDORES:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($servers_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
SERVIDOR IDNOMESERVIDOR IPATIVOASTERISKTRUNKSGMTALTERAR
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]ALTERAR
\n"; + } + +###################### +# ADD=130000000000 display all conf templates +###################### +if ($ADD==130000000000) + { + echo ""; echo ""; + + ### Log search + echo "
\n"; + echo "
"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo "
\n"; + echo ""; + + $stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id"; + $rslt=mysql_query($stmt, $link); + $templates_to_print = mysql_num_rows($rslt); + + echo "
LISTA DAS TEMPLATES DE CONF:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($templates_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
ID do TemplateNome do TemplateALTERAR
$row[0]$row[1]ALTERAR
\n"; + } + +###################### +# ADD=140000000000 display all carriers +###################### +if ($ADD==140000000000) + { + echo "
\n"; + echo ""; + + $stmt="SELECT carrier_id,carrier_name,server_ip,protocol,registration_string,active from vicidial_server_carriers order by carrier_id"; + $rslt=mysql_query($stmt, $link); + $carriers_to_print = mysql_num_rows($rslt); + + echo "
LISTAS DAS OPERADORAS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($carriers_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
ID da OperadoraNome da OperadoraIP do ServidorProtocolRegistroAtivoALTERAR
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]ALTERAR
\n"; + } + + +###################### +# ADD=150000000000 display all tts entries +###################### +if ($ADD==150000000000) + { + echo "
\n"; + echo ""; + + $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts order by tts_id"; + $rslt=mysql_query($stmt, $link); + $tts_to_print = mysql_num_rows($rslt); + + echo "
TEXT-TO-SPEECH(TTS) LISTINGS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($tts_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $row[3]=ereg_replace(";|<|>","",$row[3]); + while(strlen($row[3]) > 50) {$row[3] = substr("$row[3]", 0, -1);} + if(strlen($row[3]) > 47) {$row[3] = "$row[3]...";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
TTS IDNombre TTSAtivoTTS TextoALTERAR
$row[0]$row[1]$row[2]$row[3]ALTERAR
\n"; + } + + +###################### +# ADD=160000000000 display all music on hold entries +###################### +if ($ADD==160000000000) + { + echo ""; echo ""; + + ### Log search + echo "
\n"; + echo "
"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo "
\n"; + echo ""; + + $stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where remove='N' order by moh_id"; + $rslt=mysql_query($stmt, $link); + $moh_to_print = mysql_num_rows($rslt); + + echo "
MUSIC-ON-HOLD(MOH) LISTINGS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($moh_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $row[3]=ereg_replace(";|<|>","",$row[3]); + while(strlen($row[3]) > 50) {$row[3] = substr("$row[3]", 0, -1);} + if(strlen($row[3]) > 47) {$row[3] = "$row[3]...";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
MOH IDMOH NameAtivoOrden aleatorioALTERAR
$row[0]$row[1]$row[2]$row[3]ALTERAR
\n"; + } + + +###################### +# ADD=170000000000 display all voicemail entries +###################### +if ($ADD==170000000000) + { + echo "
\n"; + echo ""; + + $stmt="SELECT voicemail_id,fullname,active,messages,old_messages,delete_vm_after_email from vicidial_voicemail order by voicemail_id"; + $rslt=mysql_query($stmt, $link); + $vm_to_print = mysql_num_rows($rslt); + + echo "
CAJAS DE CORREO DE VOZ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($vm_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
VOICEMAIL IDNameAtivoMensagens NovasMensagens AntigasDeleteALTERAR
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]ALTERAR
\n"; + } + + +###################### +# ADD=1000000000000 display all conferences +###################### +if ($ADD==1000000000000) + { + echo "
\n"; + echo ""; + + $stmt="SELECT conf_exten,server_ip,extension from conferences order by conf_exten"; + $rslt=mysql_query($stmt, $link); + $conferences_to_print = mysql_num_rows($rslt); + + echo "
LISTA DE CONFERÊNCIAS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($conferences_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
CONFERENCESERVIDOR IPEXTENSÃOALTERAR
$row[0]$row[1]$row[2]ALTERAR
\n"; + } + +###################### +# ADD=10000000000000 display all vicidial conferences +###################### +if ($ADD==10000000000000) + { + echo ""; echo ""; + + ### Log search + echo "
\n"; + echo "
"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo "
\n"; + echo ""; + + $stmt="SELECT conf_exten,server_ip,extension from vicidial_conferences order by conf_exten"; + $rslt=mysql_query($stmt, $link); + $vicidialconf_to_print = mysql_num_rows($rslt); + + echo "
VICIDIAL LISTA DE CONFERÊNCIAS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($vicidialconf_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
CONFERENCESERVIDOR IPEXTENSÃOALTERAR
$row[0] $row[1] $row[2]ALTERAR
\n"; + } + + + + + +###################### +# ADD=700000000000000 view all activity in the admin log +###################### + +if ($ADD==700000000000000) + { + echo "
\n"; + echo ""; + + if ($stage > 9999) + { + $next_limit = ($stage + 10000); + $limitSQL = "10000 offset $stage"; + } + else + { + $next_limit = "10000"; + $limitSQL = "10000"; + } + + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log order by event_date desc limit $limitSQL;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
LOG DE ALT. ADMIN: (Últimos 10000 registros)\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPANHA',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIÇÃOGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


\n"; + echo "NEXT\n"; + echo "
\n"; + } + + +###################### +# ADD=710000000000000 view all activity in the admin log made by one user +###################### + +if ($ADD==710000000000000) + { + echo "\n";echo "\n"; +$stmt="SELECT admin_home_url,enable_tts_integration from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$admin_home_url_LU = $row[0]; +$SSenable_tts_integration = $row[1]; + +?> +
+ +
\n"; + echo ""; + + $stmt="SELECT full_name from vicidial_users where user='$stage';"; + $rslt=mysql_query($stmt, $link); + $names_to_print = mysql_num_rows($rslt); + if ($names_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $user_name = $row[0]; + } + + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where user='$stage' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
LOG DE ALT. ADMIN: Alterado por $stage - $user_name\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPANHA',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIÇÃOGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


\n"; + echo "\n"; + echo "
\n"; + } + + +###################### +# ADD=720000000000000 view all activity in the admin log made to one section/value +###################### + +if ($ADD==720000000000000) + { + if ($LOGuser_level >= 9) + { + echo "\n"; +echo "
\n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + echo "
LOG DE ALT. ADMIN: Registros de Seção - $category - $stage\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPANHA',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIÇÃOGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


\n"; + echo "\n"; + echo "
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=730000000000000 detail view of one admin log entry +###################### + +if ($ADD==730000000000000) + { + if ($LOGuser_level >= 9) + { + echo "
\n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
LOG DE ALT. ADMIN: Detalhes do Reg. - $stage

\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + $row[9] = eregi_replace("',","' ,",$row[9]); + $row[9] = preg_replace("/\|/","
",$row[9]); + echo ""; + echo ""; + echo "\n"; + echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; + echo "\n"; + echo "
\n"; + } + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +###################### +# ADD=999999 display reports section +###################### +if ($ADD==999999) + { + if ($LOGview_reports==1) + { + echo "
\n"; + echo ""; + + $stmt="select server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers order by server_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $servers_to_print = mysql_num_rows($rslt); + $i=0; + while ($i < $servers_to_print) + { + $row=mysql_fetch_row($rslt); + $server_id[$i] = $row[0]; + $server_description[$i] = $row[1]; + $server_ip[$i] = $row[2]; + $active[$i] = $row[3]; + $sysload[$i] = $row[4]; + $channels_total[$i] = $row[5]; + $cpu_idle_percent[$i] = $row[6]; + $disk_usage[$i] = $row[7]; + $i++; + } + + $stmt="SELECT queuemetrics_url,vtiger_url from system_settings;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; + + $stmt="SELECT count(*) from vicidial_list_update_log;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $list_update_count = $row[0]; + ?> + + + + + + Estatísticas do Servidor e Relatórios + Estatísticas do Servidor e Relatórios

+
+       + + Tempo Real Relatórios
+
+ Inbound and Outbound Calling Relatórios
+ + +
+       + + Agent Relatórios
+
+ Time Clock Relatórios
+
+ Other Relatórios and Links
+ +
+ + +

+		
+		 $o)
+			{
+			$cpu = (100 - $cpu_idle_percent[$o]);
+			$disk = '';
+			$disk_ary = explode('|',$disk_usage[$o]);
+			$disk_ary_ct = count($disk_ary);
+			$k=0;
+			while ($k < $disk_ary_ct)
+				{
+				$disk_ary[$k] = preg_replace("/^\d* /","",$disk_ary[$k]);
+				if ($k<1) {$disk = "$disk_ary[$k]";}
+				else
+					{
+					if ($disk_ary[$k] > $disk) {$disk = "$disk_ary[$k]";}
+					}
+				$k++;
+				}
+			$disk = "$disk%";
+			echo "\n";
+			echo "\n";
+			echo "\n";
+			echo "\n";
+			echo "\n";
+			echo "\n";
+			echo "\n";
+			echo "\n";
+			echo "\n";
+			echo "\n";
+			echo "\n";
+			$o++;
+			}
+
+		echo "
SERVERDESCRIÇÃOIPACTLOADCHANDISKSAINTEENTRANTE
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$diskLINKLINK
\n"; + } + else + { + echo "Você não tem permissão para ver esta página\n"; + exit; + } + } + + +echo "
\n"; +echo "
\n"; + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "
\n"; +echo "

"; +echo "VERSÃO: $admin_version
"; +echo "BUILD: $build
\n"; + +?> + +
+
+ + + +1) + { + if (strlen($dial_statuses)>2) + { + $g=0; + $p='13'; + $GMT_gmt[0] = ''; + $GMT_hour[0] = ''; + $GMT_day[0] = ''; + while ($p > -13) + { + $pzone=3600 * $p; + $pmin=(gmdate("i", time() + $pzone)); + $phour=( (gmdate("G", time() + $pzone)) * 100); + $pday=gmdate("w", time() + $pzone); + $tz = sprintf("%.2f", $p); + $GMT_gmt[$g] = "$tz"; + $GMT_day[$g] = "$pday"; + $GMT_hour[$g] = ($phour + $pmin); + $p = ($p - 0.25); + $g++; + } + + $stmt="SELECT call_time_id,call_time_name,call_time_comments,ct_default_start,ct_default_stop,ct_sunday_start,ct_sunday_stop,ct_monday_start,ct_monday_stop,ct_tuesday_start,ct_tuesday_stop,ct_wednesday_start,ct_wednesday_stop,ct_thursday_start,ct_thursday_stop,ct_friday_start,ct_friday_stop,ct_saturday_start,ct_saturday_stop,ct_state_call_times FROM vicidial_call_times where call_time_id='$local_call_time';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $Gct_default_start = "$rowx[3]"; + $Gct_default_stop = "$rowx[4]"; + $Gct_sunday_start = "$rowx[5]"; + $Gct_sunday_stop = "$rowx[6]"; + $Gct_monday_start = "$rowx[7]"; + $Gct_monday_stop = "$rowx[8]"; + $Gct_tuesday_start = "$rowx[9]"; + $Gct_tuesday_stop = "$rowx[10]"; + $Gct_wednesday_start = "$rowx[11]"; + $Gct_wednesday_stop = "$rowx[12]"; + $Gct_thursday_start = "$rowx[13]"; + $Gct_thursday_stop = "$rowx[14]"; + $Gct_friday_start = "$rowx[15]"; + $Gct_friday_stop = "$rowx[16]"; + $Gct_saturday_start = "$rowx[17]"; + $Gct_saturday_stop = "$rowx[18]"; + $Gct_state_call_times = "$rowx[19]"; + + $ct_states = ''; + $ct_state_gmt_SQL = ''; + $ct_srs=0; + $b=0; + if (strlen($Gct_state_call_times)>2) + { + $state_rules = explode('|',$Gct_state_call_times); + $ct_srs = ((count($state_rules)) - 2); + } + while($ct_srs >= $b) + { + if (strlen($state_rules[$b])>1) + { + $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,state_call_time_comments,sct_default_start,sct_default_stop,sct_sunday_start,sct_sunday_stop,sct_monday_start,sct_monday_stop,sct_tuesday_start,sct_tuesday_stop,sct_wednesday_start,sct_wednesday_stop,sct_thursday_start,sct_thursday_stop,sct_friday_start,sct_friday_stop,sct_saturday_start,sct_saturday_stop from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Gstate_call_time_id = "$row[0]"; + $Gstate_call_time_state = "$row[1]"; + $Gsct_default_start = "$row[4]"; + $Gsct_default_stop = "$row[5]"; + $Gsct_sunday_start = "$row[6]"; + $Gsct_sunday_stop = "$row[7]"; + $Gsct_monday_start = "$row[8]"; + $Gsct_monday_stop = "$row[9]"; + $Gsct_tuesday_start = "$row[10]"; + $Gsct_tuesday_stop = "$row[11]"; + $Gsct_wednesday_start = "$row[12]"; + $Gsct_wednesday_stop = "$row[13]"; + $Gsct_thursday_start = "$row[14]"; + $Gsct_thursday_stop = "$row[15]"; + $Gsct_friday_start = "$row[16]"; + $Gsct_friday_stop = "$row[17]"; + $Gsct_saturday_start = "$row[18]"; + $Gsct_saturday_stop = "$row[19]"; + + $ct_states .="'$Gstate_call_time_state',"; + + $r=0; + $state_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Domingo horário local + { + if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Segunda horário local + { + if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Terça horário local + { + if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Quarta horário local + { + if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Quinta horário local + { + if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Sexta horário local + { + if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Sábado horário local + { + if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + $state_gmt = "$state_gmt'99'"; + $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; + } + + $b++; + } + if (strlen($ct_states)>2) + { + $ct_states = eregi_replace(",$",'',$ct_states); + $ct_statesSQL = "and state NOT IN($ct_states)"; + } + else + { + $ct_statesSQL = ""; + } + + $r=0; + $default_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Domingo horário local + { + if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Segunda horário local + { + if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Terça horário local + { + if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Quarta horário local + { + if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Quinta horário local + { + if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Sexta horário local + { + if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Sábado horário local + { + if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + + $default_gmt = "$default_gmt'99'"; + $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; + + $dial_statuses = preg_replace("/ -$/","",$dial_statuses); + $Dstatuses = explode(" ", $dial_statuses); + $Ds_to_print = (count($Dstatuses) - 0); + $Dsql = ''; + $o=0; + while ($Ds_to_print > $o) + { + $o++; + $Dsql .= "'$Dstatuses[$o]',"; + } + $Dsql = preg_replace("/,$/","",$Dsql); + if (strlen($Dsql) < 2) {$Dsql = "''";} + + $DLTsql=''; + if ($drop_lockout_time > 0) + { + $DLseconds = ($drop_lockout_time * 3600); + $DLseconds = floor($DLseconds); + $DLseconds = intval("$DLseconds"); + $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; + } + + $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL"; + #$DB=1; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rslt_rows = mysql_num_rows($rslt); + if ($rslt_rows) + { + $rowx=mysql_fetch_row($rslt); + $active_leads = "$rowx[0]"; + } + else {$active_leads = '0';} + + echo "|$DB|\n"; + echo "Esta campanha tem$active_leads registros para serem discados nessas listas\n"; + } + else + { + echo "nenhum status de discagem selecionado para essa campanha\n"; + } + } + else + { + echo "nenhuma lista ativa para esta campanha\n"; + } + } +else + { + echo "nenhuma lista ativa para esta campanha\n"; + } +##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### +} +?> diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/admin_header.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/admin_header.php new file mode 100644 index 00000000..72403543 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/admin_header.php @@ -0,0 +1,1287 @@ + LICENSE: AGPLv2 +# + +# CHANGES +# 90310-0709 - First Build +# 90508-0542 - Added Call Menu option, changed script to use long PHP tags +# 90514-0605 - Added audio prompt selection functions +# 90530-1206 - Changed List Mix to allow for 40 mixes and a default populate option +# 90531-2339 - Added Dynamic options for Call Menu +# 90612-0852 - Changed relative links +# 90635-0943 - Added javascript for dynamic menus in In-Groups +# 90627-0548 - Added no-agent-no-queue options +# 90628-1016 - Added Text-to-speech options +# 90830-2213 - Added Music On Hold options +# 90904-1534 - Added launch_moh_chooser +# 90916-2334 - Added Voicemail options +# 91223-1030 - Added VIDPROMPT options for in-group routing in Call Menus +# + + +######################### SMALL HTML HEADER BEGIN ####################################### +if($short_header) + { + ?> +
+ + + + + + + + + + + + +
    Usuários     Campanhas     Listas     Scripts     Filtros     Groupos de Entrada     Grupos de Usuário     Agentes Remotos     Admin     Relatórios  
+ 0) + { + if ($hh=='lists') + {$lists_hh="bgcolor=\"$lists_color\""; $lists_fc="$lists_font"; $lists_bold="$header_selected_bold";} + else {$lists_hh=''; $lists_fc='WHITE'; $lists_bold="$header_nonselected_bold";} + } +if ($hh=='ingroups') + {$ingroups_hh="bgcolor=\"$ingroups_color\""; $ingroups_fc="$ingroups_font"; $ingroups_bold="$header_selected_bold";} + else {$ingroups_hh=''; $ingroups_fc='WHITE'; $ingroups_bold="$header_nonselected_bold";} +if ($hh=='remoteagent') + {$remoteagent_hh="bgcolor=\"$remoteagent_color\""; $remoteagent_fc="$remoteagent_font"; $remoteagent_bold="$header_selected_bold";} + else {$remoteagent_hh=''; $remoteagent_fc='WHITE'; $remoteagent_bold="$header_nonselected_bold";} +if ($hh=='usergroups') + {$usergroups_hh="bgcolor=\"$usergroups_color\""; $usergroups_fc="$usergroups_font"; $usergroups_bold="$header_selected_bold";} + else {$usergroups_hh=''; $usergroups_fc='WHITE'; $usergroups_bold="$header_nonselected_bold";} +if ($hh=='scripts') + {$scripts_hh="bgcolor=\"$scripts_color\""; $scripts_fc="$scripts_font"; $scripts_bold="$header_selected_bold";} + else {$scripts_hh=''; $scripts_fc='WHITE'; $scripts_bold="$header_nonselected_bold";} +if ($SSoutbound_autodial_active > 0) + { + if ($hh=='filters') + {$filters_hh="bgcolor=\"$filters_color\""; $filters_fc="$filters_font"; $filters_bold="$header_selected_bold";} + else {$filters_hh=''; $filters_fc='WHITE'; $filters_bold="$header_nonselected_bold";} + } +if ($hh=='admin') + {$admin_hh="bgcolor=\"$admin_color\""; $admin_fc="$admin_font"; $admin_bold="$header_selected_bold";} + else {$admin_hh=''; $admin_fc='WHITE'; $admin_bold="$header_nonselected_bold";} +if ($hh=='reports') + {$reports_hh="bgcolor=\"$reports_color\""; $reports_fc="$reports_font"; $reports_bold="$header_selected_bold";} + else {$reports_hh=''; $reports_fc='WHITE'; $reports_bold="$header_nonselected_bold";} + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
English Brazilian
+ +\r\n"; + print " \r\n"; + } + $rec_count++; + } +$sthA->finish(); + +exit; diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloader_super.pl b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloader_super.pl new file mode 100644 index 00000000..93bfa20e --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloader_super.pl @@ -0,0 +1,1313 @@ +#!/usr/bin/perl +# +# listloader_super.pl version 2.2.0 +# +# Copyright (C) 2010 Matt Florell,Joe Johnson LICENSE: AGPLv2 +# +# +# CHANGES +# 60616-1548 - Added listID override feature to force all leads into same list +# - Added gmt_offset_now lookup for each lead +# 60811-1232 - Changed to DBI +# 60811-1329 - changed to use /etc/astguiclient.conf for configs +# 60906-1056 - added filter of non-digits in alt_phone field +# 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1207 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0144 - UTF8 cleanup +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 90721-1341 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0539 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# + +### begin parsing run-time options ### +if (length($ARGV[0])>1) + { + $i=0; + while ($#ARGV >= $i) + { + $args = "$args $ARGV[$i]"; + $i++; + } + + if ($args =~ /--help|-h/i) + { + print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; + + exit; + } + else + { + if ($args =~ /-duplicate-check/i) + {$dupcheck=1;} + if ($args =~ /-duplicate-campaign-check/i) + {$dupcheckcamp=1;} + if ($args =~ /-duplicate-system-check/i) + {$dupchecksys=1;} + if ($args =~ /-duplicate-tap-list-check/i) + {$duptapchecklist=1;} + if ($args =~ /-duplicate-tap-system-check/i) + {$duptapchecksys=1;} + if ($args =~ /-postal-code-gmt/i) + {$postalgmt=1;} + if ($args =~ /--forcelistid=/i) + { + @data_in = split(/--forcelistid=/,$args); + $forcelistid = $data_in[1]; + $forcelistid =~ s/ .*//gi; + print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; + } + else + {$forcelistid = '';} + + if ($args =~ /--forcephonecode=/i) + { + @data_in = split(/--forcephonecode=/,$args); + $forcephonecode = $data_in[1]; + $forcephonecode =~ s/ .*//gi; + print "\n----- FORCE PHONECODE OVERRIDE: $forcephonecode -----\n\n"; + } + else + {$forcephonecode = '';} + + if ($args =~ /--lead-file=/i) + { + @data_in = split(/--lead-file=/,$args); + $lead_file = $data_in[1]; + $lead_file =~ s/ .*//gi; + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } + else + {$lead_file = './vicidial_temp_file.xls';} + } + } +### end parsing run-time options ### + +use Spreadsheet::ParseExcel; +use Time::Local; +use DBI; + + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = ; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) + {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) + {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} + if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) + {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + +if (!$VARDB_port) {$VARDB_port='3306';} + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + +$vars=$ARGV[0]; +@xls_fields=split(/\,/, $vars); + +$|=0; +$secX = time(); + +($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +$year = ($year + 1900); +$mon++; +if ($hour < 10) {$hour = "0$hour";} +if ($min < 10) {$min = "0$min";} +if ($sec < 10) {$sec = "0$sec";} +if ($mon < 10) {$mon = "0$mon";} +if ($mday < 10) {$mday = "0$mday";} +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$pulldate="$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmtA = "SELECT use_non_latin FROM system_settings;"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $non_latin = "$aryA[0]"; + } +$sthA->finish(); +##### END SETTINGS LOOKUP ##### +########################################### + + +if ($non_latin > 0) {$affected_rows = $dbhA->do("SET NAMES 'UTF8'");} + +### Grab Server values from the database +$stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $DBSERVER_GMT = "$aryA[0]"; + if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} + $rec_count++; + } +$sthA->finish(); + + $LOCAL_GMT_OFF = $SERVER_GMT; + $LOCAL_GMT_OFF_STD = $SERVER_GMT; + +if ($isdst) {$LOCAL_GMT_OFF++;} +if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + + +$total=0; $good=0; $bad=0; +open(STMT_FILE, "> $PATHlogs/listloader_stmts.txt"); + +$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); +my($iR, $iC, $oWkS, $oWkC); + +foreach $oWkS (@{$oBook->{Worksheet}}) { + for($iR = 0 ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { + + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user = ""; + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[0]]; + if ($oWkC) {$vendor_lead_code=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[1]]; + if ($oWkC) {$source_code=$oWkC->Value; } + $source_id=$source_code; + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[2]]; + if ($oWkC) {$list_id=$oWkC->Value; } + $gmt_offset = '0'; + $called_since_last_reset='N'; + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[3]]; + if ($oWkC) {$phone_code=$oWkC->Value; } + $phone_code=~s/[^0-9]//g; + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[4]]; + if ($oWkC) {$phone_number=$oWkC->Value; } + $phone_number=~s/[^0-9]//g; + $USarea = substr($phone_number, 0, 3); + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[5]]; + if ($oWkC) {$title=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[6]]; + if ($oWkC) {$first_name=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[7]]; + if ($oWkC) {$middle_initial=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[8]]; + if ($oWkC) {$last_name=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[9]]; + if ($oWkC) {$address1=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[10]]; + if ($oWkC) {$address2=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[11]]; + if ($oWkC) {$address3=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[12]]; + if ($oWkC) {$city=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[13]]; + if ($oWkC) {$state=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[14]]; + if ($oWkC) {$province=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[15]]; + if ($oWkC) {$postal_code=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[16]]; + if ($oWkC) {$country_code=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[17]]; + if ($oWkC) {$gender=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[18]]; + if ($oWkC) {$date_of_birth=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[19]]; + if ($oWkC) {$alt_phone=$oWkC->Value; } + $alt_phone=~s/[^0-9]//g; + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[20]]; + if ($oWkC) {$email=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[21]]; + if ($oWkC) {$security_phrase=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[22]]; + if ($oWkC) {$comments=$oWkC->Value; } + $comments=~s/^\s*(.*?)\s*$/$1/; + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[23]]; + if ($oWkC) {$rank=$oWkC->Value; } + if (length($rank)<1) {$rank='0';} + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[24]]; + if ($oWkC) {$owner=$oWkC->Value; } + + + + if (length($forcelistid) > 0) + { + $list_id = $forcelistid; # set list_id to override value + } + if (length($forcephonecode) > 0) + { + $phone_code = $forcephonecode; # set phone_code to override value + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if ($dupchecksys > 0) + { + $dup_lead=0; + $stmtA = "select count(*) from vicidial_list where phone_number='$phone_number';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead = $aryA[0]; + $dup_lead_list=$list_id; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$phone_number$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if ($dupcheck > 0) + { + $dup_lead=0; + $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id='$list_id' limit 1;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead_list = $aryA[0]; + $dup_lead++; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$phone_number$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if ($dupcheckcamp > 0) + { + $dup_lead=0; + $dup_lists=''; + + $stmtA = "select count(*) from vicidial_lists where list_id='$list_id';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + @aryA = $sthA->fetchrow_array; + $ci_recs = $aryA[0]; + $sthA->finish(); + if ($ci_recs > 0) + { + $stmtA = "select campaign_id from vicidial_lists where list_id='$list_id';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + @aryA = $sthA->fetchrow_array; + $dup_camp = $aryA[0]; + $sthA->finish(); + + $stmtA = "select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $dup_lists .= "'$aryA[0]',"; + $rec_count++; + } + $sthA->finish(); + + chop($dup_lists); + $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $dup_lead_list = "'$aryA[0]',"; + $rec_count++; + $dup_lead=1; + } + $sthA->finish(); + } + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$phone_number$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate title/alt-phone in vicidial_list table entire database ##### + if ($duptapchecksys > 0) + { + $dup_lead=0; + $stmtA = "select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead = $aryA[0]; + $dup_lead_list=$list_id; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$alt_phone$title$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate title/alt-phone in vicidial_list table for one list_id ##### + if ($duptapchecklist > 0) + { + $dup_lead=0; + $stmtA = "select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id' limit 1;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead_list = $aryA[0]; + $dup_lead++; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$alt_phone$title$US$list_id\|/) + {$dup_lead++;} + } + } + + if ( (length($phone_number)>6) && ($dup_lead < 1) ) + { + if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + + if ( ($postalgmt > 0) && (length($postal_code)>4) ) + { + if ($phone_code =~ /^1$/) + { + $stmtA = "select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[2]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[3]; + $dst_range = $aryA[4]; + $PC_processed++; + $rec_count++; + $postalgmt_found++; + if ($DBX) {print " Postal GMT record found for $postal_code: |$gmt_offset|$dst|$dst_range|\n";} + } + $sthA->finish(); + } + } + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =~ /^1$/) + { + $stmtA = "select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### MEXICO ### + if ($phone_code =~ /^52$/) + { + $stmtA = "select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### AUSTRALIA ### + if ($phone_code =~ /^61$/) + { + $stmtA = "select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $stmtA = "select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = ($secX + (3600 * $AC_GMT_diff)); + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime); + $year = ($year + 1900); + $mon++; + if ($mon < 10) {$mon = "0$mon";} + if ($mday < 10) {$mday = "0$mday";} + if ($hour < 10) {$hour = "0$hour";} + if ($min < 10) {$min = "0$min";} + if ($sec < 10) {$sec = "0$sec";} + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + + if ( (!$AC_processed) && ($dst_range =~ /SSM-FSN/) ) + { + if ($DBX) {print " Second Sunday March to First Sunday November\n";} + &USACAN_dstcalc; + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$area_GMT++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) + { + if ($DBX) {print " First Sunday April to Last Sunday October\n";} + &NA_dstcalc; + if ($DBX) {print " DST: $NA_DST\n";} + if ($NA_DST) {$area_GMT++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) ) + { + if ($DBX) {print " Last Sunday March to Last Sunday October\n";} + &GBR_dstcalc; + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) ) + { + if ($DBX) {print " Last Sunday October to Last Sunday March\n";} + &AUS_dstcalc; + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) ) + { + if ($DBX) {print " First Sunday October to Last Sunday March\n";} + &AUST_dstcalc; + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($area_GMT_method =~ /FSO-FSA/) ) + { + if ($DBX) {print " First Sunday October to First Sunday April\n";} + &AUSE_dstcalc; + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$area_GMT++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) ) + { + if ($DBX) {print " First Sunday October to Third Sunday March\n";} + &NZL_dstcalc; + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($area_GMT_method =~ /LSS-FSA/) ) + { + if ($DBX) {print " Last Sunday September to First Sunday April\n";} + &NZLN_dstcalc; + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$area_GMT++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /TSO-LSF/) ) + { + if ($DBX) {print " Third Sunday October to Last Sunday February\n";} + &BZL_dstcalc; + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$area_GMT++;} + $AC_processed++; + } + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + if ($multi_insert_counter > 8) { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $affected_rows = $dbhA->do($stmtZ); + print STMT_FILE $stmtZ."\r\n"; + $multistmt=''; + $multi_insert_counter=0; + + } else { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multi_insert_counter++; + } + + $good++; + } else { + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list\n";} + $bad++; + } + $total++; + if ($total%100==0) { + print ""; + sleep(1); +# flush(); + } + } +} + +if ($multi_insert_counter > 0) { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $affected_rows = $dbhA->do($stmtZ); + print STMT_FILE $stmtZ."\r\n"; +} + +print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total"; + +exit; + + + + + + +sub USACAN_dstcalc { +#********************************************************************** +# SSM-FSN +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on Second Sunday March to First Sunday November at 2 am. +# INPUTS: +# mm INTEGER Month. +# dd INTEGER Day of the month. +# ns INTEGER Seconds into the day. +# dow INTEGER Day of week (0=Sunday, to 6=Saturday) +# OPTIONAL INPUT: +# timezone INTEGER hour difference UTC - local standard time +# (DEFAULT is blank) +# make calculations based on UTC time, +# which means shift at 10:00 UTC in April +# and 9:00 UTC in October +# OUTPUT: +# INTEGER 1 = DST, 0 = not DST +# +# S M T W T F S +# 1 2 3 4 5 6 7 +# 8 9 10 11 12 13 14 +#15 16 17 18 19 20 21 +#22 23 24 25 26 27 28 +#29 30 31 +# +# S M T W T F S +# 1 2 3 4 5 6 +# 7 8 9 10 11 12 13 +#14 15 16 17 18 19 20 +#21 22 23 24 25 26 27 +#28 29 30 31 +# +#********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; return 0; + } elsif ($mm >= 4 && $mm <= 10) { + $USACAN_DST=1; return 1; + } elsif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; return 1; + } elsif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; return 0; + } else { + $USACAN_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 7200) { + $USACAN_DST=0; return 0; + } else { + $USACAN_DST=1; return 1; + } + } + } else { + $USACAN_DST=0; return 0; + } + } elsif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; return 0; + } elsif ($dd < ($dow+1)) { + $USACAN_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; return 1; + } else { + $USACAN_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 7200) { + $USACAN_DST=1; return 1; + } else { + $USACAN_DST=0; return 0; + } + } + } else { + $USACAN_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub NA_dstcalc { +#********************************************************************** +# FSA-LSO +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in April and last Sunday in October at 2 am. +#********************************************************************** + + $NA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $NA_DST=0; return 0; + } elsif ($mm >= 5 && $mm <= 9) { + $NA_DST=1; return 1; + } elsif ($mm == 4) { + if ($dd > 7) { + $NA_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $NA_DST=0; return 0; + } else { + $NA_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NA_DST=0; return 0; + } else { + $NA_DST=1; return 1; + } + } + } else { + $NA_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $NA_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $NA_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $NA_DST=1; return 1; + } else { + $NA_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 7200) { + $NA_DST=1; return 1; + } else { + $NA_DST=0; return 0; + } + } + } else { + $NA_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub GBR_dstcalc { +#********************************************************************** +# LSM-LSO +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on last Sunday in March and last Sunday in October at 1 am. +#********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; return 0; + } elsif ($mm >= 4 && $mm <= 9) { + $GBR_DST=1; return 1; + } elsif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; return 0; + } elsif ($dd < ($dow+25)) { + $GBR_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; return 0; + } else { + $GBR_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $GBR_DST=0; return 0; + } else { + $GBR_DST=1; return 1; + } + } + } else { + $GBR_DST=1; return 1; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $GBR_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; return 1; + } else { + $GBR_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $GBR_DST=1; return 1; + } else { + $GBR_DST=0; return 0; + } + } + } else { + $GBR_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub AUS_dstcalc { +#********************************************************************** +# LSO-LSM +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on last Sunday in October and last Sunday in March at 1 am. +#********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $AUS_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $AUS_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; return 1; + } else { + $AUS_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $AUS_DST=1; return 1; + } else { + $AUS_DST=0; return 0; + } + } + } else { + $AUS_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; return 0; + } elsif ($dd < ($dow+25)) { + $AUS_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; return 0; + } else { + $AUS_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $AUS_DST=0; return 0; + } else { + $AUS_DST=1; return 1; + } + } + } else { + $AUS_DST=1; return 1; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub AUST_dstcalc { +#********************************************************************** +# FSO-LSM +# TASMANIA ONLY +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in October and last Sunday in March at 1 am. +#********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $AUST_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $AUST_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; return 1; + } else { + $AUST_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $AUST_DST=1; return 1; + } else { + $AUST_DST=0; return 0; + } + } + } else { + $AUST_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd >= 8) { + $AUST_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $AUST_DST=0; return 0; + } else { + $AUST_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 3600) { + $AUST_DST=0; return 0; + } else { + $AUST_DST=1; return 1; + } + } + } else { + $AUST_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub AUSE_dstcalc { +#********************************************************************** +# FSO-FSA +# 2008+ AUSTRALIA ONLY (country code 61) +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in October and first Sunday in April at 1 am. +#********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $AUSE_DST=1; return 1; + } elsif ($mm >= 5 && $mm <= 9) { + $AUSE_DST=0; return 0; + } elsif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; return 0; + } else { + $AUSE_DST=0; return 1; + } + } else { + if ($dow == 0 && $ns < 7200) { + $AUSE_DST=1; return 0; + } else { + $AUSE_DST=0; return 1; + } + } + } else { + $AUSE_DST=1; return 0; + } + } elsif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; return 0; + } else { + $AUSE_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 3600) { + $AUSE_DST=0; return 0; + } else { + $AUSE_DST=1; return 1; + } + } + } else { + $AUSE_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub NZL_dstcalc { +#********************************************************************** +# FSO-TSM +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in October and third Sunday in March at 1 am. +#********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $NZL_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; return 1; + } elsif ($dd < ($dow+14)) { + $NZL_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; return 1; + } else { + $NZL_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $NZL_DST=1; return 1; + } else { + $NZL_DST=0; return 0; + } + } + } else { + $NZL_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd >= 8) { + $NZL_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $NZL_DST=0; return 0; + } else { + $NZL_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 3600) { + $NZL_DST=0; return 0; + } else { + $NZL_DST=1; return 1; + } + } + } else { + $NZL_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub NZLN_dstcalc { +#********************************************************************** +# LSS-FSA +# 2007+ NEW ZEALAND (country code 64) +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on last Sunday in September and first Sunday in April at 1 am. +#********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; return 1; + } elsif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; return 0; + } elsif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; return 0; + } else { + $NZLN_DST=0; return 1; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; return 0; + } else { + $NZLN_DST=0; return 1; + } + } + } else { + $NZLN_DST=1; return 0; + } + } elsif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; return 0; + } elsif ($dd < ($dow+25)) { + $NZLN_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; return 0; + } else { + $NZLN_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $NZLN_DST=0; return 0; + } else { + $NZLN_DST=1; return 1; + } + } + } else { + $NZLN_DST=1; return 1; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub BZL_dstcalc { +#********************************************************************** +# TSO-LSF +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. Brazil +# Based on Third Sunday October to Last Sunday February at 1 am. +#********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; return 1; + } elsif ($mm >= 3 && $mm <= 9) { + $BZL_DST=0; return 0; + } elsif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; return 1; + } elsif ($dd < ($dow+22)) { + $BZL_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; return 1; + } else { + $BZL_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $BZL_DST=1; return 1; + } else { + $BZL_DST=0; return 0; + } + } + } else { + $BZL_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; return 0; + } elsif ($dd < ($dow+22)) { + $BZL_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; return 0; + } else { + $BZL_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $BZL_DST=0; return 0; + } else { + $BZL_DST=1; return 1; + } + } + } else { + $BZL_DST=1; return 1; + } + } # end of month checks +} # end of subroutine dstcalc diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/new_listloader_superL.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/new_listloader_superL.php new file mode 100644 index 00000000..2fb94bef --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/new_listloader_superL.php @@ -0,0 +1,2396 @@ + LICENSE: AGPLv2 +# +# AST GUI lead loader from formatted file +# +# CHANGES +# 50602-1640 - First version created by Joe Johnson +# 51128-1108 - Removed PHP global vars requirement +# 60113-1603 - Fixed a few bugs in Excel import +# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60616-1240 - added listID override +# 60616-1604 - added gmt lookup for each lead +# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories +# 60906-1100 - added filter of non-digits in alt_phone field +# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0417 - UTF8 changes +# 80514-1030 - removed filesize limit and raised number of errors to be displayed +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 81011-2009 - a few bug fixes +# 90309-1831 - Added admin_log logging +# 90310-2128 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90522-0506 - Security fix +# 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# +# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. + +$version = '2.2.0-34'; +$build = '100118-0543'; + + +require("dbconnect.php"); + +### links used for testing +#$link=mysql_connect("10.10.10.15", "cron", "1234"); +#mysql_select_db("asterisk"); +#$WeBServeRRooT = '/home/www/htdocs'; + +$US='_'; + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$leadfile=$_FILES["leadfile"]; + $LF_orig = $_FILES['leadfile']['name']; + $LF_path = $_FILES['leadfile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} + elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} +if (isset($_FILES["leadfile"])) {$leadfile_name=$_FILES["leadfile"]['name'];} +if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} + elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} +if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} + elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} +if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} + elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} +if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} + elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} + elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} +if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} + elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} +if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} + elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} +if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} + elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} +if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} + elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} +if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} + elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} +if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} + elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} +if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} + elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} +if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} + elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} +if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} + elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} +if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} + elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} +if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} + elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} +if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} + elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} +if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} + elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} +if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} + elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} +if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} + elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} +if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} + elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} +if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} + elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} +if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} + elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} +if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} + elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} +if (isset($_GET["rank_field"])) {$rank_field=$_GET["rank_field"];} + elseif (isset($_POST["rank_field"])) {$rank_field=$_POST["rank_field"];} +if (isset($_GET["owner_field"])) {$owner_field=$_GET["owner_field"];} + elseif (isset($_POST["owner_field"])) {$owner_field=$_POST["owner_field"];} +if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} + elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} + $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} +if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} + elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} + elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} +if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} + elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} + $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); + +# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $list_id_override = ereg_replace("[^0-9]","",$list_id_override); + } +else + { + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads =$row[0]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + } + } + + +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name$script_name"; +$admDIR = eregi_replace('new_listloader_superL.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   \"AJUDA\""; + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + ### Grab Server GMT value from the database + $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; + $rslt=mysql_query($stmt, $link); + $gmt_recs = mysql_num_rows($rslt); + if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } + else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + + $LOCAL_GMT_OFF = $SERVER_GMT; + $LOCAL_GMT_OFF_STD = $SERVER_GMT; + +#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +function macfontfix($fontsize) { + + $browser = getenv("HTTP_USER_AGENT"); + $pctype = explode("(", $browser); + if (ereg("Mac",$pctype[1])) { + /* Browser is a Mac. If not Netscape 6, raise fonts */ + + $blownbrowser = explode('/', $browser); + $ver = explode(' ', $blownbrowser[1]); + $ver = $ver[0]; + if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); + + } else return $fontsize; /* Browser is not a Mac - don't touch fonts */ +} + +echo "\n"; + +?> + + + +ADMINISTRATION: Lead Loader + + + +
+VICIDIAL logo +ADMINISTRATION
+ + + + 1) { + ?> + >>>>>>> + 0) or ($user_territories_active > 0) ) + { ?> + + > + + + + + 1) + { + if ($sh=='basic') {$sh='list';} + if ($sh=='detail') {$sh='list';} + if ($sh=='dialstat') {$sh='list';} + + if ($sh=='list') {$list_sh="bgcolor=\"$subcamp_color\""; $list_fc="$subcamp_font";} + else {$list_sh=''; $list_fc='BLACK';} + if ($sh=='status') {$status_sh="bgcolor=\"$subcamp_color\""; $status_fc="$subcamp_font";} + else {$status_sh=''; $status_fc='BLACK';} + if ($sh=='hotkey') {$hotkey_sh="bgcolor=\"$subcamp_color\""; $hotkey_fc="$subcamp_font";} + else {$hotkey_sh=''; $hotkey_fc='BLACK';} + if ($sh=='recycle') {$recycle_sh="bgcolor=\"$subcamp_color\""; $recycle_fc="$subcamp_font";} + else {$recycle_sh=''; $recycle_fc='BLACK';} + if ($sh=='autoalt') {$autoalt_sh="bgcolor=\"$subcamp_color\""; $autoalt_fc="$subcamp_font";} + else {$autoalt_sh=''; $autoalt_fc='BLACK';} + if ($sh=='pause') {$pause_sh="bgcolor=\"$subcamp_color\""; $pause_fc="$subcamp_font";} + else {$pause_sh=''; $pause_fc='BLACK';} + if ($sh=='listmix') {$listmix_sh="bgcolor=\"$subcamp_color\""; $listmix_fc="$subcamp_font";} + else {$listmix_sh=''; $listmix_fc='BLACK';} + + ?> + > + + > + + > + + 0) + { + ?> + > + + > + + > + + + > + + + + 0) + { + ?> + + 1) { + if ($LOGdelete_from_dnc > 0) {$DNClink = 'Incluir-Remover Número do Bloqueio';} + else {$DNClink = 'Add Number To DNC';} + ?> + >>>>> + + + + 1) + { + ?> + >> + + + 0) + { + ?> + + 1) + { + ?> + >> + + + + 1) + { + ?> + >>>>>>>>> + + + + 1) + { + ?> + >>>> + + + + 1) + { + ?> + >> + + + + 1) + { + if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} + else {$times_sh=''; $times_fc='BLACK';} + if ($sh=='shifts') {$shifts_sh="bgcolor=\"$shifts_color\""; $shifts_fc="$shifts_font";} + else {$shifts_sh=''; $shifts_fc='BLACK';} + if ($sh=='templates') {$templates_sh="bgcolor=\"$templates_color\""; $templates_fc="$templates_font";} + else {$templates_sh=''; $templates_fc='BLACK';} + if ($sh=='carriers') {$carriers_sh="bgcolor=\"$carriers_color\""; $carriers_fc="$carriers_font";} + else {$carriers_sh=''; $carriers_fc='BLACK';} + if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} + else {$phones_sh=''; $phones_fc='BLACK';} + if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} + else {$server_sh=''; $server_fc='BLACK';} + if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} + else {$conference_sh=''; $conference_fc='BLACK';} + if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} + else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} + else {$status_sh=''; $status_fc='BLACK';} + if ($sh=='audio') {$audio_sh="bgcolor=\"$audio_color\""; $audio_fc="$audio_font";} + else {$audio_sh=''; $audio_fc='BLACK';} + if ($sh=='moh') {$moh_sh="bgcolor=\"$moh_color\""; $moh_fc="$moh_font";} + else {$moh_sh=''; $moh_fc='BLACK';} + if ($sh=='vm') {$vm_sh="bgcolor=\"$vm_color\""; $vm_fc="$vm_font";} + else {$vm_sh=''; $vm_fc='BLACK';} + if ($sh=='tts') {$tts_sh="bgcolor=\"$tts_color\""; $tts_fc="$tts_font";} + else {$tts_sh=''; $tts_fc='BLACK';} + + ?> + > + + > + > + > + > + > + > + > + > + > + + 0) or ($SSsounds_central_control_active > 0) ) + { ?> + > + + > + + + 0) + { ?> + > + + + + + + +
WIDTH=160> + SIZE=>Usuários +
+   >Mostrar Usuários +
+   >Incluir Usuário +
+   >Copiar Usuário +
+   >Pesquisar Usuário +
+   >Estatísticas de Usuário +
+   >Status do Usuário +
+   >Planilha de Tempo
+   >Territorios de usuario
> + SIZE=>Campanhas +
>   SIZE=>Campanhas
>   SIZE=>Status
>   SIZE=>Atalhos
>   SIZE=>Reciclar Registro
>   SIZE=>Auto-Alt Dial
>   SIZE=>Mesclagem de Lista
>   SIZE=>Códigos de Pausa
> SIZE=>Listas
  + > Mostrar Listas +
  + > Incluir Lista +
  + > Pesquisar Registro +
  + > +
  + > Carregar Registros +
> + SIZE=> Scripts +
  + > Mostrar Scripts +
  + > Incluir Script +
> SIZE=> Filtros
  + > Mostrar Filtros +
  + > Incluir Filtro +
> + SIZE=> Grupos Entr. +
  + > Mostrar Grupos Entr. +
  + > Incluir Grupo Entr. +
  + > Copiar Grupo de Entrada
+
  + > Mostrar DDRs +
  + > Incluir DDR +
  + > CopiarDID
+
  + > Mostrar Menus +
  + > Incluir um Menu +
  + > Copiar Menu de Chamada +
> + SIZE=> Grupos de Usuário +
  + > Mostrar Grp. de Usuário +
  + > Incluir Grp. de Usuário +
  + > Relat. de Grps por Hora +
  + > Troca de Grupo em lote +
> + SIZE=> Agentes Remotos +
  + > Mostrar Ag. Remotos +
  + > Incluir Ag. Remoto +
> + SIZE=> Admin +
COLSPAN=2>   + SIZE=> Horários de Cham.
>   + SIZE=> Turnos
>   + SIZE=> Ramais
>   + SIZE=> Templates
>   + SIZE=> Operadoras
>   + SIZE=> Servidores
>   + SIZE=> Conferências
>   + SIZE=> Config. de Sistema
>   + SIZE=>Status do Sistema
>   + SIZE=> Correio de Voz
>   + SIZE=> Audio de la tienda
>   + SIZE=> Música en espera
>   + SIZE=> Text To Speech
> + SIZE=> Relatórios +
 
+
BGCOLOR=#D9E6FE> + + + + + HEIGHT=15> + + + + + + + + + + + + 1) { + ?> + > + 1) { + ?> + > + 1) { + ?> + > + 1) { + ?> + > + 1) { + ?> + > + 1) and (strlen($admin_hh) > 1) ) { + ?> + > + 1) and (strlen($admin_hh) > 1) ) { + ?> + > + 1) and (strlen($admin_hh) > 1) ) { + ?> + > + 1) and (strlen($admin_hh) > 1) ) { + ?> + > + 1) and (strlen($admin_hh) > 1) ) { + ?> + > + 1) and (strlen($admin_hh) > 1) ) { + ?> + > + 1) { + ?> + > + 1) and (!eregi('campaign',$hh) ) ) { + ?> + > + + > + 1) { + ?> +> + + + + +"; + $alts_output .= ""; + $alts_output .= ""; + $alts_output .= "\n"; + $alts_output .= "\n"; + $alts_output .= "\n"; + } + + } + else + { + echo "procura de registro FALHOU para este lead_id $lead_id       $NOW_TIME\n

\n"; +# echo "Close this window\n

\n"; + } + + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $call_log .= ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + + echo "
Informações da Chamada: $first_name $last_name - $phone_number

\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
HOME | Relógio Ponto | Sair  
>   > Mostrar Campanhas     |     > Incluir Campanha     |     > Copiar Campanha     |     > Resumo de Campanhas Tempos-real
  > Mostrar Horários de Cham.  | > Incluir Horário de Cham.  | > Mostrar Hor. de Cham. por Estado  | > Incluir Hor. de Cham. por Estado
  > Mostrar Turnos  | > Incluir Turno
  > Mostrar Ramais  | > Incluir Ramal  | > Lista de Alias de Ramal  | > Incluir Alias de Ramal  | > Lista de Alias de Grupo  | > Incluir Alias de Grupo
  > Mostrar Conferências   |   > Incluir Conferência   |   > Mostrar Conferências VICIDIAL   |   > Incluir Conferência VICIDIAL
  > Mostrar Servidores   |   > Incluir Servidor
  > Mostrar Templates   |   > Incluir Template
  > Show Operadoras   |   > Add A New Carrier
  > Mostrar las entradas TTS   |   > Agregar una nueva entrada TTS
  > Mostrar las entradas del Ministerio de Salud   |   > Agregar una nueva entrada del Ministerio de Salud
  > Show Correio de Voz Entries   |   > Add A New Correio de Voz Entry
  > Config. de Sistema
  >Status do Sistema   |   >Categoria de Status   |   >Cód. de Status CQ
  >Estatísticas de Usuário   |   >Status do Usuário   |   >Planilha de Tempo   |   >Status Diário
>  
+ LICENSE: AGPLv2 +# +# CHANGES +# +# 60419-1705 - Added ability to change lead callback record from USERONLY to ANYONE or USERONLY-user +# 60421-1459 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60609-1112 - Added DNC list addition if status changed to DNC +# 60619-1539 - Added variable filtering to eliminate SQL injection attack threat +# 61130-1639 - Added recording_log lookup and list for this lead_id +# 61201-1136 - Added recording_log user(TSR) display and link +# 70305-1133 - Changed to default CHECKED modify logs upon status change +# 70424-1128 - Added campaign-specific statuses, reformatted recordings list +# 70702-1259 - Added recording location link and truncation +# 70906-2132 - Added closer_log records display +# 80428-0144 - UTF8 cleanup +# 80501-0454 - Added Hangup Reason to logs display +# 80516-0936 - Cleanup of logging changes, added vicidial_agent_log display +# 80701-0832 - Changed to allow for altering of main phone number +# 80805-2106 - Changed comments to TEXTAREA +# 81210-1529 - Added server recording display options +# 90309-1829 - Added admin_log logging +# 90508-0644 - Changed to PHP long tags +# 90708-1549 - Added phone number dialed to outbound log +# 90721-1246 - Added rank and owner as vicidial_list fields +# 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} + elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} +if (isset($_GET["phone"])) {$phone=$_GET["phone"];} + elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} +if (isset($_GET["old_phone"])) {$old_phone=$_GET["old_phone"];} + elseif (isset($_POST["old_phone"])) {$old_phone=$_POST["old_phone"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} + elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} + elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} +if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} + elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} + elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["channel"])) {$channel=$_GET["channel"];} + elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} +if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} + elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} +if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} + elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} +if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} + elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} +if (isset($_GET["address1"])) {$address1=$_GET["address1"];} + elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} +if (isset($_GET["address2"])) {$address2=$_GET["address2"];} + elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} +if (isset($_GET["address3"])) {$address3=$_GET["address3"];} + elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} +if (isset($_GET["city"])) {$city=$_GET["city"];} + elseif (isset($_POST["city"])) {$city=$_POST["city"];} +if (isset($_GET["state"])) {$state=$_GET["state"];} + elseif (isset($_POST["state"])) {$state=$_POST["state"];} +if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} + elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} +if (isset($_GET["province"])) {$province=$_GET["province"];} + elseif (isset($_POST["province"])) {$province=$_POST["province"];} +if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} + elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} +if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} + elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["email"];} +if (isset($_GET["security"])) {$security=$_GET["security"];} + elseif (isset($_POST["security"])) {$security=$_POST["security"];} +if (isset($_GET["comments"])) {$comments=$_GET["comments"];} + elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["rank"])) {$rank=$_GET["rank"];} + elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];} +if (isset($_GET["owner"])) {$owner=$_GET["owner"];} + elseif (isset($_POST["owner"])) {$owner=$_POST["owner"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];} + elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];} +if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];} + elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} +if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} + elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} +if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} + elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} +if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} + elseif (isset($_POST["CBuser"])) {$CBuser=$_POST["CBuser"];} +if (isset($_GET["modify_logs"])) {$modify_logs=$_GET["modify_logs"];} + elseif (isset($_POST["modify_logs"])) {$modify_logs=$_POST["modify_logs"];} +if (isset($_GET["modify_closer_logs"])) {$modify_closer_logs=$_GET["modify_closer_logs"];} + elseif (isset($_POST["modify_closer_logs"])) {$modify_closer_logs=$_POST["modify_closer_logs"];} +if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent_logs"];} + elseif (isset($_POST["modify_agent_logs"])) {$modify_agent_logs=$_POST["modify_agent_logs"];} +if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];} + elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $old_phone = ereg_replace("[^0-9]","",$old_phone); + $phone_number = ereg_replace("[^0-9]","",$phone_number); + $alt_phone = ereg_replace("[^0-9]","",$alt_phone); + } +if (strlen($phone_number)<6) {$phone_number=$old_phone;} + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + + if($auth>0) + { + $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname =$row[0]; + $LOGmodify_leads =$row[1]; + + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + +ADMINISTRATION: Registro Alterado + + +
+ADMINISTRATION: Registro Alterado
\n"; + +if ($end_call > 0) + { + ### update the lead record in the vicidial_list table + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Informação Alterada

\n"; + echo "\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='MODIFY', record_id='$lead_id', event_code='ADMIN MODIFY LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ( ($dispo != $status) and ($dispo == 'CBHOLD') ) + { + ### inactivate vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status='ACTIVE';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
vicidial_callback record inactivated: $lead_id
\n"; + } + if ( ($dispo != $status) and ($dispo == 'CALLBK') ) + { + ### inactivate vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
vicidial_callback record inactivated: $lead_id
\n"; + } + + if ( ($dispo != $status) and ($status == 'DNC') ) + { + ### add lead to the internal DNC list + $stmt="INSERT INTO vicidial_dnc (phone_number) values('" . mysql_real_escape_string($phone_number) . "');"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; + } + ### update last record in vicidial_log table + if (($dispo != $status) and ($modify_logs > 0)) + { + $stmt="UPDATE vicidial_log set status='" . mysql_real_escape_string($status) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by call_date desc limit 1"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + ### update last record in vicidial_closer_log table + if (($dispo != $status) and ($modify_closer_logs > 0)) + { + $stmt="UPDATE vicidial_closer_log set status='" . mysql_real_escape_string($status) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by call_date desc limit 1"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + ### update last record in vicidial_agent_log table + if (($dispo != $status) and ($modify_agent_logs > 0)) + { + $stmt="UPDATE vicidial_agent_log set status='" . mysql_real_escape_string($status) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 1"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + if ($add_closer_record > 0) + { + ### insert a NEW record to the vicidial_closer_log table + $stmt="INSERT INTO vicidial_closer_log (lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed) values('" . mysql_real_escape_string($lead_id) . "','" . mysql_real_escape_string($list_id) . "','" . mysql_real_escape_string($campaign_id) . "','" . mysql_real_escape_string($parked_time) . "','$NOW_TIME','$STARTtime','1','" . mysql_real_escape_string($status) . "','" . mysql_real_escape_string($phone_code) . "','" . mysql_real_escape_string($phone_number) . "','$PHP_AUTH_USER','" . mysql_real_escape_string($comments) . "','Y')"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + + } +else + { + + if ($CBchangeUSERtoANY == 'YES') + { + ### inactivate vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
vicidial_callback record changed to ANYONE
\n"; + } + if ($CBchangeUSERtoUSER == 'YES') + { + ### inactivate vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
vicidial_callback record user changed to $CBuser
\n"; + } + if ($CBchangeANYtoUSER == 'YES') + { + ### inactivate vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
vicidial_callback record changed to USERONLY, user: $CBuser
\n"; + } + + + + $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $lead_count = $row[0]; + + if ($lead_count > 0) + { + ##### grab vicidial_list_alt_phones records ##### + $stmt="select phone_code,phone_number,alt_phone_note,alt_phone_count,active from vicidial_list_alt_phones where lead_id='" . mysql_real_escape_string($lead_id) . "' order by alt_phone_count limit 500;"; + $rslt=mysql_query($stmt, $link); + $alts_to_print = mysql_num_rows($rslt); + + $c=0; + $alts_output = ''; + while ($alts_to_print > $c) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $c)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $c++; + $alts_output .= "
$c$row[0] $row[1] $row[2] $row[3] $row[4]
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID da Lista: $list_id
Nome:   \n"; + echo " Sobrenome:
Endereço 1 :
Endereço 2 :
Endereço 3 :
Cidade :
Estado:   \n"; + echo " CEP:
Província:
País :
Main Phone :
Tel. Alt. :
Email :
Segurança:
Rank :
Owner :
Comentários :
Finalização: (with $log_campaign statuses)
Alterarvicidial log
Alteraragent log
Alterarcloser log
Add closer log record
\n"; + echo "


\n"; + + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); + + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UsuárioID: \n"; + echo "

\n"; + } + else + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UsuárioID: \n"; + echo "

\n"; + } + } + else + { + echo "
No Callback records found
\n"; + } + } + + + echo "

\n"; + + echo "
\n"; + + if ($c > 0) + { + echo "EXTENDED SUPLENTE NÚMEROS DE TELÉFONO PARA ESTE DE PLOMO:\n"; + echo "\n"; + echo "\n"; + + echo "$alts_output\n"; + + echo "
# ALT PHONE ALT NOTE ALT COUNT ACTIVE
\n"; + echo "

\n"; + } + + echo "CHAMADAS PARA ESSE REGISTRO:\n"; + echo "\n"; + echo "\n"; + + echo "$call_log\n"; + + echo "
# DATE/TIME LENGTH STATUS TSR CAMPANHA LIST LEAD HANGUP REASON PHONE
\n"; + echo "

\n"; + + echo "CLOSER RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$closer_log\n"; + + echo "
# DATE/TIME LENGTH STATUS TSR CAMPANHA LIST LEAD WAIT HANGUP REASON
\n"; + echo "

\n"; + + + echo "AGENTE LOG RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$agent_log\n"; + + echo "
# DATE/TIME CAMPANHA TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
\n"; + echo "

\n"; + + + echo "RECORDINGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $location = $row[11]; + + if (strlen($location)>2) + { + $URLserver_ip = $location; + $URLserver_ip = eregi_replace('http://','',$URLserver_ip); + $URLserver_ip = eregi_replace('https://','',$URLserver_ip); + $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); + $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if ($rowx[0] > 0) + { + $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if (eregi("ALT_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[1], $location); + } + } + } + + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if (eregi("http",$location)) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + + } + + + echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
$u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]
\n"; + } + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "\n\n\n


\n\n"; + + +echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; + + +?> + + + + + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/admin_search_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/admin_search_lead.php new file mode 100644 index 00000000..1bdc0cbc --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/admin_search_lead.php @@ -0,0 +1,598 @@ + LICENSE: AGPLv2 +# +# AST GUI database administration search for lead info +# admin_modify_lead.php +# +# this is the administration lead information search screen, the administrator +# just needs to enter the leadID and then they can view and modify the information +# in the record for that lead +# +# changes: +# 60620-1055 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# - Changed results to multi-record +# 80710-0023 - Added searching by list, user, status +# 90121-0500 - Added filter for phone to remove non-digits +# 90309-1828 - Added admin_log logging +# 90310-2146 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90917-2307 - Added alternate phone number searching option +# 90921-0713 - Removed SELECT STAR +# 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} + elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} +if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} + elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} + elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} +if (isset($_GET["phone"])) {$phone=$_GET["phone"];} + elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];} + elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +$phone = ereg_replace("[^0-9]","",$phone); +if (strlen($alt_phone_search) < 2) {$alt_phone_search='No';} + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); + +$vicidial_list_fields = 'lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner'; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./project_auth_entries.txt", "a");} + +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if ($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; + + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?> + + + +ADMINISTRATION: Pesquisar Registro +<?php + +##### BEGIN Set variables to make header show properly ##### +$ADD = '100'; +$hh = 'lists'; +$LOGast_admin_access = '1'; +$SSoutbound_autodial_active = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$lists_color = '#FFFF99'; +$lists_font = 'BLACK'; +$lists_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + + +echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; +echo date("l F j, Y G:i:s A"); +echo "<BR>\n"; + +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) + { + ### Lead search + echo "<br><center>\n"; + echo "<form method=post name=search action=\"$PHP_SELF\">\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<TABLE CELLPADDING=3 CELLSPACING=3>"; + echo "<TR>"; + echo "<TD colspan=3 align=center><b>Pesquisar Registro Opçãos:</TD>"; + echo "</TR><TR bgcolor=#B9CBFD>"; + + echo "<TD ALIGN=right>Vendor ID(código do fornecedor):   </TD><TD ALIGN=left><input type=text name=vendor_id size=10 maxlength=10></TD>"; + echo "<TD><input type=submit name=submit value=ENVIAR></TD>\n"; + echo "</TR><TR>"; + echo "<TD colspan=3 align=center>   </TD>"; + echo "</TR><TR bgcolor=#B9CBFD>"; + + echo "<TD ALIGN=right>Home Número do Telefone:   </TD><TD ALIGN=left><input type=text name=phone size=14 maxlength=18></TD>"; + echo "<TD rowspan=2><input type=submit name=submit value=ENVIAR></TD>\n"; + echo "</TR><TR bgcolor=#B9CBFD>"; + echo "<TD ALIGN=right>Alt phone search:   </TD><TD ALIGN=left><select size=1 name=alt_phone_search><option>No</option><option>Yes</option><option SELECTED>$alt_phone_search</option></select></TD>"; + echo "</TR><TR>"; + echo "<TD colspan=3 align=center>   </TD>"; + echo "</TR><TR bgcolor=#B9CBFD>"; + + echo "<TD ALIGN=right>Lead ID:   </TD><TD ALIGN=left><input type=text name=lead_id size=10 maxlength=10></TD>"; + echo "<TD><input type=submit name=submit value=ENVIAR></TD>\n"; + echo "</TR><TR>"; + echo "<TD colspan=3 align=center>   </TD>"; + echo "</TR><TR bgcolor=#B9CBFD>"; + + echo "<TD ALIGN=right>Status:   </TD><TD ALIGN=left><input type=text name=status size=7 maxlength=6></TD>"; + echo "<TD rowspan=3><input type=submit name=submit value=ENVIAR></TD>\n"; + echo "</TR><TR bgcolor=#B9CBFD>"; + echo "<TD ALIGN=right>ID da Lista:   </TD><TD ALIGN=left><input type=text name=list_id size=15 maxlength=14></TD>"; + echo "</TR><TR bgcolor=#B9CBFD>"; + echo "<TD ALIGN=right>Usuário:   </TD><TD ALIGN=left><input type=text name=user size=15 maxlength=20></TD>"; + echo "</TR><TR>"; + echo "<TD colspan=3 align=center>   </TD>"; + echo "</TR><TR bgcolor=#B9CBFD>"; + + echo "<TD ALIGN=right>Nome:   </TD><TD ALIGN=left><input type=text name=first_name size=15 maxlength=30></TD>"; + echo "<TD rowspan=2><input type=submit name=submit value=ENVIAR></TD>\n"; + echo "</TR><TR bgcolor=#B9CBFD>"; + echo "<TD ALIGN=right>Sobrenome:   </TD><TD ALIGN=left><input type=text name=last_name size=15 maxlength=30></TD>"; + echo "</TR>"; + + + ### Log search + echo "<br><center>\n"; + echo "<TD colspan=3 align=center>   </TD>"; + echo "</TR><TR>"; + echo "<TD colspan=3 align=center><b>Log Search Opçãos:</TD>"; + echo "</TR><TR bgcolor=#B9CBFD>"; + + echo "<TD ALIGN=right>Lead ID:   </TD><TD ALIGN=left><input type=text name=log_lead_id size=10 maxlength=10></TD>"; + echo "<TD><input type=submit name=submit value=ENVIAR></TD>\n"; + echo "</TR><TR>"; + echo "<TD colspan=3 align=center>   </TD>"; + echo "</TR><TR bgcolor=#B9CBFD>"; + + echo "<TD ALIGN=right>Número do Telefone Dialed:   </TD><TD ALIGN=left><input type=text name=log_phone size=18 maxlength=18></TD>"; + echo "<TD><input type=submit name=submit value=ENVIAR></TD>\n"; + echo "</TR><TR>"; + echo "<TD colspan=3 align=center>   </TD>"; + echo "</TR><TR bgcolor=#B9CBFD>"; + + + echo "</TABLE>\n"; + echo "</form>\n</center>\n"; + echo "</body></html>\n"; + exit; + } + +else + { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n<br><br><center>\n"; + echo "<b>There are no outbound calls matching your search criteria</b><br><br>\n"; + echo "</center>\n"; + } + else + { + echo "<BR><b>SAINTE LOG RESULTS: $results_to_print</b><BR>\n"; + echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0 WIDTH=770>\n"; + echo "<TR BGCOLOR=BLACK>\n"; + echo "<TD ALIGN=LEFT VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LEAD ID</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>PHONE</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>CAMPANHA</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>CALL DATA</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>STATUS</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>USER</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>ID DA LISTA</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LENGTH</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>DIAL</B></FONT></TD>\n"; + echo "</TR>\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "<TR $bgcolor>\n"; + echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\" target=\"_blank\">$row[0]</a></FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[1]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[4]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[5]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[6]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[7]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[8]</FONT></TD>\n"; + echo "</TR>\n"; + } + echo "</TABLE>\n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n<br><br><center>\n"; + echo "<b>There are no inbound calls matching your search criteria</b><br><br>\n"; + echo "</center>\n"; + } + else + { + echo "<BR><b>ENTRANTE LOG RESULTS: $results_to_print</b><BR>\n"; + echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0 WIDTH=770>\n"; + echo "<TR BGCOLOR=BLACK>\n"; + echo "<TD ALIGN=LEFT VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LEAD ID</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>PHONE</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>INGROUP</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>CALL DATA</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>STATUS</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>USER</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>ID DA LISTA</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LENGTH</B>  </FONT></TD>\n"; + echo "</TR>\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "<TR $bgcolor>\n"; + echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\" target=\"_blank\">$row[0]</a></FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[1]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[4]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[5]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[6]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[7]</FONT></TD>\n"; + echo "</TR>\n"; + } + echo "</TABLE>\n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n<br><br><center>\n"; + echo "<b>There are no inbound did calls matching your search criteria</b><br><br>\n"; + echo "</center>\n"; + } + else + { + echo "<BR><b>ENTRANTE DID LOG RESULTS: $results_to_print</b><BR>\n"; + echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0 WIDTH=770>\n"; + echo "<TR BGCOLOR=BLACK>\n"; + echo "<TD ALIGN=LEFT VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>DID</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>PHONE</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>DID ID</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>CALL DATA</B>  </FONT></TD>\n"; + echo "</TR>\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "<TR $bgcolor>\n"; + echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[0]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[1]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n"; + echo "</TR>\n"; + } + echo "</TABLE>\n"; + } + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n<br><br><br>\n<a href=\"$PHP_SELF\">NOVA PESQUISA</a>"; + + echo "\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds"; + + echo "\n\n\n</body></html>"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### + if ($vendor_id) + { + $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; + } + else + { + if ($phone) + { + if ($alt_phone_search=="Yes") + { + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "'"; + } + else + { + $stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "'"; + } + } + else + { + if ($lead_id) + { + $stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + } + else + { + if ( (strlen($status)>0) or (strlen($list_id)>0) or (strlen($user)>0) ) + { + $statusSQL = ''; + $list_idSQL = ''; + $userSQL = ''; + if (strlen($status)>0) + { + $statusSQL = "status='" . mysql_real_escape_string($status) . "'"; $SQLctA++; + } + if (strlen($list_id)>0) + { + if ($SQLctA > 0) {$andA = 'and';} + $list_idSQL = "$andA list_id='" . mysql_real_escape_string($list_id) . "'"; $SQLctB++; + } + if (strlen($user)>0) + { + if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';} + $userSQL = "$andB user='" . mysql_real_escape_string($user) . "'"; + } + $stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL"; + } + else + { + if ( (strlen($first_name)>0) or (strlen($last_name)>0) ) + { + $first_nameSQL = ''; + $last_nameSQL = ''; + if (strlen($first_name)>0) + { + $first_nameSQL = "first_name='" . mysql_real_escape_string($first_name) . "'"; $SQLctA++; + } + if (strlen($last_name)>0) + { + if ($SQLctA > 0) {$andA = 'and';} + $last_nameSQL = "$andA last_name='" . mysql_real_escape_string($last_name) . "'"; + } + $stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL"; + } + else + { + print "ERROR: you must search for something! Go back and search for something"; + exit; + } + } + } + } + } + + $stmt_alt=''; + $results_to_printX=0; + if ( ($alt_phone_search=="Yes") and (strlen($phone) > 4) ) + { + $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' limit 1000;"; + $rsltX=mysql_query($stmtX, $link); + $results_to_printX = mysql_num_rows($rsltX); + if ($DB) + {echo "\n\n$results_to_printX|$stmtX\n\n";} + $o=0; + while ($results_to_printX > $o) + { + $row=mysql_fetch_row($rsltX); + if ($o > 0) {$stmt_alt .= ",";} + $stmt_alt .= "'$row[0]'"; + $o++; + } + if (strlen($stmt_alt) > 2) + {$stmt_alt = "or lead_id IN($stmt_alt)";} + } + + $stmt = "$stmt$stmt_alt order by modify_date desc limit 1000;"; + + if ($DB) + { + echo "\n\n$stmt\n\n"; + } + + $rslt=mysql_query("$stmt", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo date("l F j, Y G:i:s A"); + echo "\n<br><br><center>\n"; + echo "<b>As variáveis de pesquisa digitadas não estão ativas no sistema</b><br><br>\n"; + echo "<b>Por favor volte e verifique as informações digitadas, então envie novamente</b>\n"; + echo "</center>\n"; + echo "</body></html>\n"; + exit; + } + else + { + echo "<b>RESULTS: $results_to_print</b><BR><BR>\n"; + echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0 WIDTH=770>\n"; + echo "<TR BGCOLOR=BLACK>\n"; + echo "<TD ALIGN=LEFT VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LEAD ID</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>STATUS</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>VENDOR ID</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LAST AGENT</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>ID DA LISTA</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>PHONE</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>NOME</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>CITY</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>SECURITY</B>  </FONT></TD>\n"; + echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LAST CALL</B></FONT></TD>\n"; + echo "</TR>\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "<TR $bgcolor>\n"; + echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\" target=\"_blank\">$row[0]</a></FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[5]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[4]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[7]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[11]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[13] $row[15]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[19]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[28]</FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[31]</FONT></TD>\n"; + echo "</TR>\n"; + } + echo "</TABLE>\n"; + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + ##### END Lead search ##### + + + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "\n\n\n<br><br><br>\n<a href=\"$PHP_SELF\">NOVA PESQUISA</a>"; + + +echo "\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds"; + + +?> + + + +</body> +</html> diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/audio_store.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/audio_store.php new file mode 100644 index 00000000..f3e0624e --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/audio_store.php @@ -0,0 +1,343 @@ +<?php +# audio_store.php +# +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# Central Audio Storage script +# +# CHANGES +# 90511-1325 - First build +# 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads +# + +$version = '2.2.0-3'; +$build = '100401-1037'; + +$MT[0]=''; + +require("dbconnect.php"); + +$server_name = getenv("SERVER_NAME"); +$PHP_SELF=$_SERVER['PHP_SELF']; +$audiofile=$_FILES["audiofile"]; + $AF_orig = $_FILES['audiofile']['name']; + $AF_path = $_FILES['audiofile']['tmp_name']; +if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} + elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["overwrite"])) {$overwrite=$_GET["overwrite"];} + elseif (isset($_POST["overwrite"])) {$overwrite=$_POST["overwrite"];} +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["audio_server_ip"])) {$audio_server_ip=$_GET["audio_server_ip"];} + elseif (isset($_POST["audio_server_ip"])) {$audio_server_ip=$_POST["audio_server_ip"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["audiofile_name"])) {$audiofile_name=$_GET["audiofile_name"];} + elseif (isset($_POST["audiofile_name"])) {$audiofile_name=$_POST["audiofile_name"];} +if (isset($_FILES["audiofile"])) {$audiofile_name=$_FILES["audiofile"]['name'];} +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} + + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,sounds_central_control_active,sounds_web_server,sounds_web_directory,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $sounds_central_control_active = $row[1]; + $sounds_web_server = $row[2]; + $sounds_web_directory = $row[3]; + $SSoutbound_autodial_active = $row[4]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +### check if sounds server matches this server IP, if not then exit with an error +if ( ( (strlen($sounds_web_server)) != (strlen($server_name)) ) or (!eregi("$sounds_web_server",$server_name) ) ) + { + echo "ERROR: server($server_name) does not match sounds web server ip($sounds_web_server)\n"; + exit; + } + + +### check if web directory exists, if not generate one +if (strlen($sounds_web_directory) < 30) + { + $sounds_web_directory = ''; + $possible = "0123456789cdfghjkmnpqrstvwxyz"; + $i = 0; + $length = 30; + while ($i < $length) + { + $char = substr($possible, mt_rand(0, strlen($possible)-1), 1); + $sounds_web_directory .= $char; + $i++; + } + mkdir("$WeBServeRRooT/$sounds_web_directory"); + chmod("$WeBServeRRooT/$sounds_web_directory", 0766); + if ($DB > 0) {echo "$WeBServeRRooT/$sounds_web_directory\n";} + + $stmt="UPDATE system_settings set sounds_web_directory='$sounds_web_directory';"; + $rslt=mysql_query($stmt, $link); + echo "NOTICE: new web directory created\n"; + } + + +### get list of all servers, if not one of them, then force authentication check +$stmt = "SELECT server_ip FROM servers;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$sv_conf_ct = mysql_num_rows($rslt); +$i=0; +$server_ips ='|'; +while ($sv_conf_ct > $i) + { + $row=mysql_fetch_row($rslt); + $server_ips .= "$row[0]|"; + $i++; + } + +$user_set=0; +$formIPvalid=0; +if (strlen($audio_server_ip) > 6) + { + if (preg_match("/\|$audio_server_ip\|/", $server_ips)) + {$formIPvalid=1;} + } +$ip = getenv("REMOTE_ADDR"); +if ( (!preg_match("/\|$ip\|/", $server_ips)) and ($formIPvalid < 1) ) + { + $user_set=1; + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; + $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1'"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|\n"; + exit; + } + } + + +### list all files in sounds web directory +if ($action == "LIST") + { + $i=0; + $filename_sort=$MT; + $dirpath = "$WeBServeRRooT/$sounds_web_directory"; + $dh = opendir($dirpath); + while (false !== ($file = readdir($dh))) + { + # Do not list subdirectories + if ( (!is_dir("$dirpath/$file")) and (preg_match('/\.wav$|\.gsm$/', $file)) ) + { + if (file_exists("$dirpath/$file")) + { + $file_names[$i] = $file; + $file_epoch[$i] = filemtime("$dirpath/$file"); + $file_dates[$i] = date ("Y-m-d H:i:s.", filemtime("$dirpath/$file")); + $file_sizes[$i] = filesize("$dirpath/$file"); + $filename_sort[$i] = $file . "----------" . $i . "----------" . $file_sizes[$i]; + $i++; + } + } + } + closedir($dh); + + sort($filename_sort); + + sleep(1); + + $k=0; + while($k < $i) + { + $filename_split = explode('----------',$filename_sort[$k]); + $m = $filename_split[1]; + $size = $filename_split[2]; + $NOWsize = filesize("$dirpath/$file_names[$m]"); + if ($size == $NOWsize) + { + echo "$k\t$file_names[$m]\t$file_dates[$m]\t$file_sizes[$m]\t$file_epoch[$m]\n"; + } + $k++; + } + exit; + } + + +### upload audio file from server to webserver +# curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" +if ($action == "AUTOUPLOAD") + { + if ($audiofile) + { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); + copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); + chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); + + echo "SUCCESS: $audiofile_name uploaded size:" . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "\n"; + exit; + } + else + { + echo "ERROR: no file uploaded\n"; + } + exit; + } + + + + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<!-- VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> --> +<title>ADMINISTRATION: Audio Store +<?php + + +if ($user_set < 1) + { + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; + $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + } +##### BEGIN Set variables to make header show properly ##### +$ADD = '311111111111111'; +$hh = 'admin'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$admin_color = '#FFFF99'; +$admin_font = 'BLACK'; +$admin_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +?> +<TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Audio Store</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   </TD></TR> + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B>   \n"; + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$date = date("r"); +$browser = getenv("HTTP_USER_AGENT"); +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; +$admDIR = eregi_replace('audio_store.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; +$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; + +$secX = date("U"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; + +if ($action == "MANUALUPLOAD") + { + if ($audiofile) + { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); + copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); + chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); + + echo "SUCCESS: $audiofile_name uploaded size:" . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "\n"; + + $stmt="UPDATE servers SET sounds_update='Y';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + else + { + echo "ERROR: no file uploaded\n"; + } + } + +?> + + +<form action=<?php echo $PHP_SELF ?> method=post enctype="multipart/form-data"> +<input type=hidden name=action value="MANUALUPLOAD"> +<input type=hidden name=sample_prompt id=sample_prompt value=""> + +<table align=center width="700" border=0 cellpadding=5 cellspacing=0 bgcolor=#D9E6FE> + <tr> + <td align=right width="35%"><B><font face="arial, helvetica" size=2>Audio File to Upload:</font></B></td> + <td align=left width="65%"><input type=file name="audiofile" value=""> <?php echo "$NWB#audio_store$NWE"; ?></td> + </tr> + <tr> + <td align=center colspan=2><input type=submit name=submit value=submit></td> + </tr> + <tr><td align=left><font size=1>   </font></td><td align=right><font size=1>Audio Store-     VERSION: <?php echo $version ?>     BUILD: <?php echo $build ?>     </td></tr> +</table> +<BR><BR> +<CENTER><B>We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav)</B> +<BR><BR><font size=1>All spaces will be stripped from uploaded audio file names</font><BR><BR> +<B><a href="javascript:launch_chooser('sample_prompt','date',30);">audio file list</a></CENTER> + + + +<?php + +echo "<BR><BR><BR><BR><BR><BR>\n"; + +echo "</B></B><br><br><a href=\"admin.php?ADD=720000000000000&category=AUDIOSTORE&stage=manualupload\">Click here to see a log of the uploads to the audio store</FONT>\n"; + +?> + +</TD></TR></TABLE> diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/calendar.css b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/calendar.css new file mode 100644 index 00000000..a3ddcae5 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/calendar.css @@ -0,0 +1,95 @@ +/* calendar icon */ +img.tcalIcon { + cursor: pointer; + margin-left: 1px; + vertical-align: middle; +} +/* calendar container element */ +div#tcal { + position: absolute; + visibility: hidden; + z-index: 100; + width: 158px; + padding: 2px 0 0 0; +} +/* all tables in calendar */ +div#tcal table { + width: 100%; + border: 1px solid silver; + border-collapse: collapse; + background-color: white; +} +/* navigation table */ +div#tcal table.ctrl { + border-bottom: 0; +} +/* navigation buttons */ +div#tcal table.ctrl td { + width: 15px; + height: 20px; +} +/* month year header */ +div#tcal table.ctrl th { + background-color: white; + color: black; + border: 0; +} +/* week days header */ +div#tcal th { + border: 1px solid silver; + border-collapse: collapse; + text-align: center; + padding: 3px 0; + font-family: tahoma, verdana, arial; + font-size: 10px; + background-color: gray; + color: white; +} +/* date cells */ +div#tcal td { + border: 0; + border-collapse: collapse; + text-align: center; + padding: 2px 0; + font-family: tahoma, verdana, arial; + font-size: 11px; + width: 22px; + cursor: pointer; +} +/* date highlight + in case of conflicting settings order here determines the priority from least to most important */ +div#tcal td.othermonth { + color: silver; +} +div#tcal td.weekend { + background-color: #ACD6F5; +} +div#tcal td.today { + border: 1px solid red; +} +div#tcal td.selected { + background-color: #FFB3BE; +} +/* iframe element used to suppress windowed controls in IE5/6 */ +iframe#tcalIF { + position: absolute; + visibility: hidden; + z-index: 98; + border: 0; +} +/* transparent shadow */ +div#tcalShade { + position: absolute; + visibility: hidden; + z-index: 99; +} +div#tcalShade table { + border: 0; + border-collapse: collapse; + width: 100%; +} +div#tcalShade table td { + border: 0; + border-collapse: collapse; + padding: 0; +} diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/calendar_db.js b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/calendar_db.js new file mode 100644 index 00000000..ee6c8dd3 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/calendar_db.js @@ -0,0 +1,335 @@ +// Tigra Calendar v4.0.2 (2009-01-12) Database (yyyy-mm-dd) +// http://www.softcomplex.com/products/tigra_calendar/ +// Public Domain Software... You're welcome. + +// default settins +var A_TCALDEF = { + 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + 'yearscroll': true, // show year scroller + 'weekstart': 0, // first day of week: 0-Su or 1-Mo + 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx. + 'imgpath' : 'images/' // directory with calendar images +} +// date parsing function +function f_tcalParseDate (s_date) { + + var re_date = /^\s*(\d{2,4})\-(\d{1,2})\-(\d{1,2})\s*$/; + if (!re_date.exec(s_date)) + return alert ("Invalid date: '" + s_date + "'.\nAccepted format is yyyy-mm-dd.") + var n_day = Number(RegExp.$3), + n_month = Number(RegExp.$2), + n_year = Number(RegExp.$1); + + if (n_year < 100) + n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900); + if (n_month < 1 || n_month > 12) + return alert ("Invalid month value: '" + n_month + "'.\nAllowed range is 01-12."); + var d_numdays = new Date(n_year, n_month, 0); + if (n_day > d_numdays.getDate()) + return alert("Invalid day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + "."); + + return new Date (n_year, n_month - 1, n_day); +} +// date generating function +function f_tcalGenerDate (d_date) { + return ( + d_date.getFullYear() + "-" + + (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "-" + + (d_date.getDate() < 10 ? '0' : '') + d_date.getDate() + ); +} + +// implementation +function tcal (a_cfg, a_tpl) { + + // apply default template if not specified + if (!a_tpl) + a_tpl = A_TCALDEF; + + // register in global collections + if (!window.A_TCALS) + window.A_TCALS = []; + if (!window.A_TCALSIDX) + window.A_TCALSIDX = []; + + this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length; + window.A_TCALS[this.s_id] = this; + window.A_TCALSIDX[window.A_TCALSIDX.length] = this; + + // assign methods + this.f_show = f_tcalShow; + this.f_hide = f_tcalHide; + this.f_toggle = f_tcalToggle; + this.f_update = f_tcalUpdate; + this.f_relDate = f_tcalRelDate; + this.f_parseDate = f_tcalParseDate; + this.f_generDate = f_tcalGenerDate; + + // create calendar icon + this.s_iconId = 'tcalico_' + this.s_id; + this.e_icon = f_getElement(this.s_iconId); + if (!this.e_icon) { + document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />'); + this.e_icon = f_getElement(this.s_iconId); + } + // save received parameters + this.a_cfg = a_cfg; + this.a_tpl = a_tpl; +} + +function f_tcalShow (d_date) { + + // find input field + if (!this.a_cfg.controlname) + throw("TC: control name is not specified"); + if (this.a_cfg.formname) { + var e_form = document.forms[this.a_cfg.formname]; + if (!e_form) + throw("TC: form '" + this.a_cfg.formname + "' can not be found"); + this.e_input = e_form.elements[this.a_cfg.controlname]; + } + else + this.e_input = f_getElement(this.a_cfg.controlname); + + if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT') + throw("TC: element '" + this.a_cfg.controlname + "' does not exist in " + + (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document')); + + // dynamically create HTML elements if needed + this.e_div = f_getElement('tcal'); + if (!this.e_div) { + this.e_div = document.createElement("DIV"); + this.e_div.id = 'tcal'; + document.body.appendChild(this.e_div); + } + this.e_shade = f_getElement('tcalShade'); + if (!this.e_shade) { + this.e_shade = document.createElement("DIV"); + this.e_shade.id = 'tcalShade'; + document.body.appendChild(this.e_shade); + } + this.e_iframe = f_getElement('tcalIF') + if (b_ieFix && !this.e_iframe) { + this.e_iframe = document.createElement("IFRAME"); + this.e_iframe.style.filter = 'alpha(opacity=0)'; + this.e_iframe.id = 'tcalIF'; + this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif'; + document.body.appendChild(this.e_iframe); + } + + // hide all calendars + f_tcalHideAll(); + + // generate HTML and show calendar + this.e_icon = f_getElement(this.s_iconId); + if (!this.f_update()) + return; + + this.e_div.style.visibility = 'visible'; + this.e_shade.style.visibility = 'visible'; + if (this.e_iframe) + this.e_iframe.style.visibility = 'visible'; + + // change icon and status + this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif'; + this.e_icon.title = 'Close Calendar'; + this.b_visible = true; +} + +function f_tcalHide (n_date) { + if (n_date) + this.e_input.value = this.f_generDate(new Date(n_date)); + + // no action if not visible + if (!this.b_visible) + return; + + // hide elements + if (this.e_iframe) + this.e_iframe.style.visibility = 'hidden'; + if (this.e_shade) + this.e_shade.style.visibility = 'hidden'; + this.e_div.style.visibility = 'hidden'; + + // change icon and status + this.e_icon = f_getElement(this.s_iconId); + this.e_icon.src = this.a_tpl.imgpath + 'cal.gif'; + this.e_icon.title = 'Open Calendar'; + this.b_visible = false; +} + +function f_tcalToggle () { + return this.b_visible ? this.f_hide() : this.f_show(); +} + +function f_tcalUpdate (d_date) { + + var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date()); + var d_selected = this.e_input.value == '' + ? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today) + : this.f_parseDate(this.e_input.value); + + // figure out date to display + if (!d_date) + // selected by default + d_date = d_selected; + else if (typeof(d_date) == 'number') + // get from number + d_date = f_tcalResetTime(new Date(d_date)); + else if (typeof(d_date) == 'string') + // parse from string + this.f_parseDate(d_date); + + if (!d_date) return false; + + // first date to display + var d_firstday = new Date(d_date); + d_firstday.setDate(1); + d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7); + + var a_class, s_html = '<table class="ctrl"><tbody><tr>' + + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '') + + '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>' + + this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear() + + '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>' + + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '') + + '</tr></tbody></table><table><tbody><tr class="wd">'; + + // print weekdays titles + for (var i = 0; i < 7; i++) + s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>'; + s_html += '</tr>' ; + + // print calendar table + var n_date, n_month, d_current = new Date(d_firstday); + while (d_current.getMonth() == d_date.getMonth() || + d_current.getMonth() == d_firstday.getMonth()) { + + // print row heder + s_html +='<tr>'; + for (var n_wday = 0; n_wday < 7; n_wday++) { + + a_class = []; + n_date = d_current.getDate(); + n_month = d_current.getMonth(); + + // other month + if (d_current.getMonth() != d_date.getMonth()) + a_class[a_class.length] = 'othermonth'; + // weekend + if (d_current.getDay() == 0 || d_current.getDay() == 6) + a_class[a_class.length] = 'weekend'; + // today + if (d_current.valueOf() == d_today.valueOf()) + a_class[a_class.length] = 'today'; + // selected + if (d_current.valueOf() == d_selected.valueOf()) + a_class[a_class.length] = 'selected'; + + s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>' + + d_current.setDate(++n_date); + while (d_current.getDate() != n_date && d_current.getMonth() == n_month) { + d_current.setHours(d_current.getHours + 1); + d_current = f_tcalResetTime(d_current); + } + } + // print row footer + s_html +='</tr>'; + } + s_html +='</tbody></table>'; + + // update HTML, positions and sizes + this.e_div.innerHTML = s_html; + + var n_width = this.e_div.offsetWidth; + var n_height = this.e_div.offsetHeight; + var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight; + var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth; + if (n_left < 0) n_left = 0; + + this.e_div.style.left = n_left + 'px'; + this.e_div.style.top = n_top + 'px'; + + this.e_shade.style.width = (n_width + 8) + 'px'; + this.e_shade.style.left = (n_left - 1) + 'px'; + this.e_shade.style.top = (n_top - 1) + 'px'; + this.e_shade.innerHTML = b_ieFix + ? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>' + : '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>'; + + if (this.e_iframe) { + this.e_iframe.style.left = n_left + 'px'; + this.e_iframe.style.top = n_top + 'px'; + this.e_iframe.style.width = (n_width + 6) + 'px'; + this.e_iframe.style.height = (n_height + 6) +'px'; + } + return true; +} + +function f_getPosition (e_elemRef, s_coord) { + var n_pos = 0, n_offset, + e_elem = e_elemRef; + + while (e_elem) { + n_offset = e_elem["offset" + s_coord]; + n_pos += n_offset; + e_elem = e_elem.offsetParent; + } + // margin correction in some browsers + if (b_ieMac) + n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']); + else if (b_safari) + n_pos -= n_offset; + + e_elem = e_elemRef; + while (e_elem != document.body) { + n_offset = e_elem["scroll" + s_coord]; + if (n_offset && e_elem.style.overflow == 'scroll') + n_pos -= n_offset; + e_elem = e_elem.parentNode; + } + return n_pos; +} + +function f_tcalRelDate (d_date, d_diff, s_units) { + var s_units = (s_units == 'y' ? 'FullYear' : 'Month'); + var d_result = new Date(d_date); + d_result['set' + s_units](d_date['get' + s_units]() + d_diff); + if (d_result.getDate() != d_date.getDate()) + d_result.setDate(0); + return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"'; +} + +function f_tcalHideAll () { + for (var i = 0; i < window.A_TCALSIDX.length; i++) + window.A_TCALSIDX[i].f_hide(); +} + +function f_tcalResetTime (d_date) { + d_date.setHours(0); + d_date.setMinutes(0); + d_date.setSeconds(0); + d_date.setMilliseconds(0); + return d_date; +} + +f_getElement = document.all ? + function (s_id) { return document.all[s_id] } : + function (s_id) { return document.getElementById(s_id) }; + +if (document.addEventListener) + window.addEventListener('scroll', f_tcalHideAll, false); +if (window.attachEvent) + window.attachEvent('onscroll', f_tcalHideAll); + +// global variables +var s_userAgent = navigator.userAgent.toLowerCase(), + re_webkit = /WebKit\/(\d+)/i; +var b_mac = s_userAgent.indexOf('mac') != -1, + b_ie5 = s_userAgent.indexOf('msie 5') != -1, + b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1; +var b_ieFix = b_ie5 || b_ie6, + b_ieMac = b_mac && b_ie5, + b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500; diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/call_report_export.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/call_report_export.php new file mode 100644 index 00000000..f4599238 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/call_report_export.php @@ -0,0 +1,598 @@ +<?php +# call_report_export.php +# +# displays options to select for downloading of leads and their vicidial_log +# and/or vicidial_closer_log information by status, list_id and date range. +# downloads to a flat text file that is tab delimited +# +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90310-2247 - First build +# 90330-1343 - Added more debug info, bug fixes +# 90508-0644 - Changed to PHP long tags +# 90721-1137 - Added rank and owner as vicidial_list fields +# 91121-0253 - Added list name, list description and status name +# 100119-1039 - Filtered comments for \n newlines +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["campaign"])) {$campaign=$_GET["campaign"];} + elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} + elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +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 (strlen($shift)<2) {$shift='ALL';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and export_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); +# Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password or no export report permission: |$PHP_AUTH_USER|\n"; + exit; + } + + +##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### +if ($run_export > 0) + { + $US='_'; + $MT[0]=''; + $ip = getenv("REMOTE_ADDR"); + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $FILE_TIME = date("Ymd-His"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $campaign_ct = count($campaign); + $group_ct = count($group); + $user_group_ct = count($user_group); + $list_ct = count($list_id); + $status_ct = count($status); + $campaign_string='|'; + $group_string='|'; + $user_group_string='|'; + $list_string='|'; + $status_string='|'; + + $i=0; + while($i < $campaign_ct) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + $i++; + } + if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) + { + $campaign_SQL = "campaign_id IN('')"; + $RUNcampaign=0; + } + else + { + $campaign_SQL = eregi_replace(",$",'',$campaign_SQL); + $campaign_SQL = "and vl.campaign_id IN($campaign_SQL)"; + $RUNcampaign++; + } + + $i=0; + 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 = "campaign_id IN('')"; + $RUNgroup=0; + } + else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and vl.campaign_id IN($group_SQL)"; + $RUNgroup++; + } + + $i=0; + while($i < $user_group_ct) + { + $user_group_string .= "$user_group[$i]|"; + $user_group_SQL .= "'$user_group[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $user_group_SQL = ""; + } + else + { + $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + $user_group_SQL = "and vl.user_group IN($user_group_SQL)"; + } + + $i=0; + while($i < $list_ct) + { + $list_string .= "$list_id[$i]|"; + $list_SQL .= "'$list_id[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$list_string) ) or ($list_ct < 1) ) + { + $list_SQL = ""; + } + else + { + $list_SQL = eregi_replace(",$",'',$list_SQL); + $list_SQL = "and vi.list_id IN($list_SQL)"; + } + + $i=0; + while($i < $status_ct) + { + $status_string .= "$status[$i]|"; + $status_SQL .= "'$status[$i]',"; + $i++; + } + if ( (ereg("--ALL--",$status_string) ) or ($status_ct < 1) ) + { + $status_SQL = ""; + } + else + { + $status_SQL = eregi_replace(",$",'',$status_SQL); + $status_SQL = "and vl.status IN($status_SQL)"; + } + + + if ($DB > 0) + { + echo "<BR>\n"; + echo "$campaign_ct|$campaign_string|$campaign_SQL\n"; + echo "<BR>\n"; + echo "$group_ct|$group_string|$group_SQL\n"; + echo "<BR>\n"; + echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; + echo "<BR>\n"; + echo "$list_ct|$list_string|$list_SQL\n"; + echo "<BR>\n"; + echo "$status_ct|$status_string|$status_SQL\n"; + echo "<BR>\n"; + } + + $outbound_calls=0; + $export_rows=''; + $k=0; + if ($RUNcampaign > 0) + { + $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $outbound_to_print = mysql_num_rows($rslt); + if ($outbound_to_print < 1) + { + echo "There are no outbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $outbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $i++; + $k++; + $outbound_calls++; + } + } + } + + if ($RUNgroup > 0) + { + $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmt\n";} + $inbound_to_print = mysql_num_rows($rslt); + if ( ($inbound_to_print < 1) and ($outbound_calls < 1) ) + { + echo "There are no inbound calls during this time period for these parameters\n"; + exit; + } + else + { + $i=0; + while ($i < $inbound_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; + $i++; + $k++; + } + } + } + + + if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) ) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $TXTfilename = "EXPORT_CALL_REPORT_$FILE_TIME.txt"; + + // We'll be outputting a TXT file + header('Content-type: application/octet-stream'); + + // It will be called LIST_101_20090209-121212.txt + header("Content-Disposition: attachment; filename=\"$TXTfilename\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + ob_clean(); + flush(); + + $i=0; + while ($k > $i) + { + $ex_list_name=''; + $ex_list_description=''; + $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_list_name = $row[0]; + $ex_list_description = $row[1]; + } + + $ex_status_name=''; + $stmt = "SELECT status_name FROM vicidial_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + else + { + $stmt = "SELECT status_name FROM vicidial_campaign_statuses where status='$export_status[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ex_list_ct = mysql_num_rows($rslt); + if ($ex_list_ct > 0) + { + $row=mysql_fetch_row($rslt); + $ex_status_name = $row[0]; + } + } + + echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name\r\n"; + $i++; + } + } + else + { + echo "There are no calls during this time period for these parameters\n"; + exit; + } + } +##### END RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### + + +else + { + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $STARTtime = date("U"); + if (!isset($group)) {$group = '';} + if (!isset($query_date)) {$query_date = $NOW_DATE;} + if (!isset($end_date)) {$end_date = $NOW_DATE;} + + $stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $campaigns_to_print = mysql_num_rows($rslt); + $i=0; + $LISTcampaigns[$i]='---NONE---'; + $i++; + $campaigns_to_print++; + while ($i < $campaigns_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTcampaigns[$i] =$row[0]; + $i++; + } + + $stmt="select group_id from vicidial_inbound_groups order by group_id;"; + $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); + $LISTgroups[$i] =$row[0]; + $i++; + } + + $stmt="select user_group from vicidial_user_groups order by user_group;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $user_groups_to_print = mysql_num_rows($rslt); + $i=0; + $LISTuser_groups[$i]='---ALL---'; + $i++; + $user_groups_to_print++; + while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTuser_groups[$i] =$row[0]; + $i++; + } + + $stmt="select list_id from vicidial_lists order by list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $lists_to_print = mysql_num_rows($rslt); + $i=0; + $LISTlists[$i]='---ALL---'; + $i++; + $lists_to_print++; + while ($i < $lists_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTlists[$i] =$row[0]; + $i++; + } + + $stmt="select status from vicidial_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $statuses_to_print = mysql_num_rows($rslt); + $i=0; + $LISTstatus[$i]='---ALL---'; + $i++; + $statuses_to_print++; + while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + } + + $stmt="select distinct status from vicidial_campaign_statuses order by status;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $Cstatuses_to_print = mysql_num_rows($rslt); + $j=0; + while ($j < $Cstatuses_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTstatus[$i] =$row[0]; + $i++; + $j++; + } + $statuses_to_print = ($statuses_to_print + $Cstatuses_to_print); + + echo "<HTML><HEAD>\n"; + + echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n"; + echo "<link rel=\"stylesheet\" href=\"calendar.css\">\n"; + + echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + echo "<TITLE>ADMINISTRATION: Export Calls Report"; + + ##### BEGIN Set variables to make header show properly ##### + $ADD = '100'; + $hh = 'lists'; + $LOGast_admin_access = '1'; + $SSoutbound_autodial_active = '1'; + $ADMIN = 'admin.php'; + $page_width='770'; + $section_width='750'; + $header_font_size='3'; + $subheader_font_size='2'; + $subcamp_font_size='2'; + $header_selected_bold='<b>'; + $header_nonselected_bold=''; + $lists_color = '#FFFF99'; + $lists_font = 'BLACK'; + $lists_color = '#E6E6E6'; + $subcamp_color = '#C6C6C6'; + ##### END Set variables to make header show properly ##### + + require("admin_header.php"); + + + echo "<CENTER><BR>\n"; + echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>Export Calls Report</B></FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; + echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; + echo "<INPUT TYPE=HIDDEN NAME=run_export VALUE=\"1\">"; + echo "<TABLE BORDER=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + + echo "<font class=\"select_bold\"><B>Date Range:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'query_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Monday week start + </script> + <?php + + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; + + ?> + <script language="JavaScript"> + var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'end_date' + }); + o_cal.a_tpl.yearscroll = false; + // o_cal.a_tpl.weekstart = 1; // Monday week start + </script> + <?php + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Campaigns:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=15 NAME=campaign[] multiple>\n"; + $o=0; + while ($campaigns_to_print > $o) + { + if (ereg("\|$LISTcampaigns[$o]\|",$campaign_string)) + {echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + else + {echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Inbound Groups:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=15 NAME=group[] multiple>\n"; + $o=0; + while ($groups_to_print > $o) + { + if (ereg("\|$LISTgroups[$o]\|",$group_string)) + {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + else + {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Lists:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=15 NAME=list_id[] multiple>\n"; + $o=0; + while ($lists_to_print > $o) + { + if (ereg("\|$LISTlists[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + else + {echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>Statuses:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=15 NAME=status[] multiple>\n"; + $o=0; + while ($statuses_to_print > $o) + { + if (ereg("\|$LISTstatus[$o]\|",$list_string)) + {echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + else + {echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n"; + echo "<font class=\"select_bold\"><B>User Groups:</B></font><BR><CENTER>\n"; + echo "<SELECT SIZE=15 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2>\n"; + + echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=3>\n"; + echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/count.htm b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/count.htm new file mode 100644 index 00000000..51f8a361 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/count.htm @@ -0,0 +1 @@ + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/dbconnect.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/dbconnect.php new file mode 100644 index 00000000..ca505cc0 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/dbconnect.php @@ -0,0 +1,63 @@ +<?php +# +# dbconnect.php version 2.2.0 +# +# database connection settings and some global web settings +# +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) + { + $DBCagc = file("/etc/astguiclient.conf"); + foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARserver_ip", $DBCline)) + {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + } +else + { + #defaults for DB connection + $VARDB_server = 'localhost'; + $VARDB_port = '3306'; + $VARDB_user = 'cron'; + $VARDB_pass = '1234'; + $VARDB_database = '1234'; + $WeBServeRRooT = '/usr/local/apache2/htdocs'; + } + +$link=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass"); +if (!$link) + { + die('MySQL connect ERROR: ' . mysql_error()); + } +mysql_select_db("$VARDB_database"); + +$local_DEF = 'Local/'; +$conf_silent_prefix = '7'; +$local_AMP = '@'; +$ext_context = 'demo'; +$recording_exten = '8309'; +$WeBRooTWritablE = '1'; +$non_latin = '0'; # set to 1 for UTF rules +$AM_shift_BEGIN = '03:45:00'; +$AM_shift_END = '17:45:00'; +$PM_shift_BEGIN = '17:45:01'; +$PM_shift_END = '23:59:59'; +$admin_qc_enabled = '0'; +?> diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/fcstats.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/fcstats.php new file mode 100644 index 00000000..555f3a40 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/fcstats.php @@ -0,0 +1,620 @@ +<?php +# fcstats.php +# +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 70813-1526 - First Build +# 71008-1436 - Added shift to be defined in dbconnect.php +# 71217-1128 - Changed method for calculating stats +# 71228-1140 - added percentages, cross-day start/stop +# 80328-1139 - adapted for basic fronter/closer stats +# 90310-2132 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +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["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"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +if (strlen($shift)<2) {$shift='ALL';} + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = 'CL_TEST_L';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$stmt="select group_id from vicidial_inbound_groups order by group_id;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + $i++; + } +?> + +<HTML> +<HEAD> +<STYLE type="text/css"> +<!-- + .green {color: white; background-color: green} + .red {color: white; background-color: red} + .blue {color: white; background-color: blue} + .purple {color: white; background-color: purple} +--> + </STYLE> + +<script language="JavaScript" src="calendar_db.js"></script> +<link rel="stylesheet" href="calendar.css"> + +<?php +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>In-Group Fronter-Closer Stats Report\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo ""; + +?> + +\n"; + $o=0; + while ($groups_to_print > $o) + { + if ($groups[$o] == $group) {echo "\n";} + else {echo "\n";} + $o++; + } +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           ALTERAR | RELATÓRIOS \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK ENVIAR\n";
+}
+
+else
+{
+#	$time_BEGIN=$AM_shift_BEGIN;
+#	$time_END=$AM_shift_END;
+#$query_date_BEGIN = "$query_date $time_BEGIN";   
+#$query_date_END = "$query_date $time_END";
+
+$Cqdate = explode('-',$query_date);
+
+if ($shift == 'AM') 
+	{
+	$query_date_BEGIN = date("Y-m-d H:i:s", mktime(1, 0, 0, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
+	$query_date_END = date("Y-m-d H:i:s", mktime(17, 45, 0, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
+	}
+if ($shift == 'PM') 
+	{
+	$query_date_BEGIN = date("Y-m-d H:i:s", mktime(17, 45, 1, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
+	$query_date_END = date("Y-m-d H:i:s", mktime(24, 59, 59, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
+	}
+if ($shift == 'ALL') 
+	{
+	$query_date_BEGIN = date("Y-m-d H:i:s", mktime(1, 0, 0, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
+	$query_date_END = date("Y-m-d H:i:s", mktime(24, 59, 59, $Cqdate[1], $Cqdate[2], $Cqdate[0]));
+	}
+
+echo "In-Group Fronter-Closer Stats Report                      $NOW_TIME\n";
+
+echo "\n";
+echo "---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
+
+$stmt="select count(*) 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 = 'SALE';";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$A1_points = ($row[0] * 1);
+$A1_points =	sprintf("%10s", $A1_points);
+$A1_tally =	sprintf("%10s", $row[0]);
+
+$TOT_tally = ($A1_tally + $A2_tally + $A3_tally + $A4_tally);
+$TOT_points = ($A1_points + $A2_points + $A3_points + $A4_points);
+$TOT_tally =	sprintf("%10s", $TOT_tally);
+$TOT_points =	sprintf("%10s", $TOT_points);
+
+echo "STATUS   CUSTOMERS\n";
+echo "SALES:   $A1_tally\n";
+
+echo "\n";
+
+
+
+
+
+
+
+
+
+##############################
+#########  FRONTER STATS
+
+$TOTagents=0;
+$TOTcalls=0;
+$TOTsales=0;
+$totA1=0;
+$totA2=0;
+$totA3=0;
+$totA4=0;
+$totA5=0;
+$totA6=0;
+$totA7=0;
+$totA8=0;
+$totA9=0;
+$totDROP=0;
+$totOTHER=0;
+
+echo "\n";
+echo "---------- FRONTER STATS\n";
+echo "+--------------------------+-------+--------+--------+------+------+------+\n";
+echo "| AGENTE                    |SUCCESS| XFERS  |SUCCESS%| SALE | DROP |OTHER |\n";
+echo "+--------------------------+-------+--------+--------+------+------+------+\n";
+
+#$stmt="select vicidial_xfer_log.user,full_name,count(*) from vicidial_xfer_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_xfer_log.user is not null and vicidial_xfer_log.user=vicidial_users.user group by vicidial_xfer_log.user;";
+$stmt="select user,count(distinct lead_id) from vicidial_xfer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$users_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $users_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+
+	$TOTcalls = ($TOTcalls + $row[1]);
+
+	$userRAW[$i]=$row[0];
+	$user[$i] =	sprintf("%-6s", $row[0]);while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
+	$USERcallsRAW[$i] =	$row[1];
+	$USERcalls[$i] =	sprintf("%6s", $row[1]);
+
+	$i++;
+	}
+
+$i=0;
+while ($i < $users_to_print)
+	{
+	$stmt="select full_name from vicidial_users where user='$userRAW[$i]';";
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$names_to_print = mysql_num_rows($rslt);
+	if ($names_to_print > 0)
+		{
+		$row=mysql_fetch_row($rslt);
+		if ($non_latin < 1)
+			{
+			 $full_name[$i] =	sprintf("%-15s", $row[0]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}	
+			}
+		else
+			{
+			 $full_name[$i] =	sprintf("%-45s", $row[0]); while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}	
+			}
+		}
+	else
+		{$full_name[$i] = '               ';}
+
+	$A1=0; $A2=0; $A3=0; $A4=0; $A5=0; $A6=0; $A7=0; $A8=0; $A9=0; $DROP=0; $OTHER=0; $sales=0; 
+	$stmt="select vc.status,count(distinct vc.lead_id) from vicidial_xfer_log vx, vicidial_closer_log vc where vx.call_date >= '$query_date_BEGIN' and vx.call_date <= '$query_date_END' and vc.call_date >= '$query_date_BEGIN' and vc.call_date <= '$query_date_END' and  vc.campaign_id='" . mysql_real_escape_string($group) . "' and vx.campaign_id='" . mysql_real_escape_string($group) . "' and vx.user='$userRAW[$i]' and vc.lead_id=vx.lead_id and vc.xfercallid=vx.xfercallid group by vc.status;";
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$lead_ids_to_print = mysql_num_rows($rslt);
+	$j=0;
+	while ($j < $lead_ids_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$recL=0;
+		if ( ($row[0]=='SALE') and ($recL < 1) ) {$A1=$row[1]; $recL++; $sales=($sales + $row[1]);}
+	#	if ( ($row[0]=='A2') and ($recL < 1) ) {$A2=$row[1]; $recL++; $sales=($sales + $row[1]);}
+	#	if ( ($row[0]=='A3') and ($recL < 1) ) {$A3=$row[1]; $recL++; $sales=($sales + $row[1]);}
+	#	if ( ($row[0]=='A4') and ($recL < 1) ) {$A4=$row[1]; $recL++; $sales=($sales + $row[1]);}
+	#	if ( ($row[0]=='A5') and ($recL < 1) ) {$A5=$row[1]; $recL++;}
+	#	if ( ($row[0]=='A6') and ($recL < 1) ) {$A6=$row[1]; $recL++;}
+	#	if ( ($row[0]=='A7') and ($recL < 1) ) {$A7=$row[1]; $recL++;}
+	#	if ( ($row[0]=='A8') and ($recL < 1) ) {$A8=$row[1]; $recL++;}
+	#	if ( ($row[0]=='A9') and ($recL < 1) ) {$A9=$row[1]; $recL++;}
+		if ( ($row[0]=='DROP') and ($recL < 1) ) {$DROP=$row[1]; $recL++;}
+		if ($recL < 1) {$OTHER=($row[1] + $OTHER); $recL++;}
+		$j++;
+		}
+
+	$totA1 = ($totA1 + $A1);
+	$totA2 = ($totA2 + $A2);
+	$totA3 = ($totA3 + $A3);
+	$totA4 = ($totA4 + $A4);
+	$totA5 = ($totA5 + $A5);
+	$totA6 = ($totA6 + $A6);
+	$totA7 = ($totA7 + $A7);
+	$totA8 = ($totA8 + $A8);
+	$totA9 = ($totA9 + $A9);
+	$totDROP = ($totDROP + $DROP);
+	$totOTHER = ($totOTHER + $OTHER);
+	$TOTsales = ($TOTsales + $sales);
+
+	if ( ($USERcallsRAW[$i] > 0) and ($sales > 0) ) {$Spct = ( ($sales / $USERcallsRAW[$i]) * 100);}
+		else {$Spct=0;}
+	$Spct = round($Spct, 2);
+	$Spct =	sprintf("%01.2f", $Spct);
+	
+
+	$A1 =	sprintf("%4s", $A1);
+	$A2 =	sprintf("%4s", $A2);
+	$A3 =	sprintf("%4s", $A3);
+	$A4 =	sprintf("%4s", $A4);
+	$A5 =	sprintf("%4s", $A5);
+	$A6 =	sprintf("%4s", $A6);
+	$A7 =	sprintf("%4s", $A7);
+	$A8 =	sprintf("%4s", $A8);
+	$A9 =	sprintf("%4s", $A9);
+	$DROP =	sprintf("%4s", $DROP);
+	$OTHER =	sprintf("%4s", $OTHER);
+	$sales =	sprintf("%5s", $sales);
+	$Spct =	sprintf("%6s", $Spct);
+
+	echo "| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n";
+
+	$i++;
+	}
+
+
+if ( ($TOTcalls > 0) and ($TOTsales > 0) ) {$totSpct = ( ($TOTsales / $TOTcalls) * 100);}
+	else {$totSpct=0;}
+$totSpct = round($totSpct, 2);
+$totSpct =	sprintf("%01.2f", $totSpct);
+$totSpct =	sprintf("%6s", $totSpct);
+	
+$TOTagents =	sprintf("%6s", $i);
+$TOTcalls =		sprintf("%6s", $TOTcalls);
+$TOTsales =		sprintf("%5s", $TOTsales);
+$totA1 =		sprintf("%5s", $totA1);
+$totA2 =		sprintf("%5s", $totA2);
+$totA3 =		sprintf("%5s", $totA3);
+$totA4 =		sprintf("%5s", $totA4);
+$totA5 =		sprintf("%5s", $totA5);
+$totA6 =		sprintf("%5s", $totA6);
+$totA7 =		sprintf("%5s", $totA7);
+$totA8 =		sprintf("%5s", $totA8);
+$totA9 =		sprintf("%5s", $totA9);
+$totDROP =		sprintf("%5s", $totDROP);
+$totOTHER =		sprintf("%5s", $totOTHER);
+
+
+$stmt="select avg(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) . "';";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+$AVGwait = $row[0];
+$AVGwait_M = ($AVGwait / 60);
+$AVGwait_M = round($AVGwait_M, 2);
+$AVGwait_M_int = intval("$AVGwait_M");
+$AVGwait_S = ($AVGwait_M - $AVGwait_M_int);
+$AVGwait_S = ($AVGwait_S * 60);
+$AVGwait_S = round($AVGwait_S, 0);
+if ($AVGwait_S < 10) {$AVGwait_S = "0$AVGwait_S";}
+$AVGwait_MS = "$AVGwait_M_int:$AVGwait_S";
+$AVGwait =		sprintf("%6s", $AVGwait_MS);
+
+
+echo "+--------------------------+-------+--------+--------+------+------+------+\n";
+echo "| TOTAL FRONTERS: $TOTagents   | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n";
+echo "+--------------------------+-------+--------+--------+------+------+------+\n";
+echo "|                          Average time in Queue for customers:    $AVGwait |\n";
+echo "+--------------------------+-------+--------+--------+------+------+------+\n";
+
+
+
+
+
+##############################
+#########  CLOSER STATS
+
+$TOTagents=0;
+$TOTcalls=0;
+$totA1=0;
+$totA2=0;
+$totA3=0;
+$totA4=0;
+$totA5=0;
+$totA6=0;
+$totA7=0;
+$totA8=0;
+$totA9=0;
+$totDROP=0;
+$totOTHER=0;
+$TOTsales=0;
+
+echo "\n";
+echo "---------- CLOSER STATS\n";
+echo "+--------------------------+--------+------+------+------+------+-------+\n";
+echo "| AGENTE                    | CALLS  | SALE | DROP |OTHER | SALE | CONV %|\n";
+echo "+--------------------------+--------+------+------+------+------+-------+\n";
+
+$stmt="select user,count(*) 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 user is not null group by user;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$users_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $users_to_print)
+	{
+	$row=mysql_fetch_row($rslt);
+
+	$TOTcalls = ($TOTcalls + $row[1]);
+	$userRAW[$i]=$row[0];
+	$user[$i] =	sprintf("%-6s", $row[0]);while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
+	$USERcalls[$i] =	sprintf("%6s", $row[1]);
+	$USERcallsRAW[$i] =	$row[1];
+
+	$i++;
+	}
+
+$i=0;
+while ($i < $users_to_print)
+	{
+	$stmt="select full_name from vicidial_users where user='$userRAW[$i]';";
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$names_to_print = mysql_num_rows($rslt);
+	if ($names_to_print > 0)
+		{
+		$row=mysql_fetch_row($rslt);
+		if ($non_latin < 1)
+			{
+			 $full_name[$i] =	sprintf("%-15s", $row[0]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}	
+			}
+		else
+			{
+			 $full_name[$i] =	sprintf("%-45s", $row[0]); while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}	
+			}
+		}
+	else
+		{$full_name[$i] = '               ';}
+
+	$A1=0; $A2=0; $A3=0; $A4=0; $A5=0; $A6=0; $A7=0; $A8=0; $A9=0; $DROP=0; $OTHER=0; $sales=0; $uTOP=0; $uBOT=0; $points=0;
+	$stmt="select status,count(*) 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 user='$userRAW[$i]' group by status;";
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$lead_ids_to_print = mysql_num_rows($rslt);
+	$j=0;
+	while ($j < $lead_ids_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$recL=0;
+		if ( ($row[0]=='SALE') and ($recL < 1) ) 
+			{
+			$A1=$row[1]; $recL++; 
+			$sales=($sales + $row[1]);
+			$points = ($points + ($row[1] * 1) );
+			}
+		if ( ($row[0]=='A2') and ($recL < 1) ) 
+			{
+			$A2=$row[1]; $recL++; 
+			$sales=($sales + $row[1]); 
+			$uTOP=($uTOP + $row[1]);
+			$points = ($points + ($row[1] * 2) );
+			}
+		if ( ($row[0]=='A3') and ($recL < 1) ) 
+			{
+			$A3=$row[1]; $recL++; 
+			$sales=($sales + $row[1]); 
+			$uBOT=($uBOT + $row[1]);
+			$points = ($points + ($row[1] * 2) );
+			}
+		if ( ($row[0]=='A4') and ($recL < 1) ) 
+			{
+			$A4=$row[1]; $recL++; 
+			$sales=($sales + $row[1]); 
+			$uTOP=($uTOP + $row[1]); 
+			$uBOT=($uBOT + $row[1]);
+			$points = ($points + ($row[1] * 3) );
+			}
+#		if ( ($row[0]=='A5') and ($recL < 1) ) {$A5=$row[1]; $recL++;}
+#		if ( ($row[0]=='A6') and ($recL < 1) ) {$A6=$row[1]; $recL++;}
+#		if ( ($row[0]=='A7') and ($recL < 1) ) {$A7=$row[1]; $recL++;}
+#		if ( ($row[0]=='A8') and ($recL < 1) ) {$A8=$row[1]; $recL++;}
+#		if ( ($row[0]=='A9') and ($recL < 1) ) {$A9=$row[1]; $recL++;}
+		if ( ($row[0]=='DROP') and ($recL < 1) ) {$DROP=$row[1]; $recL++;}
+		if ($recL < 1) {$OTHER=($row[1] + $OTHER); $recL++;}
+		
+		$j++;
+		}
+
+	$totA1 = ($totA1 + $A1);	$TOTsales = ($TOTsales + $A1);
+	$totA2 = ($totA2 + $A2);	$TOTsales = ($TOTsales + $A2);	$totTOP = ($totTOP + $A2);
+	$totA3 = ($totA3 + $A3);	$TOTsales = ($TOTsales + $A3);	$totBOT = ($totBOT + $A3);
+	$totA4 = ($totA4 + $A4);	$TOTsales = ($TOTsales + $A4);	$totTOP = ($totTOP + $A4);	$totBOT = ($totBOT + $A4);
+	$totA5 = ($totA5 + $A5);
+	$totA6 = ($totA6 + $A6);
+	$totA7 = ($totA7 + $A7);
+	$totA8 = ($totA8 + $A8);
+	$totA9 = ($totA9 + $A9);
+	$totDROP = ($totDROP + $DROP);
+	$totOTHER = ($totOTHER + $OTHER);
+	$totPOINTS = ($totPOINTS + $points);
+
+	if ( ($USERcallsRAW[$i] > 0) and ($sales > 0) ) {$Cpct = ( ($sales / ( ($USERcallsRAW[$i] - 0) - $DROP) ) * 100);}
+		else {$Cpct=0;}
+	$Cpct = round($Cpct, 2);
+	$Cpct =	sprintf("%01.2f", $Cpct);
+	$Cpct =	sprintf("%6s", $Cpct);
+
+	if ( ($sales > 0) and ($uTOP > 0) ) {$TOP = ( ($uTOP / $sales) * 100);}
+		else {$TOP=0;}
+	$TOP = round($TOP, 0);
+	$TOP =	sprintf("%01.0f", $TOP);
+	$TOP =	sprintf("%3s", $TOP);
+
+	if ( ($sales > 0) and ($uBOT > 0) ) {$BOT = ( ($uBOT / $sales) * 100);}
+		else {$BOT=0;}
+	$BOT = round($BOT, 0);
+	$BOT =	sprintf("%01.0f", $BOT);
+	$BOT =	sprintf("%3s", $BOT);
+
+	if ( ($USERcallsRAW[$i] > 0) and ($points > 0) ) {$ppc = ($points / ( ($USERcallsRAW[$i] - 0) - $DROP) );}
+		else {$ppc=0;}
+	$ppc = round($ppc, 2);
+	$ppc =	sprintf("%01.2f", $ppc);
+	$ppc =	sprintf("%4s", $ppc);
+
+
+	$A1 =	sprintf("%4s", $A1);
+	$A2 =	sprintf("%4s", $A2);
+	$A3 =	sprintf("%4s", $A3);
+	$A4 =	sprintf("%4s", $A4);
+	$A5 =	sprintf("%4s", $A5);
+	$A6 =	sprintf("%4s", $A6);
+	$A7 =	sprintf("%4s", $A7);
+	$A8 =	sprintf("%4s", $A8);
+	$A9 =	sprintf("%4s", $A9);
+	$DROP =	sprintf("%4s", $DROP);
+	$OTHER =	sprintf("%4s", $OTHER);
+	$sales =	sprintf("%4s", $sales);
+
+	echo "| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n";
+
+	$i++;
+	}
+
+
+if ( ($TOTcalls > 0) and ($TOTsales > 0) ) {$totCpct = ( ($TOTsales / ( ($TOTcalls - 0) - $totDROP) ) * 100);}
+	else {$totCpct=0;}
+$totCpct = round($totCpct, 2);
+$totCpct =	sprintf("%01.2f", $totCpct);
+$totCpct =	sprintf("%6s", $totCpct);
+		
+if ( ($TOTcalls > 0) and ($totPOINTS > 0) ) {$ppc = ($totPOINTS / ( ($TOTcalls - $totOTHER) - $totDROP) );}
+	else {$ppc=0;}
+$ppc = round($ppc, 2);
+$ppc =	sprintf("%01.2f", $ppc);
+$ppc =	sprintf("%4s", $ppc);
+		
+if ( ($TOTsales > 0) and ($totTOP > 0) ) {$TOP = ( ($totTOP / $TOTsales) * 100);}
+	else {$TOP=0;}
+$TOP = round($TOP, 0);
+$TOP =	sprintf("%01.0f", $TOP);
+$TOP =	sprintf("%3s", $TOP);
+
+if ( ($TOTsales > 0) and ($totBOT > 0) ) {$BOT = ( ($totBOT / $TOTsales) * 100);}
+	else {$BOT=0;}
+$BOT = round($BOT, 0);
+$BOT =	sprintf("%01.0f", $BOT);
+$BOT =	sprintf("%3s", $BOT);
+
+$TOTagents =	sprintf("%6s", $i);
+$TOTcalls =		sprintf("%6s", $TOTcalls);
+$totA1 =		sprintf("%5s", $totA1);
+$totA2 =		sprintf("%5s", $totA2);
+$totA3 =		sprintf("%5s", $totA3);
+$totA4 =		sprintf("%5s", $totA4);
+$totA5 =		sprintf("%5s", $totA5);
+$totA6 =		sprintf("%5s", $totA6);
+$totA7 =		sprintf("%5s", $totA7);
+$totA8 =		sprintf("%5s", $totA8);
+$totA9 =		sprintf("%5s", $totA9);
+$totDROP =		sprintf("%5s", $totDROP);
+$totOTHER =		sprintf("%5s", $totOTHER);
+$TOTsales =		sprintf("%5s", $TOTsales);
+
+echo "+--------------------------+--------+------+------+------+------+-------+\n";
+echo "| TOTAL CLOSERS:  $TOTagents   | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n";
+echo "+--------------------------+--------+------+------+------+------+-------+\n";
+
+
+
+
+
+
+
+
+
+$ENDtime = date("U");
+$RUNtime = ($ENDtime - $STARTtime);
+if ($DB) {echo "\nRun Time: $RUNtime seconds\n";}
+}
+
+
+
+
+
+?>
+
+
+ + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/functions.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/functions.php new file mode 100644 index 00000000..f3a6e7b7 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/functions.php @@ -0,0 +1,91 @@ + LICENSE: AGPLv2 +# +# +# CHANGES: +# 90524-1503 - First Build +# + +##### reformat seconds into HH:MM:SS or MM:SS ##### +function sec_convert($sec,$precision) + { + $sec = round($sec,0); + + if ($sec < 1) + { + return "0:00"; + } + else + { + if ($sec < 3600) {$precision='M';} + + if ($precision == 'H') + { + $Fhours_H = ($sec / 3600); + $Fhours_H_int = floor($Fhours_H); + $Fhours_H_int = intval("$Fhours_H_int"); + $Fhours_M = ($Fhours_H - $Fhours_H_int); + $Fhours_M = ($Fhours_M * 60); + $Fhours_M_int = floor($Fhours_M); + $Fhours_M_int = intval("$Fhours_M_int"); + $Fhours_S = ($Fhours_M - $Fhours_M_int); + $Fhours_S = ($Fhours_S * 60); + $Fhours_S = round($Fhours_S, 0); + if ($Fhours_S < 10) {$Fhours_S = "0$Fhours_S";} + if ($Fhours_M_int < 10) {$Fhours_M_int = "0$Fhours_M_int";} + $Ftime = "$Fhours_H_int:$Fhours_M_int:$Fhours_S"; + } + if ($precision == 'M') + { + $Fminutes_M = ($sec / 60); + $Fminutes_M_int = floor($Fminutes_M); + $Fminutes_M_int = intval("$Fminutes_M_int"); + $Fminutes_S = ($Fminutes_M - $Fminutes_M_int); + $Fminutes_S = ($Fminutes_S * 60); + $Fminutes_S = round($Fminutes_S, 0); + if ($Fminutes_S < 10) {$Fminutes_S = "0$Fminutes_S";} + $Ftime = "$Fminutes_M_int:$Fminutes_S"; + } + if ($precision == 'S') + { + $Ftime = $sec; + } + return "$Ftime"; + } + } + + +##### counts like elements in an array, optional sort asc desc ##### +function array_group_count($array, $sort = false) + { + $tally_array = array(); + + $i=0; + foreach (array_unique($array) as $value) + { + $count = 0; + foreach ($array as $element) + { + if ($element == "$value") + {$count++;} + } + + $count = sprintf("%010s", $count); + $tally_array[$i] = "$count $value"; + $i++; + } + + if ( $sort == 'desc' ) + {rsort($tally_array);} + elseif ( $sort == 'asc' ) + {sort($tally_array);} + + return $tally_array; + } + +?> \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/group_hourly_stats.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/group_hourly_stats.php new file mode 100644 index 00000000..ee678b65 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/group_hourly_stats.php @@ -0,0 +1,295 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 60620-1014 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# 90310-2138 - Added admin header +# 90508-0644 - Changed to PHP long tags +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["date_with_hour"])) {$date_with_hour=$_GET["date_with_hour"];} + elseif (isset($_POST["date_with_hour"])) {$date_with_hour=$_POST["date_with_hour"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$date_with_hour_default = date("Y-m-d H"); +$date_no_hour_default = $TODAY; + +if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} + $date_no_hour = $date_with_hour; + $date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour); +if (!isset($begin_date)) {$begin_date = $TODAY;} +if (!isset($end_date)) {$end_date = $TODAY;} + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + else + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + +# $stmt="SELECT full_name from vicidial_users where user='$user';"; +# $rslt=mysql_query($stmt, $link); +# $row=mysql_fetch_row($rslt); +# $full_name = $row[0]; + + } + + + + +?> + + + +ADMINISTRATION: Estatísticas Horárias do Grupo +<?php + +##### BEGIN Set variables to make header show properly ##### +$ADD = '311111'; +$hh = 'usergroups'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$usergroups_color = '#FFFF99'; +$usergroups_font = 'BLACK'; +$usergroups_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +?> + + +<CENTER> +<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   Estatísticas Horárias do Grupo <?php echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> + + + + +<?php + +if ( ($group) and ($status) and ($date_with_hour) ) +{ +$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' order by full_name desc;"; + if ($DB) {echo "$stmt\n";} +$rslt=mysql_query($stmt, $link); +$tsrs_to_print = mysql_num_rows($rslt); + $o=0; + while($o < $tsrs_to_print) + { + $row=mysql_fetch_row($rslt); + $VDuser[$o] = "$row[0]"; + $VDname[$o] = "$row[1]"; + $o++; + } + + $o=0; + while($o < $tsrs_to_print) + { + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VDtotal[$o] = "$row[0]"; + + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VDday[$o] = "$row[0]"; + + $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VDcount[$o] = "$row[0]"; + $o++; + } + +echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; + +echo "<br><center>\n"; + +echo "<B>CONTAGEM DE HORAS TSR: <a href=\"./admin.php?ADD=3111&group_id=$group\">$group</a> | $status | $date_with_hour | $date_no_hour</B>\n"; + +echo "<center><TABLE width=600 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=2>TSR </td><td align=left><font size=2>ID </td><td align=right><font size=2>   $status</td><td align=right><font size=2>   TOTAL DE CHAMADAS</td><td align=right><font size=2>   $status DAY</td><td align=right><font size=2>     </td></tr>\n"; + + $day_calls=0; + $hour_calls=0; + $total_calls=0; + $o=0; + while($o < $tsrs_to_print) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "<tr $bgcolor><td><font size=2>$VDuser[$o]</td>"; + echo "<td align=left><font size=2> $VDname[$o]</td>\n"; + echo "<td align=right><font size=2> $VDcount[$o]</td>\n"; + echo "<td align=right><font size=2> $VDtotal[$o]</td>\n"; + echo "<td align=right><font size=2> $VDday[$o]</td>\n"; + echo "<td align=right><font size=1><a href=\"./admin.php?ADD=3&user=$VDuser[$o]\">ALTERAR</a> | <a href=\"./user_stats.php?user=$VDuser[$o]\">ESTATÍSTICAS</a></td></tr>\n"; + $total_calls = ($total_calls + $VDtotal[$o]); + $hour_calls = ($hour_calls + $VDcount[$o]); + $day_calls = ($day_calls + $VDday[$o]); + + $o++; + } + +echo "<tr><td><font size=2>TOTAL </td><td align=right><font size=2> $status </td><td align=right><font size=2> $hour_calls</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $day_calls</td></tr>\n"; + + +} + +echo "</TABLE></center>\n"; +echo "<br><br>\n"; + + + echo "<br>Por favor entre com o grupo que deseja visualizar estatísticas horárias: <form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=DB value=$DB>\n"; + echo "group: <select size=1 name=group>\n"; + + $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; + $rslt=mysql_query($stmt, $link); + $groups_to_print = mysql_num_rows($rslt); + $o=0; + $groups_list=''; + while ($groups_to_print > $o) { + $rowx=mysql_fetch_row($rslt); + if ($group == $group) + {$groups_list .= "<option selected value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";} + else + {$groups_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";} + $o++; + } + echo "$groups_list</select><br>\n"; + echo "status: <input type=text name=status size=10 maxlength=10 value=\"$status\">   (example: XFER)<br>\n"; + echo "date with hour: <input type=text name=date_with_hour size=14 maxlength=13 value=\"$date_with_hour\">   (example: 2004-06-25 14)<br>\n"; + echo "<input type=submit name=submit value=ENVIAR>\n"; + echo "<BR><BR><BR>\n"; + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "\n\n\n<br><br><br>\n\n"; + + +echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; + + +?> + + +</TD></TR></TABLE> +</body> +</html> + +<?php + +exit; + + + +?> + + + + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/help.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/help.gif new file mode 100644 index 00000000..5575d7c8 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/help.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/cal.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/cal.gif new file mode 100644 index 00000000..8526cf5d Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/cal.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/help.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/help.gif new file mode 100644 index 00000000..5575d7c8 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/help.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/next_mon.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/next_mon.gif new file mode 100644 index 00000000..14c622f9 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/next_mon.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/next_year.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/next_year.gif new file mode 100644 index 00000000..b66f2888 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/next_year.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/no_cal.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/no_cal.gif new file mode 100644 index 00000000..adc58e2a Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/no_cal.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/pixel.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/pixel.gif new file mode 100644 index 00000000..46a2cf08 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/pixel.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/prev_mon.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/prev_mon.gif new file mode 100644 index 00000000..12ce7ff5 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/prev_mon.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/prev_year.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/prev_year.gif new file mode 100644 index 00000000..c726b0e4 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/prev_year.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_bl.png b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_bl.png new file mode 100644 index 00000000..29bd5543 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_bl.png differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_bm.png b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_bm.png new file mode 100644 index 00000000..5c4e0af9 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_bm.png differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_br.png b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_br.png new file mode 100644 index 00000000..ce8a2fad Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_br.png differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_mr.png b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_mr.png new file mode 100644 index 00000000..4594bc4e Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_mr.png differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_tr.png b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_tr.png new file mode 100644 index 00000000..2e598c95 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/images/shade_tr.png differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/list_download.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/list_download.php new file mode 100644 index 00000000..3ecaca97 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/list_download.php @@ -0,0 +1,133 @@ +<?php +# list_download.php +# +# downloads the entire contents of a vicidial list ID to a flat text file +# that is tab delimited +# +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90209-1310 - First build +# 90508-0644 - Changed to PHP long tags +# 90721-1238 - Added rank and owner as vicidial_list fields +# 100119-1039 - Filtered comments for \n newlines +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +if (strlen($shift)<2) {$shift='ALL';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); +# Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos or no list download permission: |$PHP_AUTH_USER|\n"; + exit; + } + +$stmt="select count(*) from vicidial_list where list_id='$list_id';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$count_to_print = mysql_num_rows($rslt); +if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + +if ($leads_count < 1) + { + echo "There are no leads in list_id: $list_id\n"; + exit; + } + +$US='_'; +$MT[0]=''; +$ip = getenv("REMOTE_ADDR"); +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_TIME = date("Ymd-His"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +### LOG INSERTION Admin Log Table ### +$SQL_log = "$stmt|$stmtA|"; +$SQL_log = ereg_replace(';','',$SQL_log); +$SQL_log = addslashes($SQL_log); +$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT LIST', event_sql=\"$SQL_log\", event_notes='';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + + +$TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; + +// We'll be outputting a TXT file +header('Content-type: application/octet-stream'); + +// It will be called LIST_101_20090209-121212.txt +header("Content-Disposition: attachment; filename=\"$TXTfilename\""); +header('Expires: 0'); +header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); +header('Pragma: public'); +ob_clean(); +flush(); + +$stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$leads_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $leads_to_print) + { + $row=mysql_fetch_row($rslt); + + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + + echo "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\r\n"; + + $i++; + } + +exit; + +?> \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloader.pl b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloader.pl new file mode 100644 index 00000000..72094d84 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloader.pl @@ -0,0 +1,1311 @@ +#!/usr/bin/perl +# +# listloader.pl version 2.2.0 +# +# Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# +# CHANGES +# 60616-1548 - Added listID override feature to force all leads into same list +# - Added gmt_offset_now lookup for each lead +# 60811-1232 - Changed to DBI +# 60811-1329 - changed to use /etc/astguiclient.conf for configs +# 60822-1121 - fixed for nonwritable directories +# 60906-1058 - added filter of non-digits in alt_phone field +# 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme +# 61128-1215 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug +# 70510-1518 - Added campaign and system duplicate check and phonecode override +# 80428-0144 - UTF8 cleanup +# 80713-0023 - added last_local_call_time field default of 2008-01-01 +# 90721-1425 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking +# 100118-0537 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# + +### begin parsing run-time options ### +if (length($ARGV[0])>1) + { + $i=0; + while ($#ARGV >= $i) + { + $args = "$args $ARGV[$i]"; + $i++; + } + + if ($args =~ /--help|-h/i) + { + print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; + + exit; + } + else + { + if ($args =~ /-duplicate-check/i) + {$dupcheck=1;} + if ($args =~ /-duplicate-campaign-check/i) + {$dupcheckcamp=1;} + if ($args =~ /-duplicate-system-check/i) + {$dupchecksys=1;} + if ($args =~ /-duplicate-tap-list-check/i) + {$duptapchecklist=1;} + if ($args =~ /-duplicate-tap-system-check/i) + {$duptapchecksys=1;} + if ($args =~ /-postal-code-gmt/i) + {$postalgmt=1;} + if ($args =~ /--forcelistid=/i) + { + @data_in = split(/--forcelistid=/,$args); + $forcelistid = $data_in[1]; + $forcelistid =~ s/ .*//gi; + print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; + } + else + {$forcelistid = '';} + + if ($args =~ /--forcephonecode=/i) + { + @data_in = split(/--forcephonecode=/,$args); + $forcephonecode = $data_in[1]; + $forcephonecode =~ s/ .*//gi; + print "\n----- FORCE PHONECODE OVERRIDE: $forcephonecode -----\n\n"; + } + else + {$forcephonecode = '';} + + if ($args =~ /--lead-file=/i) + { + @data_in = split(/--lead-file=/,$args); + $lead_file = $data_in[1]; + $lead_file =~ s/ .*//gi; + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } + else + {$lead_file = './vicidial_temp_file.xls';} + } + } +### end parsing run-time options ### + + +use Spreadsheet::ParseExcel; +use Time::Local; +use DBI; + + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = <conf>; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) + {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) + {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} + if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) + {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + +if (!$VARDB_port) {$VARDB_port='3306';} + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + +$|=0; +$secX = time(); + +($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +$year = ($year + 1900); +$mon++; +if ($hour < 10) {$hour = "0$hour";} +if ($min < 10) {$min = "0$min";} +if ($sec < 10) {$sec = "0$sec";} +if ($mon < 10) {$mon = "0$mon";} +if ($mday < 10) {$mday = "0$mday";} +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$pulldate="$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmtA = "SELECT use_non_latin FROM system_settings;"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $non_latin = "$aryA[0]"; + } +$sthA->finish(); +##### END SETTINGS LOOKUP ##### +########################################### + + +if ($non_latin > 0) {$affected_rows = $dbhA->do("SET NAMES 'UTF8'");} + + ### Grab Server values from the database + $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $DBSERVER_GMT = "$aryA[0]"; + if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} + $rec_count++; + } + $sthA->finish(); + + $LOCAL_GMT_OFF = $SERVER_GMT; + $LOCAL_GMT_OFF_STD = $SERVER_GMT; + +if ($isdst) {$LOCAL_GMT_OFF++;} +if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + + +$total=0; $good=0; $bad=0; +print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing Excel file...\n"; +open(STMT_FILE, "> $PATHlogs/listloader_stmts.txt"); + +$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); +my($iR, $iC, $oWkS, $oWkC); + +foreach $oWkS (@{$oBook->{Worksheet}}) { + for($iR = 0 ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { + + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user = ""; + $oWkC = $oWkS->{Cells}[$iR][0]; + if ($oWkC) {$vendor_lead_code=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][1]; + if ($oWkC) {$source_code=$oWkC->Value; } + $source_id=$source_code; + $oWkC = $oWkS->{Cells}[$iR][2]; + if ($oWkC) {$list_id=$oWkC->Value; } + $gmt_offset = '0'; + $called_since_last_reset='N'; + $oWkC = $oWkS->{Cells}[$iR][3]; + if ($oWkC) {$phone_code=$oWkC->Value; } + $phone_code=~s/[^0-9]//g; + $oWkC = $oWkS->{Cells}[$iR][4]; + if ($oWkC) {$phone_number=$oWkC->Value; } + $phone_number=~s/[^0-9]//g; + $USarea = substr($phone_number, 0, 3); + $oWkC = $oWkS->{Cells}[$iR][5]; + if ($oWkC) {$title=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][6]; + if ($oWkC) {$first_name=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][7]; + if ($oWkC) {$middle_initial=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][8]; + if ($oWkC) {$last_name=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][9]; + if ($oWkC) {$address1=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][10]; + if ($oWkC) {$address2=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][11]; + if ($oWkC) {$address3=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][12]; + if ($oWkC) {$city=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][13]; + if ($oWkC) {$state=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][14]; + if ($oWkC) {$province=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][15]; + if ($oWkC) {$postal_code=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][16]; + if ($oWkC) {$country=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][17]; + if ($oWkC) {$gender=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][18]; + if ($oWkC) {$date_of_birth=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][19]; + if ($oWkC) {$alt_phone=$oWkC->Value; } + $alt_phone=~s/[^0-9]//g; + $oWkC = $oWkS->{Cells}[$iR][20]; + if ($oWkC) {$email=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][21]; + if ($oWkC) {$security_phrase=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][22]; + if ($oWkC) {$comments=$oWkC->Value; } + $comments=~s/^\s*(.*?)\s*$/$1/; + $oWkC = $oWkS->{Cells}[$iR][23]; + if ($oWkC) {$rank=$oWkC->Value; } + if (length($rank)<1) {$rank='0';} + $oWkC = $oWkS->{Cells}[$iR][24]; + if ($oWkC) {$owner=$oWkC->Value; } + + if (length($forcelistid) > 0) + { + $list_id = $forcelistid; # set list_id to override value + } + if (length($forcephonecode) > 0) + { + $phone_code = $forcephonecode; # set phone_code to override value + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if ($dupchecksys > 0) + { + $dup_lead=0; + $stmtA = "select count(*) from vicidial_list where phone_number='$phone_number';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead = $aryA[0]; + $dup_lead_list=$list_id; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$phone_number$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if ($dupcheck > 0) + { + $dup_lead=0; + $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id='$list_id' limit 1;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead_list = $aryA[0]; + $dup_lead++; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$phone_number$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if ($dupcheckcamp > 0) + { + $dup_lead=0; + $dup_lists=''; + + $stmtA = "select count(*) from vicidial_lists where list_id='$list_id';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + @aryA = $sthA->fetchrow_array; + $ci_recs = $aryA[0]; + $sthA->finish(); + if ($ci_recs > 0) + { + $stmtA = "select campaign_id from vicidial_lists where list_id='$list_id';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + @aryA = $sthA->fetchrow_array; + $dup_camp = $aryA[0]; + $sthA->finish(); + + $stmtA = "select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $dup_lists .= "'$aryA[0]',"; + $rec_count++; + } + $sthA->finish(); + + chop($dup_lists); + $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $dup_lead_list = "'$aryA[0]',"; + $rec_count++; + $dup_lead=1; + } + $sthA->finish(); + } + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$phone_number$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate title/alt-phone in vicidial_list table entire database ##### + if ($duptapchecksys > 0) + { + $dup_lead=0; + $stmtA = "select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead = $aryA[0]; + $dup_lead_list=$list_id; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$alt_phone$title$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate title/alt-phone in vicidial_list table for one list_id ##### + if ($duptapchecklist > 0) + { + $dup_lead=0; + $stmtA = "select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id' limit 1;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead_list = $aryA[0]; + $dup_lead++; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$alt_phone$title$US$list_id\|/) + {$dup_lead++;} + } + } + + if ( (length($phone_number)>6) && ($dup_lead < 1) ) + { + if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + + if ( ($postalgmt > 0) && (length($postal_code)>4) ) + { + if ($phone_code =~ /^1$/) + { + $stmtA = "select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[2]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[3]; + $dst_range = $aryA[4]; + $PC_processed++; + $rec_count++; + $postalgmt_found++; + if ($DBX) {print " Postal GMT record found for $postal_code: |$gmt_offset|$dst|$dst_range|\n";} + } + $sthA->finish(); + } + } + if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =~ /^1$/) + { + $stmtA = "select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### MEXICO ### + if ($phone_code =~ /^52$/) + { + $stmtA = "select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### AUSTRALIA ### + if ($phone_code =~ /^61$/) + { + $stmtA = "select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $stmtA = "select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = ($secX + (3600 * $AC_GMT_diff)); + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime); + $year = ($year + 1900); + $mon++; + if ($mon < 10) {$mon = "0$mon";} + if ($mday < 10) {$mday = "0$mday";} + if ($hour < 10) {$hour = "0$hour";} + if ($min < 10) {$min = "0$min";} + if ($sec < 10) {$sec = "0$sec";} + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + + if ( (!$AC_processed) && ($dst_range =~ /SSM-FSN/) ) + { + if ($DBX) {print " Second Sunday March to First Sunday November\n";} + &USACAN_dstcalc; + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$area_GMT++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) + { + if ($DBX) {print " First Sunday April to Last Sunday October\n";} + &NA_dstcalc; + if ($DBX) {print " DST: $NA_DST\n";} + if ($NA_DST) {$area_GMT++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) ) + { + if ($DBX) {print " Last Sunday March to Last Sunday October\n";} + &GBR_dstcalc; + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) ) + { + if ($DBX) {print " Last Sunday October to Last Sunday March\n";} + &AUS_dstcalc; + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) ) + { + if ($DBX) {print " First Sunday October to Last Sunday March\n";} + &AUST_dstcalc; + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($area_GMT_method =~ /FSO-FSA/) ) + { + if ($DBX) {print " First Sunday October to First Sunday April\n";} + &AUSE_dstcalc; + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$area_GMT++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) ) + { + if ($DBX) {print " First Sunday October to Third Sunday March\n";} + &NZL_dstcalc; + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($area_GMT_method =~ /LSS-FSA/) ) + { + if ($DBX) {print " Last Sunday September to First Sunday April\n";} + &NZLN_dstcalc; + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$area_GMT++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /TSO-LSF/) ) + { + if ($DBX) {print " Third Sunday October to Last Sunday February\n";} + &BZL_dstcalc; + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$area_GMT++;} + $AC_processed++; + } + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + if ($multi_insert_counter > 8) { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $affected_rows = $dbhA->do($stmtZ); + print STMT_FILE $stmtZ."\r\n"; + $multistmt=''; + $multi_insert_counter=0; + + } else { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multi_insert_counter++; + } + + $good++; + } else { + if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list</font><b>\n";} + $bad++; + } + $total++; + if ($total%100==0) { + print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup_lead, $postalgmt_found)</script>"; + sleep(1); +# flush(); + } + } +} + +if ($multi_insert_counter > 0) { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $affected_rows = $dbhA->do($stmtZ); + print STMT_FILE $stmtZ."\r\n"; +} + +print "<BR><BR>Done</B> GOOD: $good       BAD: $bad       TOTAL: $total</font></center>"; + +exit; + + + + + + +sub USACAN_dstcalc { +#********************************************************************** +# SSM-FSN +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on Second Sunday March to First Sunday November at 2 am. +# INPUTS: +# mm INTEGER Month. +# dd INTEGER Day of the month. +# ns INTEGER Seconds into the day. +# dow INTEGER Day of week (0=Sunday, to 6=Saturday) +# OPTIONAL INPUT: +# timezone INTEGER hour difference UTC - local standard time +# (DEFAULT is blank) +# make calculations based on UTC time, +# which means shift at 10:00 UTC in April +# and 9:00 UTC in October +# OUTPUT: +# INTEGER 1 = DST, 0 = not DST +# +# S M T W T F S +# 1 2 3 4 5 6 7 +# 8 9 10 11 12 13 14 +#15 16 17 18 19 20 21 +#22 23 24 25 26 27 28 +#29 30 31 +# +# S M T W T F S +# 1 2 3 4 5 6 +# 7 8 9 10 11 12 13 +#14 15 16 17 18 19 20 +#21 22 23 24 25 26 27 +#28 29 30 31 +# +#********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; return 0; + } elsif ($mm >= 4 && $mm <= 10) { + $USACAN_DST=1; return 1; + } elsif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; return 1; + } elsif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; return 0; + } else { + $USACAN_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 7200) { + $USACAN_DST=0; return 0; + } else { + $USACAN_DST=1; return 1; + } + } + } else { + $USACAN_DST=0; return 0; + } + } elsif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; return 0; + } elsif ($dd < ($dow+1)) { + $USACAN_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; return 1; + } else { + $USACAN_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 7200) { + $USACAN_DST=1; return 1; + } else { + $USACAN_DST=0; return 0; + } + } + } else { + $USACAN_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub NA_dstcalc { +#********************************************************************** +# FSA-LSO +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in April and last Sunday in October at 2 am. +#********************************************************************** + + $NA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $NA_DST=0; return 0; + } elsif ($mm >= 5 && $mm <= 9) { + $NA_DST=1; return 1; + } elsif ($mm == 4) { + if ($dd > 7) { + $NA_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $NA_DST=0; return 0; + } else { + $NA_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NA_DST=0; return 0; + } else { + $NA_DST=1; return 1; + } + } + } else { + $NA_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $NA_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $NA_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $NA_DST=1; return 1; + } else { + $NA_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 7200) { + $NA_DST=1; return 1; + } else { + $NA_DST=0; return 0; + } + } + } else { + $NA_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub GBR_dstcalc { +#********************************************************************** +# LSM-LSO +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on last Sunday in March and last Sunday in October at 1 am. +#********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; return 0; + } elsif ($mm >= 4 && $mm <= 9) { + $GBR_DST=1; return 1; + } elsif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; return 0; + } elsif ($dd < ($dow+25)) { + $GBR_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; return 0; + } else { + $GBR_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $GBR_DST=0; return 0; + } else { + $GBR_DST=1; return 1; + } + } + } else { + $GBR_DST=1; return 1; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $GBR_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; return 1; + } else { + $GBR_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $GBR_DST=1; return 1; + } else { + $GBR_DST=0; return 0; + } + } + } else { + $GBR_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub AUS_dstcalc { +#********************************************************************** +# LSO-LSM +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on last Sunday in October and last Sunday in March at 1 am. +#********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $AUS_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $AUS_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; return 1; + } else { + $AUS_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $AUS_DST=1; return 1; + } else { + $AUS_DST=0; return 0; + } + } + } else { + $AUS_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; return 0; + } elsif ($dd < ($dow+25)) { + $AUS_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; return 0; + } else { + $AUS_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $AUS_DST=0; return 0; + } else { + $AUS_DST=1; return 1; + } + } + } else { + $AUS_DST=1; return 1; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub AUST_dstcalc { +#********************************************************************** +# FSO-LSM +# TASMANIA ONLY +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in October and last Sunday in March at 1 am. +#********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $AUST_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $AUST_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; return 1; + } else { + $AUST_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $AUST_DST=1; return 1; + } else { + $AUST_DST=0; return 0; + } + } + } else { + $AUST_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd >= 8) { + $AUST_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $AUST_DST=0; return 0; + } else { + $AUST_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 3600) { + $AUST_DST=0; return 0; + } else { + $AUST_DST=1; return 1; + } + } + } else { + $AUST_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub AUSE_dstcalc { +#********************************************************************** +# FSO-FSA +# 2008+ AUSTRALIA ONLY (country code 61) +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in October and first Sunday in April at 1 am. +#********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $AUSE_DST=1; return 1; + } elsif ($mm >= 5 && $mm <= 9) { + $AUSE_DST=0; return 0; + } elsif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; return 0; + } else { + $AUSE_DST=0; return 1; + } + } else { + if ($dow == 0 && $ns < 7200) { + $AUSE_DST=1; return 0; + } else { + $AUSE_DST=0; return 1; + } + } + } else { + $AUSE_DST=1; return 0; + } + } elsif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; return 0; + } else { + $AUSE_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 3600) { + $AUSE_DST=0; return 0; + } else { + $AUSE_DST=1; return 1; + } + } + } else { + $AUSE_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub NZL_dstcalc { +#********************************************************************** +# FSO-TSM +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in October and third Sunday in March at 1 am. +#********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $NZL_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; return 1; + } elsif ($dd < ($dow+14)) { + $NZL_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; return 1; + } else { + $NZL_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $NZL_DST=1; return 1; + } else { + $NZL_DST=0; return 0; + } + } + } else { + $NZL_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd >= 8) { + $NZL_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $NZL_DST=0; return 0; + } else { + $NZL_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 3600) { + $NZL_DST=0; return 0; + } else { + $NZL_DST=1; return 1; + } + } + } else { + $NZL_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub NZLN_dstcalc { +#********************************************************************** +# LSS-FSA +# 2007+ NEW ZEALAND (country code 64) +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on last Sunday in September and first Sunday in April at 1 am. +#********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; return 1; + } elsif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; return 0; + } elsif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; return 0; + } else { + $NZLN_DST=0; return 1; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; return 0; + } else { + $NZLN_DST=0; return 1; + } + } + } else { + $NZLN_DST=1; return 0; + } + } elsif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; return 0; + } elsif ($dd < ($dow+25)) { + $NZLN_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; return 0; + } else { + $NZLN_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $NZLN_DST=0; return 0; + } else { + $NZLN_DST=1; return 1; + } + } + } else { + $NZLN_DST=1; return 1; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub BZL_dstcalc { +#********************************************************************** +# TSO-LSF +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. Brazil +# Based on Third Sunday October to Last Sunday February at 1 am. +#********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; return 1; + } elsif ($mm >= 3 && $mm <= 9) { + $BZL_DST=0; return 0; + } elsif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; return 1; + } elsif ($dd < ($dow+22)) { + $BZL_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; return 1; + } else { + $BZL_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $BZL_DST=1; return 1; + } else { + $BZL_DST=0; return 0; + } + } + } else { + $BZL_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; return 0; + } elsif ($dd < ($dow+22)) { + $BZL_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; return 0; + } else { + $BZL_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $BZL_DST=0; return 0; + } else { + $BZL_DST=1; return 1; + } + } + } else { + $BZL_DST=1; return 1; + } + } # end of month checks +} # end of subroutine dstcalc diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloaderMAIN.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloaderMAIN.php new file mode 100644 index 00000000..209c109f --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloaderMAIN.php @@ -0,0 +1,87 @@ +<?php +# listloaderMAIN.php +# +# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# +# this is the main frame page for the lead loading section. This is where you +# would upload a file and have it inserted into vicidial_list +# +# changes: +# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1105 - fixed for nonwritable directories +# 90508-0644 - Changed to PHP long tags +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGload_leads =$row[0]; + + if ($LOGload_leads < 1) + { + echo "You do not have permissions to load leads\n"; + exit; + } + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + } + } + +?><HTML> +<HEAD> +<TITLE>VICIDIAL: Módulo de Carregar Registros + + + + + \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloader_rowdisplay.pl b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloader_rowdisplay.pl new file mode 100644 index 00000000..9caaeab2 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/listloader_rowdisplay.pl @@ -0,0 +1,154 @@ +#!/usr/bin/perl +# +# listloader_rowdisplay.pl version 2.2.0 +# +# Copyright (C) 2009 Matt Florell,Joe Johnson LICENSE: AGPLv2 +# +# +# CHANGES +# +# 60811-1232 - Changed to DBI +# 60811-1329 - changed to use /etc/astguiclient.conf for configs +# 90721-1340 - Added rank and owner as vicidial_list fields +# + +### begin parsing run-time options ### +if (length($ARGV[0])>1) +{ + $i=0; + while ($#ARGV >= $i) + { + $args = "$args $ARGV[$i]"; + $i++; + } + + if ($args =~ /--help|-h/i) + { + print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; + + exit; + } + else + { + if ($args =~ /-duplicate-check/i) + {$dupcheck=1;} + if ($args =~ /-postal-code-gmt/i) + {$postalgmt=1;} + if ($args =~ /--lead-file=/i) + { + @data_in = split(/--lead-file=/,$args); + $lead_file = $data_in[1]; + $lead_file =~ s/ .*//gi; + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } + else + {$lead_file = './vicidial_temp_file.xls';} + } +} +### end parsing run-time options ### + +use Spreadsheet::ParseExcel; +use Time::Local; +use DBI; + + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = ; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) + {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) + {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} + if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) + {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + +if (!$VARDB_port) {$VARDB_port='3306';} + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + +$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); +my($iR, $iC, $oWkS, $oWkC); +$var_str=""; + +foreach $oWkS (@{$oBook->{Worksheet}}) { + for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) { + $oWkC = $oWkS->{Cells}[0][$iC]; + if ($oWkC) { + $var_str.=$oWkC->Value."|"; + } else { + $var_str.="|"; + } + } +} + +@xls_row=split(/\|/, $var_str); + + +$stmtA = "select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1;"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + my $names = $sthA->{'NAME'}; + my $numFields = $sthA->{'NUM_OF_FIELDS'}; + for (my $i = 0; $i < $numFields; $i++) + { + # printf("%s%s", $i ? "," : "", $$names[$i]); + # printf("%s%s", $i ? "," : "", $$ref[$i]); + + $field_name=uc($$names[$i]); + $field_name=~s/\_/ /g; + print "
".$field_name.": \r\n"; + print " \r\n"; + print "
"; +?> + + +
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Carregar registros do arquivo:
ID da Lista Override: (somente números or leave blank for values in the file)
Sobrepor Código do Telefone: (somente números or leave blank for values in the file)
Layout do arquivo a usar:Standard Format    Layout Customizado
Verificação de Duplicidade de Registro:
Pesquisa do Fuso Horário do Registro:
        
        VOLTAR PARA ADMINLIST LOADER-     VERSÃO:     BUILD:    
+ + +document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + flush(); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { + # copy($leadfile, "./vicidial_temp_file.txt"); + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=5) { + flush(); + $file=fopen("$lead_file", "r"); + print "
Procesando$delim_name-delimited file...\n"; + + if (strlen($list_id_override)>0) + { + print "

ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; + } + + if (strlen($phone_code_override)>0) + { + print "

SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

"; + } + + while (!feof($file)) { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $USarea = substr($phone_number, 0, 3); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + if (strlen($list_id_override)>0) + { + # print "

ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + + if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); + + if ($multi_insert_counter > 8) { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $rslt=mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + + } else { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multi_insert_counter++; + } + + $good++; + } else { + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} + $bad++; + } + $total++; + if ($total%100==0) { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; + + } else { + print "
ERRO: O arquivo não possui a quantidade de campos requerida para continuar.
"; + } + } else if (!eregi(".csv", $leadfile_name)) { + # copy($leadfile, "./vicidial_temp_file.xls"); + $file=fopen("$lead_file", "r"); + + print "
ProcesandoExcel file... \n"; + if (strlen($list_id_override)>0) + { + print "

ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

\n"; + } + if (strlen($phone_code_override)>0) + { + print "

SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

\n"; + } + # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; + $dupcheckCLI=''; $postalgmtCLI=''; + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} + if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} + passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + } else { + # copy($leadfile, "./vicidial_temp_file.csv"); + $file=fopen("$lead_file", "r"); + + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + + print "
ProcesandoCSV file... \n"; + if (strlen($list_id_override)>0) + { + print "

ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; + } + + if (strlen($phone_code_override)>0) + { + print "

SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

"; + } + + while($row=fgetcsv($file, 1000, ",")) { + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[$vendor_lead_code_field]; + $source_code = $row[$source_id_field]; + $source_id=$source_code; + $list_id = $row[$list_id_field]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); + $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); + $USarea = substr($phone_number, 0, 3); + $title = $row[$title_field]; + $first_name = $row[$first_name_field]; + $middle_initial = $row[$middle_initial_field]; + $last_name = $row[$last_name_field]; + $address1 = $row[$address1_field]; + $address2 = $row[$address2_field]; + $address3 = $row[$address3_field]; + $city =$row[$city_field]; + $state = $row[$state_field]; + $province = $row[$province_field]; + $postal_code = $row[$postal_code_field]; + $country_code = $row[$country_code_field]; + $gender = $row[$gender_field]; + $date_of_birth = $row[$date_of_birth_field]; + $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); + $email = $row[$email_field]; + $security_phrase = $row[$security_phrase_field]; + $comments = trim($row[$comments_field]); + $rank = $row[$rank_field]; + $owner = $row[$owner_field]; + + if (strlen($rank)<1) {$rank='0';} + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); + + + if ($multi_insert_counter > 8) { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $rslt=mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + + } else { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multi_insert_counter++; + } + + $good++; + } else { + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + $bad++; + } + $total++; + if ($total%100==0) { + print ""; + usleep(1000); + flush(); + } + } + if ($multi_insert_counter!=0) { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; + } + print ""; + } + +if ($leadfile) { + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + + ### LOG INSERTION Admin Log Table ### + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTAS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($file_layout=="standard") { + + print ""; + flush(); + + if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { + + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + $lead_file = "./vicidial_temp_file.txt"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + + if (count($field_check)>=5) { + flush(); + $file=fopen("$lead_file", "r"); + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + print "
Procesando$delim_name-delimited file... ($tab_count|$pipe_count)\n"; + if (strlen($list_id_override)>0) + { + print "

ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; + } + if (strlen($phone_code_override)>0) + { + print "

SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

\n"; + } + while (!feof($file)) { + $record++; + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + + if (strlen($buffer)>0) { + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $USarea = substr($phone_number, 0, 3); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); + + + if ($multi_insert_counter > 8) { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $rslt=mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + + } else { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multi_insert_counter++; + } + + $good++; + } else { + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + $bad++; + } + $total++; + if ($total%100==0) { + print ""; + usleep(1000); + flush(); + } + } + } + if ($multi_insert_counter!=0) { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; + + } else { + print "
ERRO: O arquivo não possui a quantidade de campos requerida para continuar.
"; + } + } else if (!eregi(".csv", $leadfile_name)) + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.xls"); + $lead_file = "/tmp/vicidial_temp_file.xls"; + } + $file=fopen("$lead_file", "r"); + + # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; + $dupcheckCLI=''; $postalgmtCLI=''; + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} + if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} + passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + + } + else + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.csv"); + $lead_file = "/tmp/vicidial_temp_file.csv"; + } + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + + print "
ProcesandoCSV file... \n"; + + if (strlen($list_id_override)>0) + { + print "

ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; + } + if (strlen($phone_code_override)>0) + { + print "

SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

"; + } + + while($row=fgetcsv($file, 1000, ",")) { + $pulldate=date("Y-m-d H:i:s"); + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user =""; + $vendor_lead_code = $row[0]; + $source_code = $row[1]; + $source_id=$source_code; + $list_id = $row[2]; + $gmt_offset = '0'; + $called_since_last_reset='N'; + $phone_code = eregi_replace("[^0-9]", "", $row[3]); + $phone_number = eregi_replace("[^0-9]", "", $row[4]); + $USarea = substr($phone_number, 0, 3); + $title = $row[5]; + $first_name = $row[6]; + $middle_initial = $row[7]; + $last_name = $row[8]; + $address1 = $row[9]; + $address2 = $row[10]; + $address3 = $row[11]; + $city =$row[12]; + $state = $row[13]; + $province = $row[14]; + $postal_code = $row[15]; + $country_code = $row[16]; + $gender = $row[17]; + $date_of_birth = $row[18]; + $alt_phone = eregi_replace("[^0-9]", "", $row[19]); + $email = $row[20]; + $security_phrase = $row[21]; + $comments = trim($row[22]); + $rank = $row[23]; + $owner = $row[24]; + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + { + if (strlen($phone_code)<1) {$phone_code = '1';} + + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); + + + if ($multi_insert_counter > 8) { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $rslt=mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + + } else { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multi_insert_counter++; + } + + $good++; + } else { + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + $bad++; + } + $total++; + if ($total%100==0) { + print ""; + usleep(1000); + flush(); + } + } + if ($multi_insert_counter!=0) { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + } + + print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; + + } + print ""; + + } else { + print "
"; + flush(); + print "\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + + $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1", $link); + + + if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + + $buffer=fgets($file, 4096); + $tab_count=substr_count($buffer, "\t"); + $pipe_count=substr_count($buffer, "|"); + + if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} + $field_check=explode($delimiter, $buffer); + flush(); + $file=fopen("$lead_file", "r"); + print "
Procesando$delim_name-delimited file...\n"; + + if (strlen($list_id_override)>0) + { + print "

ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; + } + if (strlen($phone_code_override)>0) + { + print "

SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

"; + } + $buffer=rtrim(fgets($file, 4096)); + $buffer=stripslashes($buffer); + $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); + + for ($i=0; $i\n"; + } else { + print "
\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + + } + } + else if (!eregi(".csv", $leadfile_name)) + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.xls"); + $lead_file = "/tmp/vicidial_temp_file.xls"; + } + + # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; + $dupcheckCLI=''; $postalgmtCLI=''; + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} + if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} + passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + } + else + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.csv"); + $lead_file = "/tmp/vicidial_temp_file.csv"; + } + $file=fopen("$lead_file", "r"); + + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + + print "
ProcesandoCSV file... \n"; + + if (strlen($list_id_override)>0) + { + print "

ID DA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; + } + if (strlen($phone_code_override)>0) + { + print "

SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO: $phone_code_override

"; + } + + $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; + $row=fgetcsv($file, 1000, ","); + for ($i=0; $i\n"; + } else { + print "
\r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + } + } + } + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print "
VICIDIAL ColunaDados do arquivo
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
        
\r\n"; + # } + print ""; + } +#} else if (filesize($leadfile)>8388608) { +# print "
ERROR: File exceeds the 8MB limit.
"; +} +?> + + + + + + + + +4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } +if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + +### Find out if DST to raise the gmt offset ### +$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); +$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +$AC_processed=0; +if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Domingo March to First Domingo November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Domingo March to First Domingo November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Domingo, to 6=Sábado) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # horário local calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Domingo April to Last Domingo October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in April and last Domingo in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # horário local calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Domingo March to Last Domingo October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in March and last Domingo in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } +if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Domingo October to Last Domingo March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in October and last Domingo in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Domingo October to Last Domingo March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and last Domingo in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Domingo in October to First Domingo in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and first Domingo in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Domingo October to Third Domingo March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Domingo in October and third Domingo in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Domingo in September to First Domingo in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Domingo in September and first Domingo in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Domingo October to Last Domingo February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Domingo October to Last Domingo February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # horário local calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # horário local calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + +if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + +return $gmt_offset; +} + +?> +
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/non_agent_api.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/non_agent_api.php new file mode 100644 index 00000000..faecfc20 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/non_agent_api.php @@ -0,0 +1,2638 @@ + LICENSE: AGPLv2 +# +# This script is designed as an API(Application Programming Interface) to allow +# other programs to interact with all non-agent-screen VICIDIAL functions +# +# required variables: +# - $user +# - $pass +# - $function - ('add_lead','version') +# - $source - ('vtiger','webform','adminweb') +# - $format - ('text','debug') + +# CHANGELOG: +# 80724-0021 - First build of script +# 80801-0047 - Added gmt lookup and hopper insert time validation +# 80909-2012 - Added support for campaign-specific DNC lists +# 80910-0020 - Added support for multi-alt-phones, added version function +# 90118-1056 - Added logging of API functions +# 90428-0209 - Added blind_monitor function +# 90508-0642 - Changed to PHP long tags +# 90514-0602 - Added sounds_list function +# 90522-0506 - Security fix +# 90530-0946 - Added QueueMetrics blind monitoring option +# 90721-1428 - Added rank and owner as vicidial_list fields +# 90904-1535 - Added moh_list musiconhold list +# 90916-2342 - Added vm_list voicemail list +# 91026-1059 - Added AREACODE DNC option +# 91203-1140 - Added agent_ingroup_info feature +# 91216-0331 - Added duplication check features to add_lead function +# 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# + +$version = '2.2.0-17'; +$build = '100118-0543'; + +require("dbconnect.php"); + +### If you have globals turned off uncomment these lines +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["function"])) {$function=$_GET["function"];} + elseif (isset($_POST["function"])) {$function=$_POST["function"];} +if (isset($_GET["format"])) {$format=$_GET["format"];} + elseif (isset($_POST["format"])) {$format=$_POST["format"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} +if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} + elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} +if (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];} + elseif (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];} +if (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];} + elseif (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];} +if (isset($_GET["title"])) {$title=$_GET["title"];} + elseif (isset($_POST["title"])) {$title=$_POST["title"];} +if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} + elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} + elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} +if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} + elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} +if (isset($_GET["address1"])) {$address1=$_GET["address1"];} + elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} +if (isset($_GET["address2"])) {$address2=$_GET["address2"];} + elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} +if (isset($_GET["address3"])) {$address3=$_GET["address3"];} + elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} +if (isset($_GET["city"])) {$city=$_GET["city"];} + elseif (isset($_POST["city"])) {$city=$_POST["city"];} +if (isset($_GET["state"])) {$state=$_GET["state"];} + elseif (isset($_POST["state"])) {$state=$_POST["state"];} +if (isset($_GET["province"])) {$province=$_GET["province"];} + elseif (isset($_POST["province"])) {$province=$_POST["province"];} +if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} + elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} +if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} + elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} +if (isset($_GET["gender"])) {$gender=$_GET["gender"];} + elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} +if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} + elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} +if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} + elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["email"];} +if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} + elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} +if (isset($_GET["comments"])) {$comments=$_GET["comments"];} + elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} +if (isset($_GET["dnc_check"])) {$dnc_check=$_GET["dnc_check"];} + elseif (isset($_POST["dnc_check"])) {$dnc_check=$_POST["dnc_check"];} +if (isset($_GET["campaign_dnc_check"])) {$campaign_dnc_check=$_GET["campaign_dnc_check"];} + elseif (isset($_POST["campaign_dnc_check"])) {$campaign_dnc_check=$_POST["campaign_dnc_check"];} +if (isset($_GET["add_to_hopper"])) {$add_to_hopper=$_GET["add_to_hopper"];} + elseif (isset($_POST["add_to_hopper"])) {$add_to_hopper=$_POST["add_to_hopper"];} +if (isset($_GET["hopper_priority"])) {$hopper_priority=$_GET["hopper_priority"];} + elseif (isset($_POST["hopper_priority"])) {$hopper_priority=$_POST["hopper_priority"];} +if (isset($_GET["hopper_local_call_time_check"])) {$hopper_local_call_time_check=$_GET["hopper_local_call_time_check"];} + elseif (isset($_POST["hopper_local_call_time_check"])) {$hopper_local_call_time_check=$_POST["hopper_local_call_time_check"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["multi_alt_phones"])) {$multi_alt_phones=$_GET["multi_alt_phones"];} + elseif (isset($_POST["multi_alt_phones"])) {$multi_alt_phones=$_POST["multi_alt_phones"];} +if (isset($_GET["source"])) {$source=$_GET["source"];} + elseif (isset($_POST["source"])) {$source=$_POST["source"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["rank"])) {$rank=$_GET["rank"];} + elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];} +if (isset($_GET["owner"])) {$owner=$_GET["owner"];} + elseif (isset($_POST["owner"])) {$owner=$_POST["owner"];} +if (isset($_GET["agent_user"])) {$agent_user=$_GET["agent_user"];} + elseif (isset($_POST["agent_user"])) {$agent_user=$_POST["agent_user"];} +if (isset($_GET["duplicate_check"])) {$duplicate_check=$_GET["duplicate_check"];} + elseif (isset($_POST["duplicate_check"])) {$duplicate_check=$_POST["duplicate_check"];} + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $DB=ereg_replace("[^0-9]","",$DB); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $function = ereg_replace("[^-\_0-9a-zA-Z]","",$function); + $format = ereg_replace("[^0-9a-zA-Z]","",$format); + $list_id = ereg_replace("[^0-9]","",$list_id); + $phone_code = ereg_replace("[^0-9]","",$phone_code); + $phone_number = ereg_replace("[^0-9]","",$phone_number); + $vendor_lead_code = ereg_replace(";","",$vendor_lead_code); + $vendor_lead_code = ereg_replace("\+"," ",$vendor_lead_code); + $source_id = ereg_replace(";","",$source_id); + $source_id = ereg_replace("\+"," ",$source_id); + $gmt_offset_now = ereg_replace("-\_\.0-9","",$gmt_offset_now); + $title = ereg_replace("[^- \_\.0-9a-zA-Z]","",$title); + $first_name = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$first_name); + $first_name = ereg_replace("\+"," ",$first_name); + $middle_initial = ereg_replace("[^0-9a-zA-Z]","",$middle_initial); + $last_name = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$last_name); + $last_name = ereg_replace("\+"," ",$last_name); + $address1 = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$address1); + $address2 = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$address2); + $address3 = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$address3); + $address1 = ereg_replace("\+"," ",$address1); + $address2 = ereg_replace("\+"," ",$address2); + $address3 = ereg_replace("\+"," ",$address3); + $city = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$city); + $city = ereg_replace("\+"," ",$city); + $state = ereg_replace("[^- 0-9a-zA-Z]","",$state); + $province = ereg_replace("[^- \+\.\_0-9a-zA-Z]","",$province); + $province = ereg_replace("\+"," ",$province); + $postal_code = ereg_replace("[^- \+0-9a-zA-Z]","",$postal_code); + $postal_code = ereg_replace("\+"," ",$postal_code); + $country_code = ereg_replace("[^A-Z]","",$country_code); + $gender = ereg_replace("[^A-Z]","",$gender); + $date_of_birth = ereg_replace("[^-0-9]","",$date_of_birth); + $alt_phone = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$alt_phone); + $alt_phone = ereg_replace("\+"," ",$alt_phone); + $email = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); + $email = ereg_replace("\+"," ",$email); + $security_phrase = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$security_phrase); + $security_phrase = ereg_replace("\+"," ",$security_phrase); + $comments = ereg_replace(";","",$comments); + $comments = ereg_replace("\+"," ",$comments); + $dnc_check = ereg_replace("[^A-Z]","",$dnc_check); + $campaign_dnc_check = ereg_replace("[^A-Z]","",$campaign_dnc_check); + $add_to_hopper = ereg_replace("[^A-Z]","",$add_to_hopper); + $hopper_priority = ereg_replace("-0-9","",$hopper_priority); + $hopper_local_call_time_check = ereg_replace("[^A-Z]","",$hopper_local_call_time_check); + $campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign_id); + $multi_alt_phones = ereg_replace("[^- \+\!\:\_0-9a-zA-Z]","",$multi_alt_phones); + $multi_alt_phones = ereg_replace("\+"," ",$multi_alt_phones); + $source = ereg_replace("[^0-9a-zA-Z]","",$source); + $phone_login = ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $session_id = ereg_replace("[^0-9]","",$session_id); + $server_ip = ereg_replace("[^\.0-9]","",$server_ip); + $stage = ereg_replace("[^a-zA-Z]","",$stage); + $rank = ereg_replace("[^0-9]","",$rank); + $owner = ereg_replace("[^-_0-9a-zA-Z]","",$owner); + $duplicate_check = ereg_replace("[^-_0-9a-zA-Z]","",$duplicate_check); + } +else + { + $user = ereg_replace("'|\"|\\\\|;","",$user); + $pass = ereg_replace("'|\"|\\\\|;","",$pass); + $source = ereg_replace("'|\"|\\\\|;","",$source); + } + +if (strlen($list_id)<1) {$list_id='999';} +if (strlen($phone_code)<1) {$phone_code='1';} +$USarea = substr($phone_number, 0, 3); +if (strlen($hopper_priority)<1) {$hopper_priority=0;} +if (strlen($gender)<1) {$gender='U';} +if (strlen($rank)<1) {$rank='0';} + +$StarTtime = date("U"); +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$CIDdate = date("mdHis"); +$ENTRYdate = date("YmdHis"); +$MT[0]=''; +$postalgmt=''; +$api_script = 'non-agent'; +$api_logging = 1; + + +$secX = date("U"); +$hour = date("H"); +$min = date("i"); +$sec = date("s"); +$mon = date("m"); +$mday = date("d"); +$year = date("Y"); +$isdst = date("I"); +$Shour = date("H"); +$Smin = date("i"); +$Ssec = date("s"); +$Smon = date("m"); +$Smday = date("d"); +$Syear = date("Y"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +### Grab Server GMT value from the database +$stmt="SELECT local_gmt FROM servers where active='Y' limit 1;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$gmt_recs = mysql_num_rows($rslt); +if ($gmt_recs > 0) + { + $row=mysql_fetch_row($rslt); + $DBSERVER_GMT = "$row[0]"; + if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + if ($isdst) {$SERVER_GMT++;} + } +else + { + $SERVER_GMT = date("O"); + $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); + $SERVER_GMT = ($SERVER_GMT + 0); + $SERVER_GMT = ($SERVER_GMT / 100); + } + +$LOCAL_GMT_OFF = $SERVER_GMT; +$LOCAL_GMT_OFF_STD = $SERVER_GMT; + + + + + +################################################################################ +### version - show version and date information for the API +################################################################################ +if ($function == 'version') + { + $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime"; + $result = 'SUCCESS'; + echo "$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } +################################################################################ +### END version +################################################################################ + + + + +################################################################################ +### sounds_list - sends a list of the sounds in the audio store +################################################################################ +if ($function == 'sounds_list') + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 6;"; + if ($DB>0) {echo "DEBUG: sounds_list query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_user=$row[0]; + if ($allowed_user < 1) + { + $result = 'ERROR'; + $result_reason = "sounds_list USER DOES NOT HAVE PERMISSION TO VIEW SOUNDS LIST"; + echo "$result: $result_reason: |$user|$allowed_user|\n"; + $data = "$allowed_user"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $server_name = getenv("SERVER_NAME"); + $server_port = getenv("SERVER_PORT"); + if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} + $admDIR = "$HTTPprotocol$server_name:$server_port"; + + ############################################# + ##### START SYSTEM_SETTINGS LOOKUP ##### + $stmt = "SELECT use_non_latin,sounds_central_control_active,sounds_web_server,sounds_web_directory FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $sounds_central_control_active = $row[1]; + $sounds_web_server = $row[2]; + $sounds_web_directory = $row[3]; + } + ##### END SETTINGS LOOKUP ##### + ########################################### + + if ($sounds_central_control_active < 1) + { + $result = 'ERROR'; + $result_reason = "sounds_list CENTRAL SOUND CONTROL IS NOT ACTIVE"; + echo "$result: $result_reason: |$user|$sounds_central_control_active|\n"; + $data = "$sounds_central_control_active"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $i=0; + $filename_sort=$MT; + $dirpath = "$WeBServeRRooT/$sounds_web_directory"; + $dh = opendir($dirpath); + if ($DB>0) {echo "DEBUG: sounds_list variables - $dirpath|$stage|$format\n";} + while (false !== ($file = readdir($dh))) + { + # Do not list subdirectories + if ( (!is_dir("$dirpath/$file")) and (preg_match('/\.wav$|\.gsm$/', $file)) ) + { + if (file_exists("$dirpath/$file")) + { + $file_names[$i] = $file; + $file_namesPROMPT[$i] = preg_replace("/\.wav$|\.gsm$/","",$file); + $file_epoch[$i] = filemtime("$dirpath/$file"); + $file_dates[$i] = date ("Y-m-d H:i:s.", filemtime("$dirpath/$file")); + $file_sizes[$i] = filesize("$dirpath/$file"); + $file_sizesPAD[$i] = sprintf("[%020s]\n",filesize("$dirpath/$file")); + if (eregi('date',$stage)) {$file_sort[$i] = $file_epoch[$i] . "----------" . $i;} + if (eregi('name',$stage)) {$file_sort[$i] = $file_names[$i] . "----------" . $i;} + if (eregi('size',$stage)) {$file_sort[$i] = $file_sizesPAD[$i] . "----------" . $i;} + + $i++; + } + } + } + closedir($dh); + + if (eregi('date',$stage)) {rsort($file_sort);} + if (eregi('name',$stage)) {sort($file_sort);} + if (eregi('size',$stage)) {rsort($file_sort);} + + sleep(1); + + $k=0; + $sf=0; + while($k < $i) + { + $file_split = explode('----------',$file_sort[$k]); + $m = $file_split[1]; + $NOWsize = filesize("$dirpath/$file_names[$m]"); + if ($DB>0) {echo "DEBUG: sounds_list variables - $file_sort[$k]|$size|$NOWsize|\n";} + if ($file_sizes[$m] == $NOWsize) + { + if (eregi('tab',$format)) + {echo "$k\t$file_names[$m]\t$file_dates[$m]\t$file_sizes[$m]\t$file_epoch[$m]\n";} + if (eregi('link',$format)) + {echo "$file_names[$m]
\n";} + if (eregi('selectframe',$format)) + { + if ($sf < 1) + { + echo "\n"; + echo "NON-AGENT API\n"; + echo "\n"; + echo "\n\n"; + + echo "\n"; + echo "close frame\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + $sf++; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + } + $k++; + } + if ($sf > 0) + { + echo "
#FILENAMEDATESIZEPLAY
$sf$file_names[$m]$file_dates[$m]$file_sizes[$m]PLAY
\n"; + } + + exit; + + } + } + } +################################################################################ +### END sounds_list +################################################################################ + + + +################################################################################ +### moh_list - sends a list of the moh classes in the system +################################################################################ +if ($function == 'moh_list') + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_user=$row[0]; + if ($allowed_user < 1) + { + $result = 'ERROR'; + $result_reason = "sounds_list USER DOES NOT HAVE PERMISSION TO VIEW SOUNDS LIST"; + echo "$result: $result_reason: |$user|$allowed_user|\n"; + $data = "$allowed_user"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $server_name = getenv("SERVER_NAME"); + $server_port = getenv("SERVER_PORT"); + if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} + $admDIR = "$HTTPprotocol$server_name:$server_port"; + + ############################################# + ##### START SYSTEM_SETTINGS LOOKUP ##### + $stmt = "SELECT use_non_latin,sounds_central_control_active,sounds_web_server,sounds_web_directory FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + $ss_conf_ct = mysql_num_rows($rslt); + if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $sounds_central_control_active = $row[1]; + $sounds_web_server = $row[2]; + $sounds_web_directory = $row[3]; + } + ##### END SETTINGS LOOKUP ##### + ########################################### + + if ($sounds_central_control_active < 1) + { + $result = 'ERROR'; + $result_reason = "sounds_list CENTRAL SOUND CONTROL IS NOT ACTIVE"; + echo "$result: $result_reason: |$user|$sounds_central_control_active|\n"; + $data = "$sounds_central_control_active"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + echo "\n"; + echo "NON-AGENT API\n"; + echo "\n"; + echo "\n\n"; + + echo "\n"; + echo "close frame\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT moh_id,moh_name,random from vicidial_music_on_hold where active='Y' order by moh_id"; + $rslt=mysql_query($stmt, $link); + $moh_to_print = mysql_num_rows($rslt); + $k=0; + $sf=0; + while ($moh_to_print > $k) + { + $rowx=mysql_fetch_row($rslt); + $moh_id[$k] = $rowx[0]; + $moh_name[$k] = $rowx[1]; + $random[$k] = $rowx[2]; + $k++; + } + + $k=0; + $sf=0; + while ($moh_to_print > $k) + { + $sf++; + if (eregi("1$|3$|5$|7$|9$", $sf)) + {$bgcolor='bgcolor="#E6E6E6"';} + else + {$bgcolor='bgcolor="#F6F6F6"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT filename from vicidial_music_on_hold_files where moh_id='$moh_id[$k]';"; + $rslt=mysql_query($stmt, $link); + $mohfiles_to_print = mysql_num_rows($rslt); + $m=0; + while ($mohfiles_to_print > $m) + { + $rowx=mysql_fetch_row($rslt); + $MOHfiles .= "$rowx[0]   "; + $m++; + } + + + echo "\n"; + echo "\n"; + + $k++; + } + echo "
#Music On Hold ClassNameRandom
$sf$moh_id[$k]$moh_name[$k]$random[$k]
 Files: $MOHfiles
\n"; + + exit; + } + } + } +################################################################################ +### END moh_list +################################################################################ + + + + +################################################################################ +### vm_list - sends a list of the voicemail boxes in the system +################################################################################ +if ($function == 'vm_list') + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_user=$row[0]; + if ($allowed_user < 1) + { + $result = 'ERROR'; + $result_reason = "vm_list USER DOES NOT HAVE PERMISSION TO VIEW VOICEMAIL BOXES LIST"; + echo "$result: $result_reason: |$user|$allowed_user|\n"; + $data = "$allowed_user"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $server_name = getenv("SERVER_NAME"); + $server_port = getenv("SERVER_PORT"); + if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} + $admDIR = "$HTTPprotocol$server_name:$server_port"; + + echo "\n"; + echo "NON-AGENT API\n"; + echo "\n"; + echo "\n\n"; + + echo "\n"; + echo "close frame\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT voicemail_id,fullname,email from vicidial_voicemail where active='Y' order by voicemail_id"; + $rslt=mysql_query($stmt, $link); + $vm_to_print = mysql_num_rows($rslt); + $k=0; + $sf=0; + while ($vm_to_print > $k) + { + $rowx=mysql_fetch_row($rslt); + $voicemail_id[$k] = $rowx[0]; + $fullname[$k] = $rowx[1]; + $email[$k] = $rowx[2]; + $sf++; + if (eregi("1$|3$|5$|7$|9$", $sf)) + {$bgcolor='bgcolor="#E6E6E6"';} + else + {$bgcolor='bgcolor="#F6F6F6"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $k++; + } + + $stmt="SELECT voicemail_id,fullname,email,extension from phones where active='Y' order by voicemail_id"; + $rslt=mysql_query($stmt, $link); + $vm_to_print = mysql_num_rows($rslt); + $k=0; + $sf=0; + while ($vm_to_print > $k) + { + $rowx=mysql_fetch_row($rslt); + $voicemail_id[$k] = $rowx[0]; + $fullname[$k] = $rowx[1]; + $email[$k] = $rowx[2]; + $extension[$k] = $rowx[3]; + $sf++; + if (eregi("1$|3$|5$|7$|9$", $sf)) + {$bgcolor='bgcolor="#E6E6E6"';} + else + {$bgcolor='bgcolor="#F6F6F6"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $k++; + } + echo "
#Voicemail BoxesNameEmail
$sf$voicemail_id[$k]$fullname[$k]$email[$k]
$sf$voicemail_id[$k]$extension[$k] - $fullname[$k]$email[$k]
\n"; + + exit; + } + } +################################################################################ +### END vm_list +################################################################################ + + + + +################################################################################ +### agent_ingroup_info - displays agent in-group info in an HTML form allowing for changes +################################################################################ +if ($function == 'agent_ingroup_info') + { + if(strlen($source)<2) + { + $result = 'ERROR'; + $result_reason = "Invalid Source"; + echo "$result: $result_reason - $source\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + echo "ERROR: Invalid Source: |$source|\n"; + exit; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access='1' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_user=$row[0]; + if ( ($allowed_user < 1) and ($source != 'queuemetrics') ) + { + $result = 'ERROR'; + $result_reason = "agent_ingroup_info USER DOES NOT HAVE PERMISSION TO GET AGENT INFO"; + echo "$result: $result_reason: |$user|$allowed_user|\n"; + $data = "$allowed_user"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $stmt="SELECT count(*) from vicidial_live_agents where user='$agent_user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $session_exists=$row[0]; + + if ($session_exists < 1) + { + $result = 'ERROR'; + $result_reason = "agent_ingroup_info INVALID USER ID"; + echo "$result: $result_reason - $agent_user|$user\n"; + $data = "$session_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $stmt="SELECT campaign_id,closer_campaigns,outbound_autodial,manager_ingroup_set,external_igb_set_user from vicidial_live_agents where user='$agent_user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_id = $row[0]; + $closer_campaigns = $row[1]; + $blended = $row[2]; + $manager_ingroup_set = $row[3]; + $external_igb_set_user = $row[4]; + + $stmt="SELECT full_name from vicidial_users where user='$agent_user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign_id' and campaign_allow_inbound='Y' and dial_method NOT IN('MANUAL');"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_campaign_inbound=$row[0]; + + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_method NOT IN('MANUAL','INBOUND_MAN');"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_campaign_autodial=$row[0]; + + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and change_agent_campaign='1';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_user_change_ingroups=$row[0]; + + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and modify_users='1';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_user_modify_user=$row[0]; + + + $result = 'SUCCESS'; + $result_reason = ""; + $data = "$agent_user|$stage"; + + if ($stage == 'text') + { + $output .= "SELECTED INGROUPS: $closer_campaigns\n"; + $output .= "OUTBOUND AUTODIAL: $blended\n"; + $output .= "MANAGER OVERRIDE: $manager_ingroup_set\n"; + $output .= "MANAGER: $external_igb_set_user\n"; + echo "$result: $result_reason - $data\n$output\n"; + } + else + { + $output = ''; + $output .= "
\n"; + $output .= "Agent: $agent_user - $full_name \n"; + $output .= "   Campaign: $campaign_id\n"; + $output .= "Close
\n"; + + $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($allowed_campaign_inbound < 1) + {$row[0]='';} + $closer_groups_pre = preg_replace('/-$/','',$row[0]); + $closer_groups = explode(" ",$closer_groups_pre); + $closer_groups_ct = count($closer_groups); + + $in_groups_pre = preg_replace('/-$/','',$closer_campaigns); + $in_groups = explode(" ",$in_groups_pre); + $in_groups_ct = count($in_groups); + $k=1; + while ($k < $closer_groups_ct) + { + $closer_select[$k]=0; + if (strlen($closer_groups[$k])>1) + { + $m=0; + while ($m < $in_groups_ct) + { + if (strlen($in_groups[$m])>1) + { + if ($closer_groups[$k] == $in_groups[$m]) + {$closer_select[$k]++;} + } + $m++; + } + } + $k++; + } + + if ( ($allowed_user_change_ingroups > 0) and ($stage == 'change') ) + { + $output .= "\n"; + $output .= "\n"; + + $output .= "\n"; + + $output .= "\n"; + + if ( ($manager_ingroup_set == 'SET') or ($manager_ingroup_set == 'Y') ) + { + $stmt="SELECT full_name from vicidial_users where user='$external_igb_set_user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Mfull_name = $row[0]; + + $output .= "\n"; + } + + $output .= "\n"; + + $output .= "
Selected In-Groups: \n"; + $output .= "\n"; + $output .= "
Change, Add, Remove:\n"; + $output .= "\n"; + $output .= "\n"; + $output .= "
Blended Outbound Autodial:\n"; + $output .= "\n"; + $output .= "\n"; + $output .= "
Manager In-Group Override:\n"; + $output .= "\n"; + $output .= "$manager_ingroup_set - $external_igb_set_user - $Mfull_name\n"; + $output .= "
\n"; + $output .= "\n"; + $output .= "
\n"; + $output .= "
\n"; + } + else + { + $output .= "\n"; + + $m=0; + $m_printed=0; + while ($m < $closer_groups_ct) + { + if (strlen($closer_groups[$m])>1) + { + $stmt="SELECT group_name from vicidial_inbound_groups where group_id='$closer_groups[$m]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + $output .= "\n"; + $m_printed++; + } + $m++; + } + + if ($m_printed < 1) + {$output .= "\n";} + + $output .= "
$closer_groups[$m]"; + + if ($closer_select[$m] > 0) + {$output .= " *";} + $output .= "$row[0]
No In-Groups Allowed

\n"; + + $output .= "SELECTED INGROUPS: $closer_campaigns
\n"; + $output .= "OUTBOUND AUTODIAL: $blended
\n"; + $output .= "MANAGER OVERRIDE: $manager_ingroup_set
\n"; + $output .= "MANAGER: $external_igb_set_user
\n"; + $output .= "\n"; + $output .= "
\n"; + } + + echo "$output"; + } + + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + } + exit; + } +################################################################################ +### END agent_ingroup_info +################################################################################ + + + + +################################################################################ +### blind_monitor - sends call to phone from session from listening +################################################################################ +if ($function == 'blind_monitor') + { + if(strlen($source)<2) + { + $result = 'ERROR'; + $result_reason = "Invalid Source"; + echo "$result: $result_reason - $source\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + echo "ERROR: Invalid Source: |$source|\n"; + exit; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access='1' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_user=$row[0]; + if ( ($allowed_user < 1) and ($source != 'queuemetrics') ) + { + $result = 'ERROR'; + $result_reason = "blind_monitor USER DOES NOT HAVE PERMISSION TO BLIND MONITOR"; + echo "$result: $result_reason: |$user|$allowed_user|\n"; + $data = "$allowed_user"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$session_id' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $session_exists=$row[0]; + + if ($session_exists < 1) + { + $result = 'ERROR'; + $result_reason = "blind_monitor INVALID SESSION ID"; + echo "$result: $result_reason - $session_id|$server_ip|$user\n"; + $data = "$session_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $stmt="SELECT count(*) from phones where login='$phone_login';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $phone_exists=$row[0]; + + if ( ($phone_exists < 1) and ($source != 'queuemetrics') ) + { + $result = 'ERROR'; + $result_reason = "blind_monitor INVALID PHONE LOGIN"; + echo "$result: $result_reason - $phone_login|$user\n"; + $data = "$phone_login"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + if ($source == 'queuemetrics') + { + $stmt="SELECT active_voicemail_server from system_settings;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $monitor_server_ip = $row[0]; + $dialplan_number = $phone_login; + $outbound_cid = ''; + if (strlen($monitor_server_ip)<7) + {$monitor_server_ip = $server_ip;} + } + else + { + $stmt="SELECT dialplan_number,server_ip,outbound_cid from phones where login='$phone_login';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $dialplan_number = $row[0]; + $monitor_server_ip =$row[1]; + $outbound_cid = $row[2]; + } + + $S='*'; + $D_s_ip = explode('.', $server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $monitor_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; + + $PADuser = sprintf("%08s", $user); + while (strlen($PADuser) > 8) {$PADuser = substr("$PADuser", 0, -1);} + $BMquery = "BM$StarTtime$PADuser"; + + if ( (ereg('MONITOR',$stage)) or (strlen($stage)<1) ) {$stage = '0';} + if (ereg('BARGE',$stage)) {$stage = '';} + if (ereg('HIJACK',$stage)) {$stage = '';} + + ### insert a new lead in the system with this phone number + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$monitor_server_ip','','Originate','$BMquery','Channel: Local/$monitor_dialstring$stage$session_id@default','Context; default','Exten: $dialplan_number','Priority: 1','Callerid: \"VC Blind Monitor\" <$outbound_cid>','','','','','');"; + if ($DB>0) {echo "DEBUG: blind_monitor query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $man_id = mysql_insert_id($link); + + $result = 'SUCCESS'; + $result_reason = "blind_monitor HAS BEEN LAUNCHED"; + echo "$result: $result_reason - $phone_login|$monitor_dialstring$stage$session_id|$dialplan_number|$session_id|$man_id|$user\n"; + $data = "$phone_login|$monitor_dialstring|$session_id|$man_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + } + } + } + exit; + } +################################################################################ +### END blind_monitor +################################################################################ + + + + + +################################################################################ +### add_lead - inserts a lead into the vicidial_list table +################################################################################ +if ($function == 'add_lead') + { + if(strlen($source)<2) + { + $result = 'ERROR'; + $result_reason = "Invalid Source"; + echo "$result: $result_reason - $source\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + echo "ERROR: Invalid Source: |$source|\n"; + exit; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access='1' and modify_leads='1' and user_level > 7;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $modify_leads=$row[0]; + + if ($modify_leads < 1) + { + $result = 'ERROR'; + $result_reason = "add_lead USER DOES NOT HAVE PERMISSION TO ADD LEADS TO THE SYSTEM"; + echo "$result: $result_reason: |$user|$modify_leads|\n"; + $data = "$modify_leads"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) + { + $result = 'ERROR'; + $result_reason = "add_lead INVALID PHONE NUMBER"; + echo "$result: $result_reason - $phone_number|$user\n"; + $data = "$phone_number"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + ### START checking for DNC if defined ### + if ( ($dnc_check == 'Y') or ($dnc_check == 'AREACODE') ) + { + if ($DB>0) {echo "DEBUG: Checking for system DNC\n";} + if ($dnc_check == 'AREACODE') + { + $phone_areacode = substr($phone_number, 0, 3); + $phone_areacode .= "XXXXXXX"; + $stmt="SELECT count(*) from vicidial_dnc where phone_number IN('$phone_number','$phone_areacode');"; + } + else + {$stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';";} + if ($DB>0) {echo "DEBUG: add_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $dnc_found=$row[0]; + + if ($dnc_found > 0) + { + $result = 'ERROR'; + $result_reason = "add_lead PHONE NUMBER IN DNC"; + echo "$result: $result_reason - $phone_number|$user\n"; + $data = "$phone_number"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + } + if ( ($campaign_dnc_check == 'Y') or ($campaign_dnc_check == 'AREACODE') ) + { + if ($DB>0) {echo "DEBUG: Checking for campaign DNC\n";} + if ($campaign_dnc_check == 'AREACODE') + { + $phone_areacode = substr($phone_number, 0, 3); + $phone_areacode .= "XXXXXXX"; + $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number IN('$phone_number','$phone_areacode') and campaign_id='$campaign_id';"; + } + else + {$stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign_id';";} + if ($DB>0) {echo "DEBUG: add_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $dnc_found=$row[0]; + + if ($dnc_found > 0) + { + $result = 'ERROR'; + $result_reason = "add_lead PHONE NUMBER IN CAMPAIGN DNC"; + echo "$result: $result_reason - $phone_number|$campaign_id|$user\n"; + $data = "$phone_number|$campaign_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + } + ### END checking for DNC if defined ### + + ### START checking for duplicate if defined ### + if (eregi("CAMP",$duplicate_check)) # find lists within campaign + { + $stmt="SELECT campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$duplicate_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $duplicate_lists .= "'$row[0]',"; + $L++; + } + $duplicate_lists = eregi_replace(",$",'',$duplicate_lists); + } + } + } + ### find list of list_ids in this campaign + if (eregi("DUPLIST",$duplicate_check)) # duplicate check within list + { + if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPLIST\n";} + $duplicate_found=0; + $stmt="SELECT lead_id,list_id from vicidial_list where phone_number='$phone_number' and list_id='$list_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $duplicate_found=1; + $row=mysql_fetch_row($rslt); + $duplicate_lead_id = $row[0]; + $duplicate_lead_list = $row[1]; + } + + if ($duplicate_found > 0) + { + $result = 'ERROR'; + $result_reason = "add_lead DUPLICATE PHONE NUMBER IN LIST"; + $data = "$phone_number|$list_id|$duplicate_lead_id"; + echo "$result: $result_reason - $data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + } + if (eregi("DUPCAMP",$duplicate_check)) # duplicate check within campaign lists + { + if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPCAMP - $duplicate_lists\n";} + $duplicate_found=0; + $stmt="SELECT lead_id,list_id from vicidial_list where phone_number='$phone_number' and list_id IN($duplicate_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $duplicate_found=1; + $row=mysql_fetch_row($rslt); + $duplicate_lead_id = $row[0]; + $duplicate_lead_list = $row[1]; + } + + if ($duplicate_found > 0) + { + $result = 'ERROR'; + $result_reason = "add_lead DUPLICATE PHONE NUMBER IN CAMPAIGN LISTS"; + $data = "$phone_number|$list_id|$duplicate_lead_id|$duplicate_lead_list"; + echo "$result: $result_reason - $data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + } + if (eregi("DUPSYS",$duplicate_check)) # duplicate check within entire system + { + if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPSYS\n";} + $duplicate_found=0; + $stmt="SELECT lead_id,list_id from vicidial_list where phone_number='$phone_number' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $duplicate_found=1; + $row=mysql_fetch_row($rslt); + $duplicate_lead_id = $row[0]; + $duplicate_lead_list = $row[1]; + } + + if ($duplicate_found > 0) + { + $result = 'ERROR'; + $result_reason = "add_lead DUPLICATE PHONE NUMBER IN SYSTEM"; + $data = "$phone_number|$list_id|$duplicate_lead_id|$duplicate_lead_list"; + echo "$result: $result_reason - $data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + } + if (eregi("DUPTITLEALTPHONELIST",$duplicate_check)) # duplicate title/alt_phone check within list + { + if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPTITLEALTPHONELIST\n";} + $duplicate_found=0; + $stmt="SELECT lead_id,list_id from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $duplicate_found=1; + $row=mysql_fetch_row($rslt); + $duplicate_lead_id = $row[0]; + $duplicate_lead_list = $row[1]; + } + + if ($duplicate_found > 0) + { + $result = 'ERROR'; + $result_reason = "add_lead DUPLICATE TITLE ALT_PHONE IN LIST"; + $data = "$title|$alt_phone|$list_id|$duplicate_lead_id"; + echo "$result: $result_reason - $data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + } + if (eregi("DUPTITLEALTPHONECAMP",$duplicate_check)) # duplicate title/alt_phone check within campaign lists + { + if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPTITLEALTPHONECAMP\n";} + $duplicate_found=0; + $stmt="SELECT lead_id,list_id from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id IN($duplicate_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $duplicate_found=1; + $row=mysql_fetch_row($rslt); + $duplicate_lead_id = $row[0]; + $duplicate_lead_list = $row[1]; + } + + if ($duplicate_found > 0) + { + $result = 'ERROR'; + $result_reason = "add_lead DUPLICATE TITLE ALT_PHONE IN CAMPAIGN LISTS"; + $data = "$title|$alt_phone|$list_id|$duplicate_lead_id|$duplicate_lead_list"; + echo "$result: $result_reason - $data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + } + if (eregi("DUPTITLEALTPHONESYS",$duplicate_check)) # duplicate title/alt_phone check within entire system + { + if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPTITLEALTPHONESYS\n";} + $duplicate_found=0; + $stmt="SELECT lead_id,list_id from vicidial_list where title='$title' and alt_phone='$alt_phone' limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $duplicate_found=1; + $row=mysql_fetch_row($rslt); + $duplicate_lead_id = $row[0]; + $duplicate_lead_list = $row[1]; + } + + if ($duplicate_found > 0) + { + $result = 'ERROR'; + $result_reason = "add_lead DUPLICATE TITLE ALT_PHONE IN SYSTEM"; + $data = "$title|$alt_phone|$list_id|$duplicate_lead_id|$duplicate_lead_list"; + echo "$result: $result_reason - $data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + } + ### END checking for duplicate if defined ### + + + ### get current gmt_offset of the phone_number + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); + + + ### insert a new lead in the system with this phone number + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='NEW',user='$user',vendor_lead_code='$vendor_lead_code',source_id='$source_id',gmt_offset_now='$gmt_offset',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',country_code='$country_code',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',called_since_last_reset='N',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',rank='$rank',owner='$owner';"; + if ($DB>0) {echo "DEBUG: add_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $lead_id = mysql_insert_id($link); + + $result = 'SUCCESS'; + $result_reason = "add_lead LEAD HAS BEEN ADDED"; + echo "$result: $result_reason - $phone_number|$list_id|$lead_id|$gmt_offset|$user\n"; + $data = "$phone_number|$list_id|$lead_id|$gmt_offset"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + + if (strlen($multi_alt_phones) > 5) + { + $map=$MT; $ALTm_phone_code=$MT; $ALTm_phone_number=$MT; $ALTm_phone_note=$MT; + $map = explode('!', $multi_alt_phones); + $map_count = count($map); + if ($DB>0) {echo "DEBUG: add_lead multi-al-entry - $a|$map_count|$multi_alt_phones\n";} + $g++; + $r=0; $s=0; $inserted_alt_phones=0; + while ($r < $map_count) + { + $s++; + $ncn=$MT; + $ncn = explode('_', $map[$r]); + print "$ncn[0]|$ncn[1]|$ncn[2]"; + + if (strlen($forcephonecode) > 0) + {$ALTm_phone_code[$r] = $forcephonecode;} + else + {$ALTm_phone_code[$r] = $ncn[1];} + if (strlen($ALTm_phone_code[$r]) < 1) + {$ALTm_phone_code[$r]='1';} + $ALTm_phone_number[$r] = $ncn[0]; + $ALTm_phone_note[$r] = $ncn[2]; + $stmt = "INSERT INTO vicidial_list_alt_phones (lead_id,phone_code,phone_number,alt_phone_note,alt_phone_count) values('$lead_id','$ALTm_phone_code[$r]','$ALTm_phone_number[$r]','$ALTm_phone_note[$r]','$s');"; + if ($DB>0) {echo "DEBUG: add_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $Zaffected_rows = mysql_affected_rows($link); + $inserted_alt_phones = ($inserted_alt_phones + $Zaffected_rows); + $r++; + } + $result = 'NOTICE'; + $result_reason = "add_lead MULTI-ALT-PHONE NUMBERS LOADED"; + echo "$result: $result_reason - $inserted_alt_phones|$lead_id|$user\n"; + $data = "$inserted_alt_phones|$lead_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + + if ($add_to_hopper == 'Y') + { + $dialable=1; + + $stmt="SELECT local_call_time,vicidial_campaigns.campaign_id from vicidial_campaigns,vicidial_lists where list_id='$list_id' and vicidial_campaigns.campaign_id=vicidial_lists.campaign_id;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $local_call_time=$row[0]; + $VD_campaign_id=$row[1]; + + if ($hopper_local_call_time_check == 'Y') + { + ### call function to determine if lead is dialable + $dialable = dialable_gmt($DB,$link,$local_call_time,$gmt_offset,$state); + } + if ($dialable < 1) + { + $result = 'NOTICE'; + $result_reason = "add_lead NOT ADDED TO HOPPER, OUTSIDE OF LOCAL TIME"; + echo "$result: $result_reason - $phone_number|$lead_id|$gmt_offset|$dialable|$user\n"; + $data = "$phone_number|$lead_id|$gmt_offset|$dialable"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + ### code to insert into hopper goes here + + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$list_id',gmt_offset_now='$gmt_offset',state='$state',user='',priority='$hopper_priority';"; + if ($DB>0) {echo "DEBUG: add_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $Haffected_rows = mysql_affected_rows($link); + if ($Haffected_rows > 0) + { + $hopper_id = mysql_insert_id($link); + + $result = 'NOTICE'; + $result_reason = "add_lead ADDED TO HOPPER"; + echo "$result: $result_reason - $phone_number|$lead_id|$hopper_id|$user\n"; + $data = "$phone_number|$lead_id|$hopper_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + $result = 'NOTICE'; + $result_reason = "add_lead NOT ADDED TO HOPPER"; + echo "$result: $result_reason - $phone_number|$lead_id|$stmt|$user\n"; + $data = "$phone_number|$lead_id|$stmt"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + } + } + else + { + $result = 'ERROR'; + $result_reason = "add_lead LEAD HAS NOT BEEN ADDED"; + echo "$result: $result_reason - $phone_number|$list_id|$stmt|$user\n"; + $data = "$phone_number|$list_id|$stmt"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + } + exit; + } + } +################################################################################ +### END add_lead +################################################################################ + + + +$result = 'ERROR'; +$result_reason = "NO FUNCTION SPECIFIED"; +echo "$result: $result_reason\n"; +api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + + + + + + + + + +if ($format=='debug') + { + $ENDtime = date("U"); + $RUNtime = ($ENDtime - $StarTtime); + echo "\n"; + echo "\n\n\n"; + } + +exit; + + + + + + + +##### FUNCTIONS ##### + +##### LOOKUP GMT, FINDS THE CURRENT GMT OFFSET FOR A PHONE NUMBER ##### + +function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code) +{ +require("dbconnect.php"); + +$postalgmt_found=0; +if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) + { + if (preg_match('/^1$/', $phone_code)) + { + $stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[3]; + $dst_range = $row[4]; + $PC_processed++; + $postalgmt_found++; + $post++; + } + } + } +if ($postalgmt_found < 1) + { + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =='1') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### MEXICO ### + if ($phone_code =='52') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### AUSTRALIA ### + if ($phone_code =='61') + { + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $PC_processed++; + $stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); + $dst = $row[5]; + $dst_range = $row[6]; + $PC_processed++; + } + } + } + +### Find out if DST to raise the gmt offset ### +$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); +$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); + $hour = date("H",$AC_localtime); + $min = date("i",$AC_localtime); + $sec = date("s",$AC_localtime); + $mon = date("m",$AC_localtime); + $mday = date("d",$AC_localtime); + $wday = date("w",$AC_localtime); + $year = date("Y",$AC_localtime); +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + +$AC_processed=0; +if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) + { + if ($DBX) {print " Second Sunday March to First Sunday November\n";} + #********************************************************************** + # SSM-FSN + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on Second Sunday March to First Sunday November at 2 am. + # INPUTS: + # mm INTEGER Month. + # dd INTEGER Day of the month. + # ns INTEGER Seconds into the day. + # dow INTEGER Day of week (0=Sunday, to 6=Saturday) + # OPTIONAL INPUT: + # timezone INTEGER hour difference UTC - local standard time + # (DEFAULT is blank) + # make calculations based on UTC time, + # which means shift at 10:00 UTC in April + # and 9:00 UTC in October + # OUTPUT: + # INTEGER 1 = DST, 0 = not DST + # + # S M T W T F S + # 1 2 3 4 5 6 7 + # 8 9 10 11 12 13 14 + #15 16 17 18 19 20 21 + #22 23 24 25 26 27 28 + #29 30 31 + # + # S M T W T F S + # 1 2 3 4 5 6 + # 7 8 9 10 11 12 13 + #14 15 16 17 18 19 20 + #21 22 23 24 25 26 27 + #28 29 30 31 + # + #********************************************************************** + + $USACAN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 11) { + $USACAN_DST=0; + } elseif ($mm >= 4 and $mm <= 10) { + $USACAN_DST=1; + } elseif ($mm == 3) { + if ($dd > 13) { + $USACAN_DST=1; + } elseif ($dd >= ($dow+8)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USACAN_DST=0; + } else { + $USACAN_DST=1; + } + } + } else { + $USACAN_DST=0; + } + } elseif ($mm == 11) { + if ($dd > 7) { + $USACAN_DST=0; + } elseif ($dd < ($dow+1)) { + $USACAN_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } else { # local time calculations + if ($ns < 7200) { + $USACAN_DST=1; + } else { + $USACAN_DST=0; + } + } + } else { + $USACAN_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) + { + if ($DBX) {print " First Sunday April to Last Sunday October\n";} + #********************************************************************** + # FSA-LSO + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sunday in April and last Sunday in October at 2 am. + #********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; + } elseif ($mm >= 5 and $mm <= 9) { + $USA_DST=1; + } elseif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } else { + if ($dow == 0 and $ns < 7200) { + $USA_DST=0; + } else { + $USA_DST=1; + } + } + } else { + $USA_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; + } elseif ($dd < ($dow+25)) { + $USA_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } else { # local time calculations + if ($ns < 7200) { + $USA_DST=1; + } else { + $USA_DST=0; + } + } + } else { + $USA_DST=0; + } + } # end of month checks + + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) + { + if ($DBX) {print " Last Sunday March to Last Sunday October\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Sunday in March and last Sunday in October at 1 am. + #********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; + } elseif ($mm >= 4 and $mm <= 9) { + $GBR_DST=1; + } elseif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; + } elseif ($dd < ($dow+25)) { + $GBR_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } else { # local time calculations + if ($ns < 3600) { + $GBR_DST=0; + } else { + $GBR_DST=1; + } + } + } else { + $GBR_DST=1; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; + } elseif ($dd < ($dow+25)) { + $GBR_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } else { # local time calculations + if ($ns < 3600) { + $GBR_DST=1; + } else { + $GBR_DST=0; + } + } + } else { + $GBR_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } +if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) + { + if ($DBX) {print " Last Sunday October to Last Sunday March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Sunday in October and last Sunday in March at 1 am. + #********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUS_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; + } elseif ($dd < ($dow+25)) { + $AUS_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } else { # local time calculations + if ($ns < 3600) { + $AUS_DST=1; + } else { + $AUS_DST=0; + } + } + } else { + $AUS_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; + } elseif ($dd < ($dow+25)) { + $AUS_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } else { # local time calculations + if ($ns < 3600) { + $AUS_DST=0; + } else { + $AUS_DST=1; + } + } + } else { + $AUS_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) + { + if ($DBX) {print " First Sunday October to Last Sunday March\n";} + #********************************************************************** + # TASMANIA ONLY + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sunday in October and last Sunday in March at 1 am. + #********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $AUST_DST=0; + } elseif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; + } elseif ($dd < ($dow+25)) { + $AUST_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } else { # local time calculations + if ($ns < 3600) { + $AUST_DST=1; + } else { + $AUST_DST=0; + } + } + } else { + $AUST_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUST_DST=0; + } else { + $AUST_DST=1; + } + } + } else { + $AUST_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'FSO-FSA') ) + { + if ($DBX) {print " Sunday in October to First Sunday in April\n";} + #********************************************************************** + # FSO-FSA + # 2008+ AUSTRALIA ONLY (country code 61) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sunday in October and first Sunday in April at 1 am. + #********************************************************************** + + $AUSE_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 or $mm > 10) { + $AUSE_DST=1; + } elseif ($mm >= 5 and $mm <= 9) { + $AUSE_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $AUSE_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (3600+$timezone*3600)) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } else { + if ($dow == 0 and $ns < 7200) { + $AUSE_DST=1; + } else { + $AUSE_DST=0; + } + } + } else { + $AUSE_DST=1; + } + } elseif ($mm == 10) { + if ($dd >= 8) { + $AUSE_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $AUSE_DST=0; + } else { + $AUSE_DST=1; + } + } + } else { + $AUSE_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $AUSE_DST\n";} + if ($AUSE_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) + { + if ($DBX) {print " First Sunday October to Third Sunday March\n";} + #********************************************************************** + # This is s 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on first Sunday in October and third Sunday in March at 1 am. + #********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; + } elseif ($mm >= 4 and $mm <= 9) { + $NZL_DST=0; + } elseif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; + } elseif ($dd < ($dow+14)) { + $NZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } else { # local time calculations + if ($ns < 3600) { + $NZL_DST=1; + } else { + $NZL_DST=0; + } + } + } else { + $NZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 and $ns < (7200+$timezone*3600)) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } else { + if ($dow == 0 and $ns < 3600) { + $NZL_DST=0; + } else { + $NZL_DST=1; + } + } + } else { + $NZL_DST=0; + } + } # end of month checks + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'LSS-FSA') ) + { + if ($DBX) {print " Last Sunday in September to First Sunday in April\n";} + #********************************************************************** + # LSS-FSA + # 2007+ NEW ZEALAND (country code 64) + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. + # Based on last Sunday in September and first Sunday in April at 1 am. + #********************************************************************** + + $NZLN_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 9) { + $NZLN_DST=1; + } elseif ($mm >= 5 && $mm <= 9) { + $NZLN_DST=0; + } elseif ($mm == 4) { + if ($dd > 7) { + $NZLN_DST=0; + } elseif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (3600+$timezone*3600)) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } else { + if ($dow == 0 && $ns < 7200) { + $NZLN_DST=1; + } else { + $NZLN_DST=0; + } + } + } else { + $NZLN_DST=1; + } + } elseif ($mm == 9) { + if ($dd < 25) { + $NZLN_DST=0; + } elseif ($dd < ($dow+25)) { + $NZLN_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } else { # local time calculations + if ($ns < 3600) { + $NZLN_DST=0; + } else { + $NZLN_DST=1; + } + } + } else { + $NZLN_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $NZLN_DST\n";} + if ($NZLN_DST) {$gmt_offset++;} + $AC_processed++; + } + +if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) + { + if ($DBX) {print " Third Sunday October to Last Sunday February\n";} + #********************************************************************** + # TSO-LSF + # This is returns 1 if Daylight Savings Time is in effect and 0 if + # Standard time is in effect. Brazil + # Based on Third Sunday October to Last Sunday February at 1 am. + #********************************************************************** + + $BZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 2 || $mm > 10) { + $BZL_DST=1; + } elseif ($mm >= 3 and $mm <= 9) { + $BZL_DST=0; + } elseif ($mm == 2) { + if ($dd < 22) { + $BZL_DST=1; + } elseif ($dd < ($dow+22)) { + $BZL_DST=1; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } else { # local time calculations + if ($ns < 3600) { + $BZL_DST=1; + } else { + $BZL_DST=0; + } + } + } else { + $BZL_DST=0; + } + } elseif ($mm == 10) { + if ($dd < 22) { + $BZL_DST=0; + } elseif ($dd < ($dow+22)) { + $BZL_DST=0; + } elseif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } else { # local time calculations + if ($ns < 3600) { + $BZL_DST=0; + } else { + $BZL_DST=1; + } + } + } else { + $BZL_DST=1; + } + } # end of month checks + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_DST) {$gmt_offset++;} + $AC_processed++; + } + +if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + +return $gmt_offset; +} + + + + + +##### DETERMINE IF LEAD IS DIALABLE ##### +function dialable_gmt($DB,$link,$local_call_time,$gmt_offset,$state) + { + $dialable=0; + + $pzone=3600 * $gmt_offset; + $pmin=(gmdate("i", time() + $pzone)); + $phour=( (gmdate("G", time() + $pzone)) * 100); + $pday=gmdate("w", time() + $pzone); + $tz = sprintf("%.2f", $p); + $GMT_gmt = "$tz"; + $GMT_day = "$pday"; + $GMT_hour = ($phour + $pmin); + + $stmt="SELECT call_time_id,call_time_name,call_time_comments,ct_default_start,ct_default_stop,ct_sunday_start,ct_sunday_stop,ct_monday_start,ct_monday_stop,ct_tuesday_start,ct_tuesday_stop,ct_wednesday_start,ct_wednesday_stop,ct_thursday_start,ct_thursday_stop,ct_friday_start,ct_friday_stop,ct_saturday_start,ct_saturday_stop,ct_state_call_times FROM vicidial_call_times where call_time_id='$local_call_time';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $Gct_default_start = "$rowx[3]"; + $Gct_default_stop = "$rowx[4]"; + $Gct_sunday_start = "$rowx[5]"; + $Gct_sunday_stop = "$rowx[6]"; + $Gct_monday_start = "$rowx[7]"; + $Gct_monday_stop = "$rowx[8]"; + $Gct_tuesday_start = "$rowx[9]"; + $Gct_tuesday_stop = "$rowx[10]"; + $Gct_wednesday_start = "$rowx[11]"; + $Gct_wednesday_stop = "$rowx[12]"; + $Gct_thursday_start = "$rowx[13]"; + $Gct_thursday_stop = "$rowx[14]"; + $Gct_friday_start = "$rowx[15]"; + $Gct_friday_stop = "$rowx[16]"; + $Gct_saturday_start = "$rowx[17]"; + $Gct_saturday_stop = "$rowx[18]"; + $Gct_state_call_times = "$rowx[19]"; + + if ($GMT_day==0) #### Sunday local time + { + if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) + { + if ( ($GMT_hour>=$Gct_default_start) and ($GMT_hour<$Gct_default_stop) ) + {$dialable=1;} + } + else + { + if ( ($GMT_hour>=$Gct_sunday_start) and ($GMT_hour<$Gct_sunday_stop) ) + {$dialable=1;} + } + } + if ($GMT_day==1) #### Monday local time + { + if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) + { + if ( ($GMT_hour>=$Gct_default_start) and ($GMT_hour<$Gct_default_stop) ) + {$dialable=1;} + } + else + { + if ( ($GMT_hour>=$Gct_monday_start) and ($GMT_hour<$Gct_monday_stop) ) + {$dialable=1;} + } + } + if ($GMT_day==2) #### Tuesday local time + { + if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) + { + if ( ($GMT_hour>=$Gct_default_start) and ($GMT_hour<$Gct_default_stop) ) + {$dialable=1;} + } + else + { + if ( ($GMT_hour>=$Gct_tuesday_start) and ($GMT_hour<$Gct_tuesday_stop) ) + {$dialable=1;} + } + } + if ($GMT_day==3) #### Wednesday local time + { + if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) + { + if ( ($GMT_hour>=$Gct_default_start) and ($GMT_hour<$Gct_default_stop) ) + {$dialable=1;} + } + else + { + if ( ($GMT_hour>=$Gct_wednesday_start) and ($GMT_hour<$Gct_wednesday_stop) ) + {$dialable=1;} + } + } + if ($GMT_day==4) #### Thursday local time + { + if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) + { + if ( ($GMT_hour>=$Gct_default_start) and ($GMT_hour<$Gct_default_stop) ) + {$dialable=1;} + } + else + { + if ( ($GMT_hour>=$Gct_thursday_start) and ($GMT_hour<$Gct_thursday_stop) ) + {$dialable=1;} + } + } + if ($GMT_day==5) #### Friday local time + { + if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) + { + if ( ($GMT_hour>=$Gct_default_start) and ($GMT_hour<$Gct_default_stop) ) + {$dialable=1;} + } + else + { + if ( ($GMT_hour>=$Gct_friday_start) and ($GMT_hour<$Gct_friday_stop) ) + {$dialable=1;} + } + } + if ($GMT_day==6) #### Saturday local time + { + if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) + { + if ( ($GMT_hour>=$Gct_default_start) and ($GMT_hour<$Gct_default_stop) ) + {$dialable=1;} + } + else + { + if ( ($GMT_hour>=$Gct_saturday_start) and ($GMT_hour<$Gct_saturday_stop) ) + {$dialable=1;} + } + } + + return $dialable; + } + +/* + $ct_states = ''; + $ct_state_gmt_SQL = ''; + $ct_srs=0; + $b=0; + if (strlen($Gct_state_call_times)>2) + { + $state_rules = explode('|',$Gct_state_call_times); + $ct_srs = ((count($state_rules)) - 2); + } + while($ct_srs >= $b) + { + if ( (strlen($state_rules[$b])>1) and (strlen($state)>1) ) + { + $stmt="SELECT STAR from vicidial_state_call_times where state_call_time_id='$state_rules[$b]' and state_call_time_state='$state';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Gstate_call_time_id = "$row[0]"; + $Gstate_call_time_state = "$row[1]"; + $Gsct_default_start = "$row[4]"; + $Gsct_default_stop = "$row[5]"; + $Gsct_sunday_start = "$row[6]"; + $Gsct_sunday_stop = "$row[7]"; + $Gsct_monday_start = "$row[8]"; + $Gsct_monday_stop = "$row[9]"; + $Gsct_tuesday_start = "$row[10]"; + $Gsct_tuesday_stop = "$row[11]"; + $Gsct_wednesday_start = "$row[12]"; + $Gsct_wednesday_stop = "$row[13]"; + $Gsct_thursday_start = "$row[14]"; + $Gsct_thursday_stop = "$row[15]"; + $Gsct_friday_start = "$row[16]"; + $Gsct_friday_stop = "$row[17]"; + $Gsct_saturday_start = "$row[18]"; + $Gsct_saturday_stop = "$row[19]"; + + $ct_states .="'$Gstate_call_time_state',"; + + $r=0; + $state_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + $state_gmt = "$state_gmt'99'"; + $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; + } + + $b++; + } + if (strlen($ct_states)>2) + { + $ct_states = eregi_replace(",$",'',$ct_states); + $ct_statesSQL = "and state NOT IN($ct_states)"; + } + else + { + $ct_statesSQL = ""; + } + +*/ + + + + +##### Logging ##### +function api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data) + { + if ($api_logging > 0) + { + $NOW_TIME = date("Y-m-d H:i:s"); + # api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + $stmt="INSERT INTO vicidial_api_log set user='$user',agent_user='$agent_user',function='$function',value='$value',result='$result',result_reason='$result_reason',source='$source',data='$data',api_date='$NOW_TIME',api_script='$api_script';"; + $rslt=mysql_query($stmt, $link); + } + return 1; + } + +?> diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/remote_dispo.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/remote_dispo.php new file mode 100644 index 00000000..dd8a67cd --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/remote_dispo.php @@ -0,0 +1,330 @@ + LICENSE: AGPLv2 +# +# this is the remote agent disposition screen for calls sent to remote agents. +# This allows the remote agent to modify customer information and disposition +# the call +# +# CHANGES +# +# 60619-1626 - Added variable filtering to eliminate SQL injection attack threat +# 90508-0644 - Changed to PHP long tags +# + + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["address1"])) {$address1=$_GET["address1"];} + elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} +if (isset($_GET["address2"])) {$address2=$_GET["address2"];} + elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} +if (isset($_GET["address3"])) {$address3=$_GET["address3"];} + elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} +if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} + elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} +if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} + elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["channel"])) {$channel=$_GET["channel"];} + elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} +if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} + elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} +if (isset($_GET["city"])) {$city=$_GET["city"];} + elseif (isset($_POST["city"])) {$city=$_POST["city"];} +if (isset($_GET["comments"])) {$comments=$_GET["comments"];} + elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} +if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} + elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} +if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} + elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} + elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["email"];} +if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} + elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} + elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} + elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} + elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} +if (isset($_GET["phone"])) {$phone=$_GET["phone"];} + elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} +if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} + elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} +if (isset($_GET["province"])) {$province=$_GET["province"];} + elseif (isset($_POST["province"])) {$province=$_POST["province"];} +if (isset($_GET["security"])) {$security=$_GET["security"];} + elseif (isset($_POST["security"])) {$security=$_POST["security"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["state"])) {$state=$_GET["state"];} + elseif (isset($_POST["state"])) {$state=$_POST["state"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} + elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} + elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$ext_context = 'demo'; +if (!isset($begin_date)) {$begin_date = $TODAY;} +if (!isset($end_date)) {$end_date = $TODAY;} + + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + + + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + $fullname = $row[0]; + fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + + } + else + { + fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + } + +?> + + +VICIDIAL REMOTO: Finaliz. de chamada +\n"; +?> + + +
+ +"; + +if ($end_call > 0) +{ + +$call_length = ($STARTtime - $call_began); + + ### insert a NEW record to the vicidial_closer_log table + $stmt="UPDATE vicidial_closer_log set end_epoch='$STARTtime', length_in_sec='" . mysql_real_escape_string($call_length) . "', status='" . mysql_real_escape_string($status) . "', user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by start_epoch desc limit 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + ### update the lead record in the vicidial_list table + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Chamada finalizada       $NOW_TIME\n

\n"; + + echo "
\n"; + +} +else +{ + $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $lead_count = $row[0]; + + if ($lead_count > 0) + { + + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $lead_id = "$row[0]"; + $tsr = "$row[4]"; + $vendor_id = "$row[5]"; + $list_id = "$row[7]"; + $campaign_id = "$row[8]"; + $phone_code = "$row[10]"; + $phone_number = "$row[11]"; + $title = "$row[12]"; + $first_name = "$row[13]"; # + $middle_initial = "$row[14]"; + $last_name = "$row[15]"; # + $address1 = "$row[16]"; # + $address2 = "$row[17]"; # + $address3 = "$row[18]"; # + $city = "$row[19]"; # + $state = "$row[20]"; # + $province = "$row[21]"; # + $postal_code = "$row[22]"; # + $country_code = "$row[23]"; # + $gender = "$row[24]"; + $date_of_birth = "$row[25]"; + $alt_phone = "$row[26]"; # + $email = "$row[27]"; # + $security = "$row[28]"; # + $comments = "$row[29]"; # + + echo "
Informações da Chamada: $first_name $last_name - $phone_number

\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "
Vendor ID: $vendor_id     ID da Campanha: $campaign_id
Fronter: $tsr     ID da Lista: $list_id
Nome:   \n"; + echo " Sobrenome:
Endereço 1 :
Endereço 2 :
Endereço 3 :
Cidade :
Estado:   \n"; + echo " CEP:
Província:
País :
Tel. Alt. :
Email :
Segurança:
Comentários :
Finalização:
\n"; + echo "


\n"; + + } + else + { + echo "procura de registro FALHOU para este lead_id $lead_id       $NOW_TIME\n

\n"; +# echo "Close this window\n

\n"; + } + + + + + + +} + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "\n\n\n


\n\n"; + + +echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; + + +?> + + + + + + + + + + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/timeclock_edit.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/timeclock_edit.php new file mode 100644 index 00000000..d938594f --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/timeclock_edit.php @@ -0,0 +1,481 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 80624-1342 - First build +# 80701-1323 - functional beta version done +# 90310-2109 - Added admin header +# 90508-0644 - Changed to PHP long tags +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["oldLOGINepoch"])) {$oldLOGINepoch=$_GET["oldLOGINepoch"];} + elseif (isset($_POST["oldLOGINepoch"])) {$oldLOGINepoch=$_POST["oldLOGINepoch"];} +if (isset($_GET["oldLOGOUTepoch"])) {$oldLOGOUTepoch=$_GET["oldLOGOUTepoch"];} + elseif (isset($_POST["oldLOGOUTepoch"])) {$oldLOGOUTepoch=$_POST["oldLOGOUTepoch"];} +if (isset($_GET["oldLOGINdate"])) {$oldLOGINdate=$_GET["oldLOGINdate"];} + elseif (isset($_POST["oldLOGINdate"])) {$oldLOGINdate=$_POST["oldLOGINdate"];} +if (isset($_GET["oldLOGOUTdate"])) {$oldLOGOUTdate=$_GET["oldLOGOUTdate"];} + elseif (isset($_POST["oldLOGOUTdate"])) {$oldLOGOUTdate=$_POST["oldLOGOUTdate"];} +if (isset($_GET["LOGINepoch"])) {$LOGINepoch=$_GET["LOGINepoch"];} + elseif (isset($_POST["LOGINepoch"])) {$LOGINepoch=$_POST["LOGINepoch"];} +if (isset($_GET["LOGOUTepoch"])) {$LOGOUTepoch=$_GET["LOGOUTepoch"];} + elseif (isset($_POST["LOGOUTepoch"])) {$LOGOUTepoch=$_POST["LOGOUTepoch"];} +if (isset($_GET["notes"])) {$notes=$_GET["notes"];} + elseif (isset($_POST["notes"])) {$notes=$_POST["notes"];} +if (isset($_GET["LOGINevent_id"])) {$LOGINevent_id=$_GET["LOGINevent_id"];} + elseif (isset($_POST["LOGINevent_id"])) {$LOGINevent_id=$_POST["LOGINevent_id"];} +if (isset($_GET["LOGOUTevent_id"])) {$LOGOUTevent_id=$_GET["LOGOUTevent_id"];} + elseif (isset($_POST["LOGOUTevent_id"])) {$LOGOUTevent_id=$_POST["LOGOUTevent_id"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["timeclock_id"])) {$timeclock_id=$_GET["timeclock_id"];} + elseif (isset($_POST["timeclock_id"])) {$timeclock_id=$_POST["timeclock_id"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$StarTtimE = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$ip = getenv("REMOTE_ADDR"); +$invalid_record=0; + +if (!isset($begin_date)) {$begin_date = $TODAY;} +if (!isset($end_date)) {$end_date = $TODAY;} + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + + if($auth>0) + { + $stmt="SELECT full_name,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $modify_timeclock_log = $row[1]; + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + } + + $stmt="SELECT full_name,user_group from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + + $stmt="SELECT event,tcid_link from vicidial_timeclock_log where timeclock_id='" . mysql_real_escape_string($timeclock_id) . "';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $tc_logs_to_print = mysql_num_rows($rslt); + if ($tc_logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $event = $row[0]; + $tcid_link = $row[1]; + } + if (ereg("LOGIN",$event)) + { + $LOGINevent_id = $timeclock_id; + $LOGOUTevent_id = $tcid_link; + if ( (ereg('NULL',$LOGOUTevent_id)) or (strlen($LOGOUTevent_id)<1) ) + {$invalid_record++;} + } + if (ereg("LOGOUT",$event)) + { + $LOGOUTevent_id = $timeclock_id; + $stmt="SELECT timeclock_id from vicidial_timeclock_log where tcid_link='" . mysql_real_escape_string($timeclock_id) . "';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $tc_logs_to_print = mysql_num_rows($rslt); + if ($tc_logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $LOGINevent_id = $row[0]; + } + if ( (ereg('NULL',$LOGOUTevent_id)) or (strlen($LOGOUTevent_id)<1) ) + {$invalid_record++;} + } + if (strlen($LOGOUTevent_id)<1) + {$invalid_record++;} + + ### + if ($invalid_record < 1) + { + $stmt="SELECT event_epoch,event_date,login_sec,event,user,user_group,ip_address,shift_id,notes,manager_user,manager_ip,event_datestamp from vicidial_timeclock_log where timeclock_id='$LOGINevent_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $tc_logs_to_print = mysql_num_rows($rslt); + if ($tc_logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $LOGINevent_epoch = $row[0]; + $LOGINevent_date = $row[1]; + $LOGINlogin_sec = $row[2]; + $LOGINevent = $row[3]; + $LOGINuser = $row[4]; + $LOGINuser_group = $row[5]; + $LOGINip_address = $row[6]; + $LOGINshift_id = $row[7]; + $LOGINnotes = $row[8]; + $LOGINmanager_user = $row[9]; + $LOGINmanager_ip = $row[10]; + $LOGINevent_datestamp = $row[11]; + } + $stmt="SELECT event_epoch,event_date,login_sec,event,user,user_group,ip_address,shift_id,notes,manager_user,manager_ip,event_datestamp from vicidial_timeclock_log where timeclock_id='$LOGOUTevent_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $tc_logs_to_print = mysql_num_rows($rslt); + if ($tc_logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $LOGOUTevent_epoch = $row[0]; + $LOGOUTevent_date = $row[1]; + $LOGOUTlogin_sec = $row[2]; + $LOGOUTevent = $row[3]; + $LOGOUTuser = $row[4]; + $LOGOUTuser_group = $row[5]; + $LOGOUTip_address = $row[6]; + $LOGOUTshift_id = $row[7]; + $LOGOUTnotes = $row[8]; + $LOGOUTmanager_user = $row[9]; + $LOGOUTmanager_ip = $row[10]; + $LOGOUTevent_datestamp =$row[11]; + } + + $user=$LOGINuser; + } + } + + + +?> + + + +ADMINISTRATION: Alteração de Ponto +<?php + +##### BEGIN Set variables to make header show properly ##### +$ADD = '3'; +$hh = 'users'; +$TCedit_javascript = '1'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$users_color = '#FFFF99'; +$users_font = 'BLACK'; +$users_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +?> + + +<CENTER> +<TABLE WIDTH=720 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Alteração de Ponto for <?php echo $user ?></TD><TD ALIGN=RIGHT>   </TD></TR> + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B>   \n"; + + + + + +##### BEGIN TIMECLOCK RECORD MODIFY ##### + +if ( ($invalid_record < 1) or (strlen($timeclock_id)<1) ) +{ + +if ($stage == "edit_TC_log") + { + $log_time = ($LOGOUTepoch - $LOGINepoch); + $NEXTevent_epoch = $StarTtimE; + $PREVevent_epoch = 0; + + $stmt="SELECT event_epoch,timeclock_id from vicidial_timeclock_log where timeclock_id > '$LOGOUTevent_id' and user='$user' order by timeclock_id limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $tc_logs_to_print = mysql_num_rows($rslt); + if ($tc_logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $NEXTevent_epoch = $row[0]; + $NEXTevent_id = $row[1]; + } + $stmt="SELECT event_epoch,timeclock_id from vicidial_timeclock_log where timeclock_id < '$LOGINevent_id' and user='$user' order by timeclock_id desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $tc_logs_to_print = mysql_num_rows($rslt); + if ($tc_logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $PREVevent_epoch = $row[0]; + $PREVevent_id = $row[1]; + } + + if ( ($LOGINepoch <= $PREVevent_epoch) || ($LOGOUTepoch >= $NEXTevent_epoch) ) + { + echo "ERRO - Existe um problema com os dados digitados, por favor retorne<BR>\n"; + echo "Uma sessão de Ponto não pode sobrepor outra sessão de ponto<BR>\n"; + echo "$LOGINepoch<BR>\n"; + echo "$LOGOUTepoch<BR>\n"; + echo "$LOGINevent_id<BR>\n"; + echo "$LOGOUTevent_id<BR>\n"; + echo "$LOGINuser<BR>\n"; + echo "$PREVevent_epoch<BR>\n"; + echo "$PREVevent_id<BR>\n"; + echo "$NEXTevent_epoch<BR>\n"; + echo "$NEXTevent_id<BR>\n"; + exit; + } + if ( ($LOGINepoch > $StarTtimE) || ($LOGOUTepoch > $StarTtimE) || ($log_time > 86400) || ($log_time < 1) ) + { + echo "ERRO - Existe um problema com os dados digitados, por favor retorne<BR>\n"; + echo "$LOGINepoch<BR>\n"; + echo "$LOGOUTepoch<BR>\n"; + echo "$notes<BR>\n"; + echo "$LOGINevent_id<BR>\n"; + echo "$LOGOUTevent_id<BR>\n"; + echo "$LOGINuser<BR>\n"; + exit; + } + else + { + $LOGINdatetime = date("Y-m-d H:i:s", $LOGINepoch); + $LOGOUTdatetime = date("Y-m-d H:i:s", $LOGOUTepoch); + + ### update LOGIN record in the timeclock log + $stmtA="UPDATE vicidial_timeclock_log set event_epoch='$LOGINepoch', event_date='$LOGINdatetime', manager_user='$PHP_AUTH_USER', manager_ip='$ip', notes='Manager MODIFY', login_sec='$log_time' where timeclock_id='$LOGINevent_id';"; + if ($DB) {echo "$stmtA\n";} + $rslt=mysql_query($stmtA, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "<!-- UPDATE vicidial_timeclock_log record updated for $user: |$affected_rows|$timeclock_id| -->\n"; + + ### Add a record to the vicidial_admin_log + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TIMECLOCK', event_type='MODIFY', record_id='$LOGINevent_id', event_code='MANAGER MODIFY TIMECLOCK LOG', event_sql=\"$SQL_log\", event_notes='user: $user|$oldLOGINepoch|$oldLOGINdate|sec: $log_time|';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "<!-- NEW vicidial_admin_log record inserted for $PHP_AUTH_USER: |$affected_rows| -->\n"; + + ### update LOGOUT record in the timeclock log + $stmtB="UPDATE vicidial_timeclock_log set event_epoch='$LOGOUTepoch', event_date='$LOGOUTdatetime', manager_user='$PHP_AUTH_USER', manager_ip='$ip', notes='Manager MODIFY', login_sec='$log_time' where timeclock_id='$LOGOUTevent_id';"; + if ($DB) {echo "$stmtB\n";} + $rslt=mysql_query($stmtB, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "<!-- UPDATE vicidial_timeclock_log record updated for $user: |$affected_rows|$timeclock_id| -->\n"; + + ### Add a record to the vicidial_admin_log + $SQL_log = "$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TIMECLOCK', event_type='MODIFY', record_id='$LOGOUTevent_id', event_code='MANAGER MODIFY TIMECLOCK LOG', event_sql=\"$SQL_log\", event_notes='user: $user|$oldLOGOUTepoch|$oldLOGOUTdate|sec: $log_time|';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "<!-- NEW vicidial_admin_log record inserted for $PHP_AUTH_USER: |$affected_rows| -->\n"; + + echo "The timeclock session has been updated. <A HREF=\"$PHP_SELF?timeclock_id=$LOGINevent_id\">Click here to view</A>.<BR>\n"; + exit; + } + } +##### END TIMECLOCK RECORD MODIFY ##### + + + + +echo "\n<BR>"; + +if ($modify_timeclock_log > 0) + { +# $LOGINevent_id = $timeclock_id; +# $LOGOUTevent_id = $tcid_link; + + $event_hours = ($LOGINlogin_sec / 3600); + $event_hours_int = round($event_hours, 2); + $event_hours_int = intval("$event_hours_int"); + $event_minutes = ($event_hours - $event_hours_int); + $event_minutes = ($event_minutes * 60); + $event_minutes_int = round($event_minutes, 0); + if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} + + $stmt="SELECT full_name from vicidial_users where user='$LOGINuser';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + + echo "<BR><BR>\n"; + echo "<form action=$PHP_SELF method=POST name=edit_log id=edit_log>\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<input type=hidden name=user value=\"$user\">\n"; + echo "<input type=hidden name=stage value=edit_TC_log>\n"; + echo "<input type=hidden name=oldLOGINepoch id=oldLOGINepoch value=\"$LOGINevent_epoch\">\n"; + echo "<input type=hidden name=oldLOGOUTepoch id=oldLOGOUTepoch value=\"$LOGOUTevent_epoch\">\n"; + echo "<input type=hidden name=oldLOGINdate id=oldLOGINdate value=\"$LOGINevent_date\">\n"; + echo "<input type=hidden name=oldLOGOUTdate id=oldLOGOUTdate value=\"$LOGOUTevent_date\">\n"; + echo "<input type=hidden name=LOGINepoch id=LOGINepoch value=\"$LOGINevent_epoch\">\n"; + echo "<input type=hidden name=LOGOUTepoch id=LOGOUTepoch value=\"$LOGOUTevent_epoch\">\n"; + echo "<input type=hidden name=LOGINevent_id id=LOGINevent_id value=\"$LOGINevent_id\">\n"; + echo "<input type=hidden name=LOGOUTevent_id id=LOGOUTevent_id value=\"$LOGOUTevent_id\">\n"; + echo "<input type=hidden name=stage value=edit_TC_log>\n"; + echo "<TABLE Border=0><TR><TD COLSPAN=3 ALIGN=LEFT>\n"; + echo "        USER: $LOGINuser ($full_name)         \n"; + echo "HOURS: <span name=login_time id=login_time> $event_hours_int:$event_minutes_int </span>\n"; + echo "</TD></TR>\n"; + echo "<TR><TD>\n"; + echo "<TABLE Border=0>\n"; + echo "<TR><TD ALIGN=RIGHT>LOGIN TIME: </TD><TD ALIGN=RIGHT><input type=text name=LOGINbegin_date id=LOGINbegin_date value=\"$LOGINevent_date\" size=20 maxlength=20 onchange=\"calculate_hours();\"></TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>TIMECLOCK ID: </TD><TD ALIGN=RIGHT>$LOGINevent_id</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>GRUPO DE USUÁRIOS: </TD><TD ALIGN=RIGHT>$LOGINuser_group</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>IP ADDRESS: </TD><TD ALIGN=RIGHT>$LOGINip_address</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>MANAGER USER: </TD><TD ALIGN=RIGHT>$LOGINmanager_user</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>MANAGER IP: </TD><TD ALIGN=RIGHT>$LOGINmanager_ip</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>NOTES: </TD><TD ALIGN=RIGHT>$LOGINnotes</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>LAST CHANGE: </TD><TD ALIGN=RIGHT>$LOGINevent_datestamp</TD></TR>\n"; + echo "</TABLE>\n"; + + echo "</TD><TD>         \n"; + echo "</TD><TD>\n"; + echo "<TABLE Border=0>\n"; + echo "<TR><TD ALIGN=RIGHT>LOGOUT TIME: </TD><TD ALIGN=RIGHT><input type=text name=LOGOUTbegin_date id=LOGOUTbegin_date value=\"$LOGOUTevent_date\" size=20 maxlength=20 onchange=\"calculate_hours();\"></TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>TIMECLOCK ID: </TD><TD ALIGN=RIGHT>$LOGOUTevent_id</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>GRUPO DE USUÁRIOS: </TD><TD ALIGN=RIGHT>$LOGOUTuser_group</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>IP ADDRESS: </TD><TD ALIGN=RIGHT>$LOGOUTip_address</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>MANAGER USER: </TD><TD ALIGN=RIGHT>$LOGOUTmanager_user</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>MANAGER IP: </TD><TD ALIGN=RIGHT>$LOGOUTmanager_ip</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>NOTES: </TD><TD ALIGN=RIGHT>$LOGOUTnotes</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>LAST CHANGE: </TD><TD ALIGN=RIGHT>$LOGOUTevent_datestamp</TD></TR>\n"; + echo "</TABLE>\n"; + echo "</TD></TR>\n"; + + echo "<TR><TD COLSPAN=3 ALIGN=LEFT>\n"; + echo "NEW NOTES: <input type=text name=notes value='' size=80 maxlength=255>\n"; + echo "</TD></TR>\n"; + echo "<TR><TD COLSPAN=3 ALIGN=CENTER>\n"; + echo "<input type=button name=go_submit id=go_submit value=ENVIAR onclick=\"run_submit();\"><BR></form>\n"; + echo "</TD></TR></TABLE>\n"; + echo "<BR><BR>\n"; + } + + +echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Planilha de Tempo</a>\n"; +echo " - <a href=\"./user_stats.php?user=$user\">Estatísticas de Usuário</a>\n"; +echo " - <a href=\"./admin.php?ADD=3&user=$user\">Alterar Usuário</a>\n"; + +echo "</B></TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $StarTtimE); + +echo "\n\n\n<br><br><br>\n\n"; + + +echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +} +else +{ + +echo "ERROR! You cannot edit this timeclock record: $timeclock_id\n"; +} +?> + + +</TD></TR><TABLE> +</body> +</html> + +<?php + +exit; + + + +?> + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/timeclock_report.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/timeclock_report.php new file mode 100644 index 00000000..4aca8d6f --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/timeclock_report.php @@ -0,0 +1,392 @@ +<?php +# timeclock_report.php +# +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 80529-0055 - First build +# 80617-1416 - Fixed totals tally bug +# 80707-0754 - Fixed groups bug, changed formatting +# 90310-2059 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically +# 100216-0042 - Added popup date selector +# + +require("dbconnect.php"); + +##### Pull values from posted form variables ##### +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +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["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["order"])) {$order=$_GET["order"];} + elseif (isset($_POST["order"])) {$order=$_POST["order"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +if (strlen($shift)<2) {$shift='ALL';} +if (strlen($order)<2) {$order='hours_down';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($group)) {$group = '';} +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$stmt="select user_group from vicidial_user_groups order by user_group;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$user_groups_to_print = mysql_num_rows($rslt); +$i=0; + $LISTuser_groups[$i]='---ALL---'; + $i++; + $user_groups_to_print++; +while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTuser_groups[$i] =$row[0]; + $i++; + } + +##### START HTML ##### +?> + +<HTML> +<HEAD> + +<style type="text/css"> +<!-- + div.scroll_callback {height: 300px; width: 620px; overflow: scroll;} + div.scroll_list {height: 400px; width: 140px; overflow: scroll;} + div.scroll_script {height: 331px; width: 600px; background: #FFF5EC; overflow: scroll; font-size: 12px; font-family: sans-serif;} + div.text_input {overflow: auto; font-size: 10px; font-family: sans-serif;} + .body_text {font-size: 13px; font-family: sans-serif;} + .preview_text {font-size: 13px; font-family: sans-serif; background: #CCFFCC} + .preview_text_red {font-size: 13px; font-family: sans-serif; background: #FFCCCC} + .body_small {font-size: 11px; font-family: sans-serif;} + .body_tiny {font-size: 10px; font-family: sans-serif;} + .log_text {font-size: 11px; font-family: monospace;} + .log_text_red {font-size: 11px; font-family: monospace; font-weight: bold; background: #FF3333} + .sd_text {font-size: 16px; font-family: sans-serif; font-weight: bold;} + .sh_text {font-size: 14px; font-family: sans-serif; font-weight: bold;} + .sb_text {font-size: 12px; font-family: sans-serif;} + .sk_text {font-size: 11px; font-family: sans-serif;} + .skb_text {font-size: 13px; font-family: sans-serif; font-weight: bold;} + .ON_conf {font-size: 11px; font-family: monospace; color: black; background: #FFFF99} + .OFF_conf {font-size: 11px; font-family: monospace; color: black; background: #FFCC77} + .cust_form {font-family: sans-serif; font-size: 10px; overflow: auto} + + .select_bold {font-size: 14px; font-family: sans-serif; font-weight: bold;} + .header_white {font-size: 14px; font-family: sans-serif; font-weight: bold; color: white} + .data_records {font-size: 12px; font-family: sans-serif; color: black} + .data_records_fix {font-size: 12px; font-family: monospace; color: black} + .data_records_fix_small {font-size: 9px; font-family: monospace; color: black} + +--> +</style> + +<script language="JavaScript" src="calendar_db.js"></script> +<link rel="stylesheet" href="calendar.css"> + +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<TITLE>UsuárioRelógio Ponto Report + +<?php + +##### BEGIN Set variables to make header show properly ##### +$ADD = '311111'; +$hh = 'usergroups'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$usergroups_color = '#FFFF99'; +$usergroups_font = 'BLACK'; +$usergroups_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + + + +$user_group_ct = count($user_group); +$user_group_string='|'; + +$i=0; +while($i < $user_group_ct) + { + $user_group_string .= "$user_group[$i]|"; + $user_group_SQL .= "'$user_group[$i]',"; + $i++; + } +if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) + { + $user_group_SQL = ""; + } +else + { + $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); + $user_group_SQL = "and vicidial_timeclock_log.user_group IN($user_group_SQL)"; + } + +if ($DB > 0) + { + echo "<BR>\n"; + echo "$user_group_ct|$user_group_string|$user_group_SQL\n"; + echo "<BR>\n"; + } + +echo "<CENTER>\n"; +echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n"; +echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">"; +echo "<TABLE Border=0 CELLSPACING=6><TR><TD ALIGN=LEFT VALIGN=TOP>\n"; + +echo "<font class=\"select_bold\"><B>Período:</B></font><BR><CENTER>\n"; +echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + +?> +<script language="JavaScript"> +var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'query_date' +}); +o_cal.a_tpl.yearscroll = false; +// o_cal.a_tpl.weekstart = 1; // Segunda week start +</script> +<?php + +echo "<BR>to<BR>\n"; +echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">"; + +?> +<script language="JavaScript"> +var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'end_date' +}); +o_cal.a_tpl.yearscroll = false; +// o_cal.a_tpl.weekstart = 1; // Segunda week start +</script> +<?php + +echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +echo "<font class=\"select_bold\"><B>Grupos de Usuário:</B></font><BR><CENTER>\n"; +echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; + $o=0; + while ($user_groups_to_print > $o) + { + if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) + {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + else + {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} + $o++; + } +echo "</SELECT>\n"; + +echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +echo "<font class=\"select_bold\"><B>Order:</B></font><BR>\n"; +echo "<SELECT SIZE=1 NAME=order>\n"; +echo "<option selected value=\"$order\">$order</option>\n"; +echo "<option value=\"\">--</option>\n"; +echo "<option>hours_up</option>\n"; +echo "<option>hours_down</option>\n"; +echo "<option>user_up</option>\n"; +echo "<option>user_down</option>\n"; +echo "<option>name_up</option>\n"; +echo "<option>name_down</option>\n"; +echo "<option>group_up</option>\n"; +echo "<option>group_down</option>\n"; +echo "</SELECT><BR><CENTER>\n"; + +echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +echo "<font class=\"select_bold\"><B>Usuário:</B></font><BR>\n"; +echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; + +echo "<BR><BR><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n"; +echo "</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +echo "</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n"; +echo "<FONT class=\"select_bold\" COLOR=BLACK SIZE=2>     <a href=\"./admin.php?ADD=999999\">RELATÓRIOS</a> </FONT>\n"; + +echo "</TD></TR></TABLE>\n"; +echo "</FORM>\n\n"; + +echo "<PRE><FONT SIZE=3>\n"; + + +echo "UsuárioRelógio Ponto Report $NOW_TIME\n"; + +echo "Time range: $query_date to $end_date\n\n"; +echo "---------- USER TIMECLOCK DETAILS -------------\n"; +echo "These totals do NOT include any active sessions\n</PRE>\n"; + +echo "<TABLE Border=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n"; +echo "<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n"; +echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  USER  </TD>\n"; +echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  NAME  </TD>\n"; +echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  GROUP  </TD>\n"; +echo "<TD ALIGN=CENTER><FONT class=\"header_white\">  HOURS  </TD>\n"; +echo "</TR>\n"; + +$order_SQL=''; +if ($order == 'hours_up') {$order_SQL = "order by login";} +if ($order == 'hours_down') {$order_SQL = "order by login desc";} +if ($order == 'user_up') {$order_SQL = "order by vicidial_users.user";} +if ($order == 'user_down') {$order_SQL = "order by vicidial_users.user desc";} +if ($order == 'name_up') {$order_SQL = "order by full_name";} +if ($order == 'name_down') {$order_SQL = "order by full_name desc";} +if ($order == 'group_up') {$order_SQL = "order by vicidial_timeclock_log.user_group";} +if ($order == 'group_down') {$order_SQL = "order by vicidial_timeclock_log.user_group desc";} + +if (strlen($user) > 0) {$user_SQL = "and vicidial_timeclock_log.user='$user'";} +else {$user_SQL='';} + +$stmt="select vicidial_users.user,full_name,sum(login_sec) as login,vicidial_timeclock_log.user_group from vicidial_users,vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and vicidial_users.user=vicidial_timeclock_log.user $user_SQL $user_group_SQL group by vicidial_users.user,vicidial_timeclock_log.user_group $order_SQL limit 100000;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$rows_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $rows_to_print) + { + $dbHOURS=0; + $row=mysql_fetch_row($rslt); + $user_id[$i] = $row[0]; + $full_name[$i] = $row[1]; + $login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]); + $u_group[$i] = $row[3]; + + if ($login_sec[$i] > 0) + { + $dbHOURS = ($login_sec[$i] / 3600); + $dbHOURS = round($dbHOURS, 2); + $dbHOURS = sprintf("%01.2f", $dbHOURS); + } + else + {$dbHOURS='0.00';} + + $hours[$i] = $dbHOURS; + $hoursSORT[$i] = "$dbHOURS-----$i"; + + $i++; + } + + +$j=0; +while ($j < $rows_to_print) + { + + $hours_split = explode("-----",$hoursSORT[$j]); + $i = $hours_split[1]; + + if (eregi("1$|3$|5$|7$|9$", $j)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "<TR $bgcolor>\n"; + echo "<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n"; + echo "<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n"; + echo "<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n"; + echo "<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n"; + echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n"; + echo "</TR>\n"; + + $j++; + } + + +if ($TOTlogin_sec > 0) + { + $TOTdbHOURS = ($TOTlogin_sec / 3600); + $TOTdbHOURS = round($TOTdbHOURS, 0); + $TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS); + } +else + {$TOTdbHOURS='0.00';} + +$TOThours = $TOTdbHOURS; + + +echo "<TR BGCOLOR=#E6E6E6>\n"; +echo "<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n"; +echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n"; +echo "</TR>\n"; + +echo "</TABLE>\n"; + +echo "\n"; + +/* + $TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60); + $TOTavgWAIT_M = round($TOTavgWAIT_M, 2); + $TOTavgWAIT_M_int = intval("$TOTavgWAIT_M"); + $TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int); + $TOTavgWAIT_S = ($TOTavgWAIT_S * 60); + $TOTavgWAIT_S = round($TOTavgWAIT_S, 0); + if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";} + $TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S"; + $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); + while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} +*/ +?> +</CENTER> +</BODY></HTML> diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/timeclock_status.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/timeclock_status.php new file mode 100644 index 00000000..1932961f --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/timeclock_status.php @@ -0,0 +1,547 @@ +<?php +# timeclock_status.php +# +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 80602-0201 - First Build +# 80603-1500 - formatting changes +# 90310-2103 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} + elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} +if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} + elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $timeclock_end_of_day = $row[2]; + $SSoutbound_autodial_active = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$HHMM = date("Hi"); +$HHteod = substr($timeclock_end_of_day,0,2); +$MMteod = substr($timeclock_end_of_day,2,2); + +if ($HHMM < $timeclock_end_of_day) + {$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d")-1, date("Y"));} +else + {$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d"), date("Y"));} + +$EoDdate = date("Y-m-d H:i:s", $EoD); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if($auth>0) + { + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + } + + } + + +$stmt="select user_group from vicidial_user_groups order by user_group;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$user_groups_to_print = mysql_num_rows($rslt); + $i=0; + $user_groups_to_print++; +while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTuser_groups[$i] =$row[0]; + if ($row[0]==$user_group) + {$FORMuser_groups.="<option value=\"$row[0]\" SELECTED>$row[0]</option>";} + else + {$FORMuser_groups.="<option value=\"$row[0]\">$row[0]</option>";} + $i++; + } + +if (strlen($user_group) > 0) + { + $stmt="SELECT group_name from vicidial_user_groups where user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $group_name = $row[0]; + } + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<title>ADMINISTRATION:Relógio Ponto Status +<?php + +##### BEGIN Set variables to make header show properly ##### +$ADD = '311111'; +$hh = 'usergroups'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$usergroups_color = '#FFFF99'; +$usergroups_font = 'BLACK'; +$usergroups_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + + + +?> +<CENTER> +<TABLE WIDTH=750 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT> +<FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Relógio Ponto Status for <?php echo $user_group ?></TD><TD ALIGN=RIGHT>             +<?php +echo "<a href=\"./timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>TIMECLOCK REPORT</a> | "; +echo "<a href=\"./admin.php?ADD=311111&user_group=$user_group\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2><B>GRUPO DE USUÁRIOS</a>\n"; +?> +</TD></TR> + + + + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; + +echo "<form action=$PHP_SELF method=POST>\n"; +echo "<input type=hidden name=DB value=\"$DB\">\n"; +echo "<select size=1 name=user_group>$FORMuser_groups</select>"; +echo "<input type=submit name=submit value=submit>\n"; + +echo "</B></TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; +echo "<br><center>\n"; + +if (strlen($user_group) < 1) + { + exit; + } + + +##### grab all users in this user_group ##### +$stmt="SELECT user,full_name from vicidial_users where user_group='" . mysql_real_escape_string($user_group) . "' order by full_name;"; +if ($DB>0) {echo "|$stmt|";} +$rslt=mysql_query($stmt, $link); +$users_to_print = mysql_num_rows($rslt); +$o=0; +while ($users_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $users[$o] = $row[0]; + $full_name[$o] = $row[1]; + $Vevent_time[$o] = ''; + $Vevent_epoch[$o] = 0; + $Vcampaign[$o] = ''; + $Tevent_epoch[$o] = ''; + $Tevent_date[$o] = ''; + $Tstatus[$o] = ''; + $Tip_address[$o] = ''; + $Tlogin_time[$o] = ''; + $Tlogin_sec[$o] = 0; + + $o++; + } + +$o=0; +while ($users_to_print > $o) + { + $total_login_time = 0; + ##### grab timeclock status record for this user ##### + $stmt="SELECT event_epoch,event_date,status,ip_address from vicidial_timeclock_status where user='$users[$o]' and event_epoch >= '$EoD';"; + if ($DB>0) {echo "|$stmt|";} + $rslt=mysql_query($stmt, $link); + $stats_to_print = mysql_num_rows($rslt); + if ($stats_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $Tevent_epoch[$o] = $row[0]; + $Tevent_date[$o] = $row[1]; + $Tstatus[$o] = $row[2]; + $Tip_address[$o] = $row[3]; + + if ( ($row[2]=='START') or ($row[2]=='LOGIN') ) + {$bgcolor[$o]='bgcolor="#B9CBFD"';} + else + {$bgcolor[$o]='bgcolor="#9BB9FB"';} + } + + ##### grab timeclock logged-in time for each user ##### + $stmt="SELECT event,event_epoch,login_sec from vicidial_timeclock_log where user='$users[$o]' and event_epoch >= '$EoD';"; + if ($DB>0) {echo "|$stmt|";} + $rslt=mysql_query($stmt, $link); + $logs_to_parse = mysql_num_rows($rslt); + $p=0; + while ($logs_to_parse > $p) + { + $row=mysql_fetch_row($rslt); + if ( (ereg("LOGIN", $row[0])) or (ereg("START", $row[0])) ) + { + $login_sec=''; + $Tevent_time[$o] = date("Y-m-d H:i:s", $row[1]); + } + if (ereg("LOGOUT", $row[0])) + { + $login_sec = $row[2]; + $total_login_time = ($total_login_time + $login_sec); + } + $p++; + } + if ( (strlen($login_sec)<1) and ($logs_to_parse > 0) ) + { + $login_sec = ($STARTtime - $row[1]); + $total_login_time = ($total_login_time + $login_sec); + } + if ($logs_to_parse > 0) + { + $total_login_hours = ($total_login_time / 3600); + $total_login_hours_int = round($total_login_hours, 2); + $total_login_hours_int = intval("$total_login_hours"); + $total_login_minutes = ($total_login_hours - $total_login_hours_int); + $total_login_minutes = ($total_login_minutes * 60); + $total_login_minutes_int = round($total_login_minutes, 0); + if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} + + $Tlogin_time[$o] = "$total_login_hours_int:$total_login_minutes_int"; + $Tlogin_sec[$o] = $total_login_time; + } + else + { + $total_login_time = 0; + $Tlogin_time[$o] = "0:00"; + $Tlogin_sec[$o] = $total_login_time; + } + + if ($DB>0) {echo "|$Tlogin_sec[$o]|$Tlogin_time[$o]|";} + + ##### grab vicidial_agent_log records in this user_group ##### + $stmt="SELECT event_time,UNIX_TIMESTAMP(event_time),campaign_id from vicidial_agent_log where user='$users[$o]' and event_time >= '$EoDdate' order by agent_log_id desc limit 1;"; + if ($DB>0) {echo "|$stmt|";} + $rslt=mysql_query($stmt, $link); + $vals_to_print = mysql_num_rows($rslt); + if ($vals_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $Vevent_time[$o] = $row[0]; + $Vevent_epoch[$o] = $row[1]; + $Vcampaign[$o] = $row[2]; + } + + $o++; + } + + +##### print each user that has any activity for today ##### +echo "<br>\n"; +echo "<center>\n"; + +echo "<TABLE width=720 cellspacing=0 cellpadding=1>\n"; +echo "<TR>\n"; +echo "<TD bgcolor=\"#99FF33\">     </TD><TD align=left> TC Logged in and VICI active</TD>\n"; # bright green +echo "<TD bgcolor=\"#FFFF33\">     </TD><TD align=left> TC Logged in only</TD>\n"; # bright yellow +echo "<TD bgcolor=\"#FF6666\">     </TD><TD align=left> VICI active only</TD>\n"; # bright red +echo "</TR><TR>\n"; +echo "<TD bgcolor=\"#66CC66\">     </TD><TD align=left> TC Logged out and VICI active</TD>\n"; # dull green +echo "<TD bgcolor=\"#CCCC00\">     </TD><TD align=left> TC Logged out only</TD>\n"; # dull yellow +echo "<TD>     </TD><TD align=left>   </TD>\n"; +echo "</TR></TABLE><BR>\n"; + +echo "<B>USER STATUS FOR GRUPO DE USUÁRIOS: $user_group</B>\n"; +echo "<TABLE width=700 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=2># </td><td><font size=2>USER </td><td align=left><font size=2>NAME </td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> TC TIME</td><td align=right><font size=2>TC LOGIN</td><td align=right><font size=2> VICI LAST LOG</td><td align=right><font size=2> VICI CAMPANHA</td></tr>\n"; + +$o=0; +$s=0; +while ($users_to_print > $o) + { + if ( ($Tlogin_sec[$o] > 0) or (strlen($Vevent_time[$o]) > 0) ) + { + if ( ($Tstatus[$o]=='START') or ($Tstatus[$o]=='LOGIN') ) + { + if ($Tlogin_sec[$o] > 0) + {$bgcolor[$o]='bgcolor="#FFFF33"';} # yellow + if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) + {$bgcolor[$o]='bgcolor="#99FF33"';} # green + } + else + { + if ($Tlogin_sec[$o] > 0) + {$bgcolor[$o]='bgcolor="#CCCC00"';} # yellow + if (strlen($Vevent_time[$o]) > 0) + {$bgcolor[$o]='bgcolor="#FF6666"';} # red + if ( ($Tlogin_sec[$o] > 0) and (strlen($Vevent_time[$o]) > 0) ) + {$bgcolor[$o]='bgcolor="#66CC66"';} # green + } + + $s++; + echo "<tr $bgcolor[$o]>"; + echo "<td><font size=1>$s</td>"; + echo "<td><font size=2><a href=\"./user_status.php?user=$users[$o]\">$users[$o]</a></td>"; + echo "<td><font size=2>$full_name[$o]</td>"; + echo "<td><font size=2>$Tip_address[$o]</td>"; + echo "<td align=right><font size=2>$Tlogin_time[$o]</td>"; + echo "<td align=right><font size=2>$Tevent_time[$o]</td>"; + echo "<td align=right><font size=2>$Vevent_time[$o]</td>"; + echo "<td align=right><font size=2>$Vcampaign[$o]</td>"; + echo "</tr>"; + + if (strlen($Tstatus[$o])>0) + {$TOTlogin_sec = ($TOTlogin_sec + $Tlogin_sec[$o]);} + } + $o++; + } + + + +$total_login_hours = ($TOTlogin_sec / 3600); +$total_login_hours_int = round($total_login_hours, 2); +$total_login_hours_int = intval("$total_login_hours"); +$total_login_minutes = ($total_login_hours - $total_login_hours_int); +$total_login_minutes = ($total_login_minutes * 60); +$total_login_minutes_int = round($total_login_minutes, 0); +if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} + +echo "<tr bgcolor=white>"; +echo "<td colspan=4><font size=2>TOTALS</td>"; +echo "<td align=right><font size=2>$total_login_hours_int:$total_login_minutes_int</td>"; +echo "<td align=right><font size=2></td>"; +echo "<td align=right><font size=2></td>"; +echo "<td align=right><font size=2></td>"; +echo "</tr>"; +echo "</table>"; + + + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "\n\n\n<br><br><br>\n\n"; + + +echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<?php +exit; + + + + + + + + + + + +##### vicidial_timeclock log records for user ##### + +$SQday_ARY = explode('-',$begin_date); +$EQday_ARY = explode('-',$end_date); +$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); +$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); + +echo "<br><br>\n"; + +echo "<center>\n"; + +echo "<B>TIMECLOCK HORÁRIO DE LOGIN/LOGOUT:</B>\n"; +echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; + + $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; + if ($DB>0) {echo "|$stmt|";} + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_logs=0; + $o=0; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TC_log_date = date("Y-m-d H:i:s", $row[1]); + + $manager_edit=''; + if (strlen($row[6])>0) {$manager_edit = ' * ';} + + if (ereg("LOGIN", $row[0])) + { + $login_sec=''; + echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; + echo "<td align=right><font size=2>$manager_edit</td>"; + echo "<td align=right><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $TC_log_date</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> </td></tr>\n"; + } + if (ereg("LOGOUT", $row[0])) + { + $login_sec = $row[3]; + $total_login_time = ($total_login_time + $login_sec); + $event_hours = ($login_sec / 3600); + $event_hours_int = round($event_hours, 2); + $event_hours_int = intval("$event_hours_int"); + $event_minutes = ($event_hours - $event_hours_int); + $event_minutes = ($event_minutes * 60); + $event_minutes_int = round($event_minutes, 0); + if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} + echo "<tr $bgcolor><td><font size=2>$row[5]</td>"; + echo "<td align=right><font size=2>$manager_edit</td>"; + echo "<td align=right><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $TC_log_date</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n"; + } + $o++; + } +if (strlen($login_sec)<1) + { + $login_sec = ($STARTtime - $row[1]); + $total_login_time = ($total_login_time + $login_sec); + } +$total_login_hours = ($total_login_time / 3600); +$total_login_hours_int = round($total_login_hours, 2); +$total_login_hours_int = intval("$total_login_hours"); +$total_login_minutes = ($total_login_hours - $total_login_hours_int); +$total_login_minutes = ($total_login_minutes * 60); +$total_login_minutes_int = round($total_login_minutes, 0); +if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} + +echo "<tr><td align=right><font size=2> </td>"; +echo "<td align=right><font size=2> </td>\n"; +echo "<td align=right><font size=2> </td>\n"; +echo "<td align=right><font size=2> </td>\n"; +echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; +echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n"; + +echo "</TABLE></center>\n"; + + + + + + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "\n\n\n<br><br><br>\n\n"; + + +echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<?php + +exit; + + + +?> + + + + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_group_bulk_change.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_group_bulk_change.php new file mode 100644 index 00000000..22dce925 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_group_bulk_change.php @@ -0,0 +1,271 @@ +<?php +# user_group_bulk_change.php +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 81119-0918 - First build +# 90309-1830 - Added admin_log logging +# 90310-2144 - Added admin header +# 90508-0644 - Changed to PHP long tags +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["old_group"])) {$old_group=$_GET["old_group"];} + elseif (isset($_POST["old_group"])) {$old_group=$_POST["old_group"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$StarTtimE = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$ip = getenv("REMOTE_ADDR"); + +if (!isset($begin_date)) {$begin_date = $TODAY;} +if (!isset($end_date)) {$end_date = $TODAY;} + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; + if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + else + { + + if($auth>0) + { + $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $change_agent_campaign = $row[1]; + $modify_timeclock_log = $row[2]; + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + } + } + +$stmt="select user_group,group_name from vicidial_user_groups order by user_group desc;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] = $row[0]; + $group_names[$i] = $row[1]; + $i++; + } + + + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<title>ADMINISTRATION: Troca de Grupo de Usuário em Lote +<?php + +##### BEGIN Set variables to make header show properly ##### +$ADD = '311111'; +$hh = 'usergroups'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$usergroups_color = '#FFFF99'; +$usergroups_font = 'BLACK'; +$usergroups_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + + + + +?> + +<CENTER> +<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   Troca de Grupo de Usuário em Lote</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> + + + + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B>   \n"; + +##### GROUP CHANGE FOR ALL USERS IN A USER GROUP ##### +if ($stage == "one_user_group_change") + { + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group='" . mysql_real_escape_string($old_group) . "';"; + $rslt=mysql_query($stmt, $link); + + echo "All Grupo do Usuário $old_group Usuários changed to the $group Grupo do Usuário<BR>\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$group', event_code='ADMIN BULK GRUPO DE USUÁRIOS CHANGE', event_sql=\"$SQL_log\", event_notes='Old Grupo: $old_group';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + exit; + } + +##### GROUP CHANGE FOR ALL USERS IN THE SYSTEM EXCEPT FOR LEVEL > 6 AND ADMIN GROUP ##### +if ($stage == "all_user_group_change") + { + $stmt="UPDATE vicidial_users set user_group='" . mysql_real_escape_string($group) . "' where user_group!='ADMIN' and user_group < 7;"; + $rslt=mysql_query($stmt, $link); + + echo "All non-Admin Usuários changed to the $group Grupo do Usuário<BR>\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$group', event_code='ADMIN BULK GRUPO DE USUÁRIOS CHANGE', event_sql=\"$SQL_log\", event_notes='ALL NON-ADMIN;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + exit; + } + +### one user_group change +echo "<form action=$PHP_SELF method=POST>\n"; +echo "<input type=hidden name=DB value=\"$DB\">\n"; +echo "<input type=hidden name=stage value=\"one_user_group_change\">\n"; +echo "Change Usuários in this group: <SELECT SIZE=1 NAME=old_group>\n"; +$o=0; +while ($groups_to_print > $o) + { + echo "<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n"; + $o++; + } +echo "</SELECT>\n"; +echo "<BR>   to this group: <SELECT SIZE=1 NAME=group>\n"; +$o=0; +while ($groups_to_print > $o) + { + echo "<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n"; + $o++; + } +echo "</SELECT>\n"; +echo "<BR><CENTER><input type=submit name=submit value=ENVIAR></CENTER><BR></form>\n"; + +echo "\n<BR><BR><BR>"; + + + +### all user_group change +echo "<form action=$PHP_SELF method=POST>\n"; +echo "<input type=hidden name=DB value=\"$DB\">\n"; +echo "<input type=hidden name=stage value=\"all_user_group_change\">\n"; +echo "Change ALL non-Admin Usuários to this group: <BR><SELECT SIZE=1 NAME=group>\n"; +$o=0; +while ($groups_to_print > $o) + { + echo "<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n"; + $o++; + } +echo "</SELECT>\n"; +echo "<BR><CENTER><input type=submit name=submit value=ENVIAR></CENTER><BR></form>\n"; + +echo "\n<BR>"; + + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $StarTtimE); + +echo "\n\n\n<br><br><br>\n\n"; + + +echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<?php + +exit; + + + +?> + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_stats.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_stats.php new file mode 100644 index 00000000..5c28f03f --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_stats.php @@ -0,0 +1,821 @@ +<?php +# user_stats.php +# +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 60619-1743 - Added variable filtering to eliminate SQL injection attack threat +# 61201-1136 - Added recordings display and changed calls to time range with 10000 limit +# 70118-1605 - Added user group column to login/out and calls lists +# 70702-1231 - Added recording location link and truncation +# 80117-0316 - Added vicidial_user_closer_log entries to display +# 80501-0506 - Added Hangup Reason to logs display +# 80523-2012 - Added vicidial timeclock records display +# 80617-1402 - Fixed timeclock total logged-in time +# 81210-1634 - Added server recording display options +# 90208-0504 - Added link to multi-day report and fixed call status summary section +# 90305-1226 - Added user_call_log manual dial logs +# 90310-0734 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 90524-2009 - Changed time display to use functions.php +# 91130-2037 - Added user closer log manager flag display +# 100203-1008 - Added agent activity log section +# 100216-0042 - Added popup date selector +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); +require("functions.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $user_territories_active = $row[2]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} + elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} +if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} + elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} + elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); + +if (!isset($begin_date)) {$begin_date = $TODAY;} +if (!isset($end_date)) {$end_date = $TODAY;} + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + + if($auth>0) + { + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + else + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + + $stmt="SELECT full_name from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } + + + + +?> +<html> +<head> + +<script language="JavaScript" src="calendar_db.js"></script> +<link rel="stylesheet" href="calendar.css"> + +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<title>ADMINISTRATION: Estatísticas de Usuário +<?php + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '3'; +$hh = 'users'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$users_color = '#FFFF99'; +$users_font = 'BLACK'; +$users_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + + + +?> +<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Estatísticas de Usuário for <?php echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> + + + + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; + +echo "<form action=$PHP_SELF method=POST name=vicidial_report id=vicidial_report>\n"; +echo "<input type=hidden name=DB value=\"$DB\">\n"; +echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; + +?> +<script language="JavaScript"> +var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'begin_date' +}); +o_cal.a_tpl.yearscroll = false; +// o_cal.a_tpl.weekstart = 1; // Segunda week start +</script> +<?php + +echo " to <input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>"; + +?> +<script language="JavaScript"> +var o_cal = new tcal ({ + // form name + 'formname': 'vicidial_report', + // input name + 'controlname': 'end_date' +}); +o_cal.a_tpl.yearscroll = false; +// o_cal.a_tpl.weekstart = 1; // Segunda week start +</script> +<?php + +if (strlen($user)>1) + {echo "  <input type=hidden name=user value=\"$user\">\n";} +else + {echo "  <input type=text name=user size=12 maxlength=10>\n";} +echo "<input type=submit name=submit value=submit>\n"; + + +echo "           $user - $full_name<BR><BR>\n"; + +echo "<center>\n"; +echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Planilha de Tempo</a>\n"; +echo " | <a href=\"./user_status.php?user=$user\">Status do Usuário</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Alterar Usuário</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Usuário multiple day status detail report</a>"; +echo "</center>\n"; + + +echo "</B></TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; + +echo "<br><center>\n"; + +##### vicidial agent talk time and status ##### + +echo "<B>AGENTE TEMPO E STATUS DA CHAMADA:</B>\n"; + +echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=2>STATUS</td><td align=right><font size=2>QUANTIDADE</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + +$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; +$rslt=mysql_query($stmt, $link); +$VLstatuses_to_print = mysql_num_rows($rslt); +$total_calls=0; +$o=0; $p=0; +while ($VLstatuses_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $counts[$p] = $row[0]; + $status[$p] = $row[1]; + $call_sec[$p] = $row[2]; + $p++; + $o++; + } + +$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; +$rslt=mysql_query($stmt, $link); +$VCLstatuses_to_print = mysql_num_rows($rslt); +$o=0; +while ($VCLstatuses_to_print > $o) + { + $status_match=0; + $r=0; + $row=mysql_fetch_row($rslt); + while ($VLstatuses_to_print > $r) + { + if ($status[$r] == $row[1]) + { + $counts[$r] = ($counts[$r] + $row[0]); + $call_sec[$r] = ($call_sec[$r] + $row[2]); + $status_match++; + } + $r++; + } + if ($status_match < 1) + { + $counts[$p] = $row[0]; + $status[$p] = $row[1]; + $call_sec[$p] = $row[2]; + $VLstatuses_to_print++; + $p++; + } + $o++; + } + +$o=0; +$total_sec=0; +while ($o < $p) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $call_hours_minutes = sec_convert($call_sec[$o],'H'); + + echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; + echo "<td align=right><font size=2> $counts[$o]</td>\n"; + echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); + $call_seconds=0; + $o++; + } + +$call_hours_minutes = sec_convert($total_sec,'H'); + +echo "<tr><td><font size=2>TOTAL DE CHAMADAS </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; +echo "</TABLE></center>\n"; + + +##### Login and Logout time from vicidial agent interface ##### + +echo "<br><br>\n"; + +echo "<center>\n"; + +echo "<B>AGENTE HORÁRIO DE LOGIN/LOGOUT:</B>\n"; +echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_calls=0; + $o=0; + $event_start_seconds=''; + $event_stop_seconds=''; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if (eregi("LOGIN", $row[0])) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if (ereg("LOGIN", $row[0])) + { + $event_start_seconds = $row[1]; + echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $row[3]</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; + echo "<td align=right><font size=2> </td></tr>\n"; + } + if (ereg("LOGOUT", $row[0])) + { + if ($event_start_seconds) + { + + $event_stop_seconds = $row[1]; + $event_seconds = ($event_stop_seconds - $event_start_seconds); + $total_login_time = ($total_login_time + $event_seconds); + $event_hours_minutes = sec_convert($event_seconds,'H'); + + echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $row[3]</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; + echo "<td align=right><font size=2> $event_hours_minutes</td></tr>\n"; + $event_start_seconds=''; + $event_stop_seconds=''; + } + else + { + echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $row[3]</td>\n"; + echo "<td align=right><font size=2> </td></tr>\n"; + } + } + + $total_calls = ($total_calls + $row[0]); + + $call_seconds=0; + $o++; + } + +$total_login_hours_minutes = sec_convert($total_login_time,'H'); + +echo "<tr><td><font size=2>TOTAL</td>"; +echo "<td align=right><font size=2> </td>\n"; +echo "<td align=right><font size=2> </td>\n"; +echo "<td align=right><font size=2> </td>\n"; +echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + +echo "</TABLE></center>\n"; + + + + + +##### vicidial_timeclock log records for user ##### + +$total_login_time=0; +$SQday_ARY = explode('-',$begin_date); +$EQday_ARY = explode('-',$end_date); +$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); +$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); + +echo "<br><br>\n"; + +echo "<center>\n"; + +echo "<B>TIMECLOCK HORÁRIO DE LOGIN/LOGOUT:</B>\n"; +echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; + if ($DB>0) {echo "|$stmt|";} + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_logs=0; + $o=0; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TC_log_date = date("Y-m-d H:i:s", $row[1]); + + $manager_edit=''; + if (strlen($row[6])>0) {$manager_edit = ' * ';} + + if (ereg("LOGIN", $row[0])) + { + $login_sec=''; + echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + echo "<td align=right><font size=2>$manager_edit</td>"; + echo "<td align=right><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $TC_log_date</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> </td></tr>\n"; + } + if (ereg("LOGOUT", $row[0])) + { + $login_sec = $row[3]; + $total_login_time = ($total_login_time + $login_sec); + $event_hours_minutes = sec_convert($login_sec,'H'); + + echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + echo "<td align=right><font size=2>$manager_edit</td>"; + echo "<td align=right><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $TC_log_date</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {echo " - $total_login_time - $login_sec";} + echo "</td></tr>\n"; + } + $o++; + } +if (strlen($login_sec)<1) + { + $login_sec = ($STARTtime - $row[1]); + $total_login_time = ($total_login_time + $login_sec); + if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + } +$total_login_hours_minutes = sec_convert($total_login_time,'H'); + +if ($DB) {echo " - $total_login_time - $login_sec";} + +echo "<tr><td align=right><font size=2> </td>"; +echo "<td align=right><font size=2> </td>\n"; +echo "<td align=right><font size=2> </td>\n"; +echo "<td align=right><font size=2> </td>\n"; +echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; +echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; + +echo "</TABLE></center>\n"; + + + +##### closer in-group selection logs ##### + +echo "<br><br>\n"; + +echo "<center>\n"; + +echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; +echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPANHA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; + +$stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; +$rslt=mysql_query($stmt, $link); +$logs_to_print = mysql_num_rows($rslt); + +$u=0; +while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$row[2]</td>"; + echo "<td align=left><font size=2> $row[1]</td>\n"; + echo "<td align=left><font size=2> $row[3]</td>\n"; + echo "<td align=left><font size=2> $row[4] </td>\n"; + echo "<td align=left><font size=2> $row[5]</td>\n"; + echo "</tr>\n"; + } + + +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent outbound calls for this time period ##### + +echo "<B>SAINTE CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; +echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + +$stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; +$rslt=mysql_query($stmt, $link); +$logs_to_print = mysql_num_rows($rslt); + +$u=0; +while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$row[4]</td>"; + echo "<td align=left><font size=2> $row[7]</td>\n"; + echo "<td align=left><font size=2> $row[8]</td>\n"; + echo "<td align=left><font size=2> $row[10] </td>\n"; + echo "<td align=right><font size=2> $row[3] </td>\n"; + echo "<td align=right><font size=2> $row[14] </td>\n"; + echo "<td align=right><font size=2> $row[2] </td>\n"; + echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; + echo "<td align=right><font size=2> $row[15] </td></tr>\n"; + } + + +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent inbound calls for this time period ##### + +echo "<B>ENTRANTE/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; +echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENTE (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + +$stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; +$rslt=mysql_query($stmt, $link); +$logs_to_print = mysql_num_rows($rslt); + +$u=0; +$TOTALinSECONDS=0; +$TOTALagentSECONDS=0; +while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TOTALinSECONDS = ($TOTALinSECONDS + $row[1]); + $AGENTseconds = ($row[1] - $row[5]); + if ($AGENTseconds < 0) + {$AGENTseconds=0;} + + $TOTALagentSECONDS = ($TOTALagentSECONDS + $AGENTseconds); + + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$row[0]</td>"; + echo "<td align=left><font size=2> $row[1]</td>\n"; + echo "<td align=left><font size=2> $row[2]</td>\n"; + echo "<td align=left><font size=2> $row[3] </td>\n"; + echo "<td align=right><font size=2> $row[4] </td>\n"; + echo "<td align=right><font size=2> $row[5] </td>\n"; + echo "<td align=right><font size=2> $AGENTseconds </td>\n"; + echo "<td align=right><font size=2> $row[6] </td>\n"; + echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n"; + echo "<td align=right><font size=2> $row[8] </td></tr>\n"; + } + +echo "<tr bgcolor=white>"; +echo "<td colspan=2><font size=2>TOTALS</td>"; +echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n"; +echo "<td colspan=4><font size=2>   </td>\n"; +echo "<td align=right><font size=2> $TOTALagentSECONDS</td>\n"; +echo "<td colspan=3><font size=2>   </td></tr>\n"; +echo "</TABLE></center><BR><BR>\n"; + + +##### vicidial agent activity records for this time period ##### +echo "<B>AGENTE ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; +echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; +echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPANHA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; + +$stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; +$rslt=mysql_query($stmt, $link); +$logs_to_print = mysql_num_rows($rslt); + +$u=0; +$TOTALpauseSECONDS=0; +$TOTALwaitSECONDS=0; +$TOTALtalkSECONDS=0; +$TOTALdispoSECONDS=0; +$TOTALdeadSECONDS=0; +$TOTALcustomerSECONDS=0; +while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $event_time = $row[0]; + $lead_id = $row[1]; + $campaign_id = $row[2]; + $pause_sec = $row[3]; + $wait_sec = $row[4]; + $talk_sec = $row[5]; + $dispo_sec = $row[6]; + $dead_sec = $row[7]; + $status = $row[8]; + $pause_code = $row[9]; + $user_group = $row[10]; + $customer_sec = ($talk_sec - $dead_sec); + if ($customer_sec < 0) + {$customer_sec=0;} + + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); + $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); + $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); + $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); + $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); + $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + + + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$event_time</td>"; + echo "<td align=right><font size=2> $pause_sec</td>\n"; + echo "<td align=right><font size=2> $wait_sec</td>\n"; + echo "<td align=right><font size=2> $talk_sec </td>\n"; + echo "<td align=right><font size=2> $dispo_sec </td>\n"; + echo "<td align=right><font size=2> $dead_sec </td>\n"; + echo "<td align=right><font size=2> $customer_sec </td>\n"; + echo "<td align=right><font size=2> $status </td>\n"; + echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; + echo "<td align=right><font size=2> $campaign_id </td>\n"; + echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + } + +echo "<tr bgcolor=white>"; +echo "<td colspan=2><font size=2>TOTALS</td>"; +echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; +echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; +echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; +echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; +echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; +echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; +echo "<td colspan=4><font size=2>   </td></tr>\n"; + +$TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); +$TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); +$TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); +$TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); +$TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); +$TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); + +echo "<tr bgcolor=white>"; +echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; +echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; +echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; +echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; +echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; +echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; +echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; +echo "<td colspan=4><font size=2>   </td></tr>\n"; + +echo "</TABLE></center><BR><BR>\n"; + + + +##### vicidial recordings for this time period ##### + +echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; +echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2>   RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION   </td></tr>\n"; + + $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $location = $row[11]; + + if (strlen($location)>2) + { + $URLserver_ip = $location; + $URLserver_ip = eregi_replace('http://','',$URLserver_ip); + $URLserver_ip = eregi_replace('https://','',$URLserver_ip); + $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); + $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if ($rowx[0] > 0) + { + $stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if (eregi("ALT_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[1], $location); + } + } + } + + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if (eregi("http",$location)) + {$location = "<a href=\"$location\">$locat</a>";} + else + {$location = $locat;} + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>"; + echo "<td align=left><font size=2> $row[4] </td>\n"; + echo "<td align=left><font size=2> $row[8] </td>\n"; + echo "<td align=left><font size=2> $row[0] </td>\n"; + echo "<td align=center><font size=2> $row[10] </td>\n"; + echo "<td align=right><font size=2> $location   </td>\n"; + echo "</tr>\n"; + + } + + +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent outbound user manual calls for this time period ##### + +echo "<B>MANUAL SAINTE CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; +echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td></tr>\n"; + + $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$row[0]</td>"; + echo "<td align=left><font size=2> $row[1]</td>\n"; + echo "<td align=left><font size=2> $row[2]</td>\n"; + echo "<td align=left><font size=2> $row[3] </td>\n"; + echo "<td align=right><font size=2> $row[4] </td>\n"; + echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; + echo "<td align=right><font size=2> $row[6] </td>\n"; + echo "<td align=right><font size=2> $row[7] </td></tr>\n"; + + } + + +echo "</TABLE><BR><BR>\n"; + + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "\n\n\n<br><br><br>\n\n"; + + +echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<?php + +exit; + + + +?> + + + + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_status.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_status.php new file mode 100644 index 00000000..aea5732d --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_status.php @@ -0,0 +1,677 @@ +<?php +# user_status.php +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 60619-1738 - Added variable filtering to eliminate SQL injection attack threat +# 80603-1452 - Added manager timeclock force login/logout of user +# 81118-1034 - Disabled change campaign because it does not work +# 90208-0511 - Added link to user multi-day status report +# 90310-0741 - Added admin header +# 90508-0644 - Changed to PHP long tags +# 91012-0536 - Added selected territories display +# 91130-2039 - Added user closer log manager flag display +# 91212-0656 - Added more complete logging of Emergency Logout process +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} + elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} +if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} + elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +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["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + $SSoutbound_autodial_active = $row[2]; + $user_territories_active = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +$StarTtimE = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$ip = getenv("REMOTE_ADDR"); + +if (!isset($begin_date)) {$begin_date = $TODAY;} +if (!isset($end_date)) {$end_date = $TODAY;} + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + if($auth>0) + { + $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $change_agent_campaign = $row[1]; + $modify_timeclock_log = $row[2]; + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + } + else + { + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + } + + $stmt="SELECT full_name,user_group from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + + $stmt="SELECT live_agent_id,user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,call_server_ip,user_level,comments,campaign_weight,calls_today,external_hangup,external_status,external_pause,external_dial,agent_log_id,last_state_change,agent_territories,outbound_autodial,manager_ingroup_set,external_igb_set_user from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $agents_to_print = mysql_num_rows($rslt); + $i=0; + while ($i < $agents_to_print) + { + $row=mysql_fetch_row($rslt); + $Aserver_ip = $row[2]; + $Asession_id = $row[3]; + $Aextension = $row[4]; + $Astatus = $row[5]; + $Acampaign = $row[7]; + $Alast_call = $row[14]; + $Acl_campaigns = $row[15]; + $agent_territories = $row[27]; + $outbound_autodial = $row[28]; + $manager_ingroup_set = $row[29]; + $external_igb_set_user = $row[30]; + $i++; + } + + $stmt="SELECT event_date,status,ip_address from vicidial_timeclock_status where user='" . mysql_real_escape_string($user) . "';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $tc_logs_to_print = mysql_num_rows($rslt); + if ($tc_logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $Tevent_date = $row[0]; + $Tstatus = $row[1]; + $Tip_address = $row[2]; + $i++; + } + + } + +$stmt="select campaign_id from vicidial_campaigns;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + $i++; + } + + + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<title>ADMINISTRATION: Status do Usuário +<?php + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '3'; +$hh = 'users'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold='<b>'; +$header_nonselected_bold=''; +$users_color = '#FFFF99'; +$users_font = 'BLACK'; +$users_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + + + +?> +<TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Status do Usuário for <?php echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   </TD></TR> + + + + +<?php + +echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B>   \n"; + +##### EMERGENCY CAMPAIGN CHANGE FOR AN AGENT ##### +if ($stage == "live_campaign_change") + { + $stmt="UPDATE vicidial_live_agents set campaign_id='" . mysql_real_escape_string($group) . "' where user='" . mysql_real_escape_string($user) . "';"; + $rslt=mysql_query($stmt, $link); + + echo "Agent $user - $full_name changed to $group campaign<BR>\n"; + + exit; + } + +##### EMERGENCY LOGOUT OF AN AGENT ##### +if ($stage == "log_agent_out") + { + $now_date_epoch = date('U'); + $inactive_epoch = ($now_date_epoch - 60); + $stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time) from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "<BR>$stmt\n";} + $vla_ct = mysql_num_rows($rslt); + if ($vla_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_user = $row[0]; + $VLA_campaign_id = $row[1]; + $VLA_update_time = $row[2]; + + if ($VLA_update_time > $inactive_epoch) + { + $lead_active=0; + $stmt = "SELECT agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status,dead_epoch,dead_sec from vicidial_agent_log where user='$VLA_user' order by agent_log_id desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "<BR>$stmt\n";} + $val_ct = mysql_num_rows($rslt); + if ($val_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VAL_agent_log_id = $row[0]; + $VAL_user = $row[1]; + $VAL_server_ip = $row[2]; + $VAL_event_time = $row[3]; + $VAL_lead_id = $row[4]; + $VAL_campaign_id = $row[5]; + $VAL_pause_epoch = $row[6]; + $VAL_pause_sec = $row[7]; + $VAL_wait_epoch = $row[8]; + $VAL_wait_sec = $row[9]; + $VAL_talk_epoch = $row[10]; + $VAL_talk_sec = $row[11]; + $VAL_dispo_epoch = $row[12]; + $VAL_dispo_sec = $row[13]; + $VAL_status = $row[14]; + $VAL_user_group = $row[15]; + $VAL_comments = $row[16]; + $VAL_sub_status = $row[17]; + $VAL_dead_epoch = $row[18]; + $VAL_dead_sec = $row[19]; + + if ($DB) {echo "\n<BR>VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";} + + if ( ($VAL_wait_epoch < 1) || ( ($VAL_status == 'PAUSE') && ($VAL_dispo_epoch < 1) ) ) + { + $VAL_pause_sec = ( ($now_date_epoch - $VAL_pause_epoch) + $VAL_pause_sec); + $stmt = "UPDATE vicidial_agent_log SET wait_epoch='$now_date_epoch', pause_sec='$VAL_pause_sec' where agent_log_id='$VAL_agent_log_id';"; + } + else + { + if ($VAL_talk_epoch < 1) + { + $VAL_wait_sec = ( ($now_date_epoch - $VAL_wait_epoch) + $VAL_wait_sec); + $stmt = "UPDATE vicidial_agent_log SET talk_epoch='$now_date_epoch', wait_sec='$VAL_wait_sec' where agent_log_id='$VAL_agent_log_id';"; + } + else + { + $lead_active++; + $status_update_SQL=''; + if ( ( (strlen($VAL_status) < 1) or ($VAL_status == 'NULL') ) and ($VAL_lead_id > 0) ) + { + $status_update_SQL = ", status='PU'"; + $stmt="UPDATE vicidial_list SET status='PU' where lead_id='$VAL_lead_id';"; + if ($DB) {echo "<BR>$stmt\n";} + $rslt=mysql_query($stmt, $link); + } + if ($VAL_dispo_epoch < 1) + { + $VAL_talk_sec = ($now_date_epoch - $VAL_talk_epoch); + $stmt = "UPDATE vicidial_agent_log SET dispo_epoch='$now_date_epoch', talk_sec='$VAL_talk_sec'$status_update_SQL where agent_log_id='$VAL_agent_log_id';"; + } + else + { + if ($VAL_dispo_sec < 1) + { + $VAL_dispo_sec = ($now_date_epoch - $VAL_dispo_epoch); + $stmt = "UPDATE vicidial_agent_log SET dispo_sec='$VAL_dispo_sec' where agent_log_id='$VAL_agent_log_id';"; + } + } + } + } + + if ($DB) {echo "<BR>$stmt\n";} + $rslt=mysql_query($stmt, $link); + } + } + + $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; + if ($DB) {echo "<BR>$stmt\n";} + $rslt=mysql_query($stmt, $link); + + if (strlen($VAL_user_group) < 1) + { + $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "<BR>$stmt\n";} + $val_ct = mysql_num_rows($rslt); + if ($val_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VAL_user_group = $row[0]; + } + } + + $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VLA_user','LOGOUT','$VLA_campaign_id','$NOW_TIME','$now_date_epoch','$VAL_user_group');"; + if ($DB) {echo "<BR>$stmt\n";} + $rslt=mysql_query($stmt, $link); + + + ############################################# + ##### START QUEUEMETRICS LOGGING LOOKUP ##### + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "<BR>$stmt\n";} + $qm_conf_ct = mysql_num_rows($rslt); + if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_queuemetrics_logging = $row[0]; + $queuemetrics_server_ip = $row[1]; + $queuemetrics_dbname = $row[2]; + $queuemetrics_login = $row[3]; + $queuemetrics_pass = $row[4]; + $queuemetrics_log_id = $row[5]; + } + ##### END QUEUEMETRICS LOGGING LOOKUP ##### + ########################################### + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + + $agents='@agents'; + $agent_logged_in=''; + $time_logged_in=''; + + $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb='AGENTLOGIN' order by time_id desc limit 1;"; + $rsltB=mysql_query($stmtB, $linkB); + if ($DB) {echo "<BR>$stmtB\n";} + $qml_ct = mysql_num_rows($rsltB); + if ($qml_ct > 0) + { + $row=mysql_fetch_row($rsltB); + $agent_logged_in = $row[0]; + $time_logged_in = $row[1]; + } + + $time_logged_in = ($now_date_epoch - $time_logged_in); + if ($time_logged_in > 1000000) {$time_logged_in=1;} + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='" . mysql_real_escape_string($user) . "$agents',data2='$time_logged_in';"; + if ($DB) {echo "<BR>$stmtB\n";} + $rsltB=mysql_query($stmtB, $linkB); + } + + echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<BR>\n"; + } + else + { + echo "Agent $user is not logged in<BR>\n"; + } + + exit; + } + + + + + +##### BEGIN TIMECLOCK LOGOUT OF A USER ##### +if ( ( ($stage == "tc_log_user_OUT") or ($stage == "tc_log_user_IN") ) and ($modify_timeclock_log > 0) ) + { + ### get vicidial_timeclock_status record count for this user + $stmt="SELECT count(*) from vicidial_timeclock_status where user='$user';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vts_count = $row[0]; + + $LOG_run=0; + $last_action_sec=99; + + if ($vts_count > 0) + { + ### vicidial_timeclock_status record found, grab status and date of last activity + $stmt="SELECT status,event_epoch from vicidial_timeclock_status where user='$user';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $status = $row[0]; + $event_epoch = $row[1]; + $last_action_date = date("Y-m-d H:i:s", $event_epoch); + $last_action_sec = ($StarTtimE - $event_epoch); + + if ($last_action_sec > 0) + { + $totTIME_H = ($last_action_sec / 3600); + $totTIME_H_int = round($totTIME_H, 2); + $totTIME_H_int = intval("$totTIME_H"); + $totTIME_M = ($totTIME_H - $totTIME_H_int); + $totTIME_M = ($totTIME_M * 60); + $totTIME_M_int = round($totTIME_M, 2); + $totTIME_M_int = intval("$totTIME_M"); + $totTIME_S = ($totTIME_M - $totTIME_M_int); + $totTIME_S = ($totTIME_S * 60); + $totTIME_S = round($totTIME_S, 0); + if (strlen($totTIME_H_int) < 1) {$totTIME_H_int = "0";} + if ($totTIME_M_int < 10) {$totTIME_M_int = "0$totTIME_M_int";} + if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";} + $totTIME_HMS = "$totTIME_H_int:$totTIME_M_int:$totTIME_S"; + } + else + { + $totTIME_HMS='0:00:00'; + } + } + + else + { + ### No vicidial_timeclock_status record found, insert one + $stmt="INSERT INTO vicidial_timeclock_status set status='START', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $status='START'; + $totTIME_HMS='0:00:00'; + $affected_rows = mysql_affected_rows($link); + print "<!-- NEW vicidial_timeclock_status record inserted for $user: |$affected_rows| -->\n"; + } + + + ##### Run timeclock login queries ##### + if ( ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage == "tc_log_user_IN") ) + { + ### Add a record to the timeclock log + $stmtA="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME', manager_user='$PHP_AUTH_USER', manager_ip='$ip', notes='Manager LOGIN of user from user status page';"; + if ($DB) {echo "$stmtA\n";} + $rslt=mysql_query($stmtA, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "<!-- NEW vicidial_timeclock_log record inserted for $user: |$affected_rows|$timeclock_id| -->\n"; + + ### Update the user's timeclock status record + $stmtB="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmtB\n";} + $rslt=mysql_query($stmtB, $link); + $affected_rows = mysql_affected_rows($link); + print "<!-- vicidial_timeclock_status record updated for $user: |$affected_rows| -->\n"; + + ### Add a record to the timeclock audit log + $stmtC="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmtC\n";} + $rslt=mysql_query($stmtC, $link); + $affected_rows = mysql_affected_rows($link); + print "<!-- NEW vicidial_timeclock_audit_log record inserted for $user: |$affected_rows| -->\n"; + + ### Add a record to the vicidial_admin_log + $SQL_log = "$stmtA|$stmtB|$stmtC|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TIMECLOCK', event_type='LOGIN', record_id='$user', event_code='USER FORCED LOGIN FROM STATUS PAGE', event_sql=\"$SQL_log\", event_notes='Relógio Ponto ID: $timeclock_id|';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "<!-- NEW vicidial_admin_log record inserted for $PHP_AUTH_USER: |$affected_rows| -->\n"; + + $LOG_run++; + $VDdisplayMESSAGE = "You have now logged-in the user: $user - $full_name"; + } + + ##### Run timeclock logout queries ##### + if ( ( ($status=='LOGIN') or ($status=='START') ) and ($stage == "tc_log_user_OUT") ) + { + ### Add a record to the timeclock log + $stmtA="INSERT INTO vicidial_timeclock_log set event='LOGOUT', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME', manager_user='$PHP_AUTH_USER', manager_ip='$ip', notes='Manager LOGOUT of user from user status page';"; + if ($DB) {echo "$stmtA\n";} + $rslt=mysql_query($stmtA, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "<!-- NEW vicidial_timeclock_log record inserted for $user: |$affected_rows|$timeclock_id| -->\n"; + + ### Update last login record in the timeclock log + $stmtB="UPDATE vicidial_timeclock_log set login_sec='$last_action_sec',tcid_link='$timeclock_id' where event='LOGIN' and user='$user' order by timeclock_id desc limit 1;"; + if ($DB) {echo "$stmtB\n";} + $rslt=mysql_query($stmtB, $link); + $affected_rows = mysql_affected_rows($link); + print "<!-- vicidial_timeclock_log record updated for $user: |$affected_rows| -->\n"; + + ### Update the user's timeclock status record + $stmtC="UPDATE vicidial_timeclock_status set status='LOGOUT', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmtC\n";} + $rslt=mysql_query($stmtC, $link); + $affected_rows = mysql_affected_rows($link); + print "<!-- vicidial_timeclock_status record updated for $user: |$affected_rows| -->\n"; + + ### Add a record to the timeclock audit log + $stmtD="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='LOGOUT', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmtD\n";} + $rslt=mysql_query($stmtD, $link); + $affected_rows = mysql_affected_rows($link); + print "<!-- NEW vicidial_timeclock_audit_log record inserted for $user: |$affected_rows| -->\n"; + + ### Update last login record in the timeclock audit log + $stmtE="UPDATE vicidial_timeclock_audit_log set login_sec='$last_action_sec',tcid_link='$timeclock_id' where event='LOGIN' and user='$user' order by timeclock_id desc limit 1;"; + if ($DB) {echo "$stmtE\n";} + $rslt=mysql_query($stmtE, $link); + $affected_rows = mysql_affected_rows($link); + print "<!-- vicidial_timeclock_audit_log record updated for $user: |$affected_rows| -->\n"; + + ### Add a record to the vicidial_admin_log + $SQL_log = "$stmtA|$stmtB|$stmtC|$stmtD|$stmtE|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TIMECLOCK', event_type='LOGOUT', record_id='$user', event_code='USER FORCED LOGOUT FROM STATUS PAGE', event_sql=\"$SQL_log\", event_notes='Usuário login time: $last_action_sec|Relógio Ponto ID: $timeclock_id|';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "<!-- NEW vicidial_admin_log record inserted for $PHP_AUTH_USER: |$affected_rows| -->\n"; + + $LOG_run++; + $VDdisplayMESSAGE = "You have now logged-out the user: $user - $full_name<BR>Amount of time user was logged-in: $totTIME_HMS"; + } + + if ($LOG_run < 1) + {$VDdisplayMESSAGE = "ERROR: timeclock log problem, could not process: $status|$stage";} + + echo "$VDdisplayMESSAGE\n"; + + exit; + } + +##### END TIMECLOCK LOGOUT OF A USER ##### + +if ($agents_to_print > 0) + { + echo "<BR>\n"; + echo "$user - $full_name \n"; + echo "       GROUP: $user_group <BR>\n"; + + echo "<TABLE CELLPADDING=0 CELLSPACING=0>"; + echo "<TR><TD ALIGN=RIGHT>Agent Logged in at server:</TD><TD ALIGN=LEFT>   $Aserver_ip</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>in session:</TD><TD ALIGN=LEFT>   $Asession_id</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>from phone:</TD><TD ALIGN=LEFT>   $Aextension</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>Agent is in campaign:</TD><TD ALIGN=LEFT>   $Acampaign</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>status:</TD><TD ALIGN=LEFT>   $Astatus</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>hungup last call at:</TD><TD ALIGN=LEFT>   $Alast_call</TD></TR>\n"; + echo "<TR><TD ALIGN=RIGHT>Closer groups:</TD><TD ALIGN=LEFT>   $Acl_campaigns</TD></TR>\n"; + if ($manager_ingroup_set != 'N') + {echo "<TR><TD ALIGN=RIGHT>Manager InGroup Select:</TD><TD ALIGN=LEFT>   YES, by $external_igb_set_user</TD></TR>\n";} + if ($outbound_autodial == 'Y') + {echo "<TR><TD ALIGN=RIGHT>Outbound Auto-Dial:</TD><TD ALIGN=LEFT>   YES</TD></TR>\n";} + if ($user_territories_active > 0) + {echo "<TR><TD ALIGN=RIGHT>Selected Territories:</TD><TD ALIGN=LEFT>   $agent_territories</TD></TR>\n";} + echo "</TABLE>\n<BR>\n"; + + if ($change_agent_campaign > 0) + { + echo "<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<input type=hidden name=user value=\"$user\">\n"; + echo "<input type=hidden name=stage value=\"live_campaign_change\">\n"; + echo "Current Campanha: <SELECT SIZE=1 NAME=group>\n"; + $o=0; + while ($groups_to_print > $o) + { + if ($groups[$o] == "$Acampaign") {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";} + else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";} + $o++; + } + echo "</SELECT>\n"; + echo "<input type=submit name=submit value=CHANGE disabled><BR></form>\n"; + + echo "<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<input type=hidden name=user value=\"$user\">\n"; + echo "<input type=hidden name=stage value=\"log_agent_out\">\n"; + echo "<input type=submit name=submit value=\"EMERGENCY LOG AGENTE OUT\"><BR></form>\n"; + } + } + +else + { + echo "Agent is not logged in\n<BR>"; + } + +echo "\n<BR>"; + +if ( ($Tstatus == "LOGIN") or ($Tstatus == "START") ) + { + echo "Usuário $user($full_name) - is logged in to the timeclock. <BR>Login time: $Tevent_date from $Tip_address<BR>\n"; + $TC_log_change_stage = 'tc_log_user_OUT'; + $TC_log_change_button = 'TIMECLOCK LOG THIS USER OUT'; + } +else + { + echo "Usuário $user($full_name) - is NOT logged in to the timeclock. <BR>Last logout time: $Tevent_date from $Tip_address<BR>\n"; + $TC_log_change_stage = 'tc_log_user_IN'; + $TC_log_change_button = 'TIMECLOCK LOG THIS USER IN'; + } + +if ($modify_timeclock_log > 0) + { + echo "<BR><BR>\n"; + echo "<form action=$PHP_SELF method=POST>\n"; + echo "<input type=hidden name=DB value=\"$DB\">\n"; + echo "<input type=hidden name=user value=\"$user\">\n"; + echo "<input type=hidden name=stage value=\"$TC_log_change_stage\">\n"; + echo "<input type=submit name=submit value=\"$TC_log_change_button\"><BR></form>\n"; + echo "<BR><BR>\n"; + } + + +$REPORTdate = date("Y-m-d"); +echo "<center>\n"; +echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Planilha de Tempo</a>\n"; +echo " | <a href=\"./user_stats.php?user=$user\">Estatísticas de Usuário</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Alterar Usuário</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$REPORTdate&end_date=$REPORTdate&group[]=--ALL--&shift=ALL\">Usuário multiple day status detail report</a>"; +echo "</center>\n"; + +echo "</B></TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $StarTtimE); + +echo "\n\n\n<br><br><br>\n\n"; + + +echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<?php + +exit; + + + +?> diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_territories.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_territories.php new file mode 100644 index 00000000..92006655 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/user_territories.php @@ -0,0 +1,1089 @@ +<?php +# user_territories.php +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# This territories script is for use with custom tables in Vtiger which is why +# it is separate from the standard admin.php script. user_territories_active in +# the system_settings table must be active for this script to work. +# +# CHANGES +# 90520-1928 - first build +# 90717-0651 - Added batch +# 90726-2302 - Added vicidial_list user owner update option +# 91012-0310 - Added vicidial_list counts for territory as owner +# + +$version = '2.2.0-4'; +$build = '91012-0310'; + +$MT[0]=''; + +require("dbconnect.php"); + +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["action"])) {$action=$_GET["action"];} + elseif (isset($_POST["action"])) {$action=$_POST["action"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["territory"])) {$territory=$_GET["territory"];} + elseif (isset($_POST["territory"])) {$territory=$_POST["territory"];} +if (isset($_GET["territory_description"])) {$territory_description=$_GET["territory_description"];} + elseif (isset($_POST["territory_description"])) {$territory_description=$_POST["territory_description"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["level"])) {$level=$_GET["level"];} + elseif (isset($_POST["level"])) {$level=$_POST["level"];} +if (isset($_GET["accountid"])) {$accountid=$_GET["accountid"];} + elseif (isset($_POST["accountid"])) {$accountid=$_POST["accountid"];} +if (isset($_GET["batch"])) {$batch=$_GET["batch"];} + elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];} +if (isset($_GET["vl_owner"])) {$vl_owner=$_GET["vl_owner"];} + elseif (isset($_POST["vl_owner"])) {$vl_owner=$_POST["vl_owner"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,user_territories_active,enable_vtiger_integration,outbound_autodial_active,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $user_territories_active = $row[1]; + $enable_vtiger_integration = $row[2]; + $SSoutbound_autodial_active = $row[3]; + $vtiger_server_ip = $row[4]; + $vtiger_dbname = $row[5]; + $vtiger_login = $row[6]; + $vtiger_pass = $row[7]; + $vtiger_url = $row[8]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + + +if ($user_territories_active < 1) + { + echo "ERROR: User Territories are not active on this system\n"; + exit; + } + +if ($non_latin < 1) + { + ### Clean Variable Values ### + $DB = ereg_replace("[^0-9]","",$DB); + $action = ereg_replace("[^\_0-9a-zA-Z]","",$action); + $territory = ereg_replace("[^-\_0-9a-zA-Z]","",$territory); + $territory_description = ereg_replace("[^ -\_\.\,0-9a-zA-Z]","",$territory_description); + $user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); + $level = ereg_replace("[^\_A-Z]","",$level); + $old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); + $old_user = ereg_replace("[^-\_0-9a-zA-Z]","",$old_user); + $accountid = ereg_replace("[^-\_0-9a-zA-Z]","",$accountid); + } + +if (eregi("YES",$batch)) + { + $USER='batch'; + $PASS='batch'; + } +else + { + $USER=$_SERVER['PHP_AUTH_USER']; + $PASS=$_SERVER['PHP_AUTH_PW']; + $USER = ereg_replace("[^0-9a-zA-Z]","",$USER); + $PASS = ereg_replace("[^0-9a-zA-Z]","",$PASS); + + $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and modify_users='1'"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($USER)<2) or (strlen($PASS)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$USER|$PASS|\n"; + exit; + } + } + +if ($enable_vtiger_integration > 0) + { + ### connect to your vtiger database + $linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); + if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} + mysql_select_db("$vtiger_dbname", $linkV); + } + + +if (strlen($action) < 1) + {$action = 'LIST_ALL_TERRITORIES';} + + + +?> +<html> +<head> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<!-- VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> --> +<title>ADMINISTRATION: User Territories +<?php + + + + + + +### BEGIN change territory owner for one account +if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integration > 0) ) + { + echo "\n"; + echo "
\n"; + echo ""; + + echo "
Vtiger Change Territory Owner
\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
Account ID:
New Owner:
Update ViciDial List Owner:
\n"; + exit; + } +### END change territory owner for one account + + +### BEGIN process change territory owner for one account +if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integration > 0) ) + { + echo "\n"; + + if ( (strlen($accountid)<1) or (strlen($user)<1) ) + { + echo "ERROR: Account ID and User must be filled in
\n"; + } + else + { + if (eregi("YES",$batch)) + {$AID_lookupSQL = "website='$accountid'";} + else + {$AID_lookupSQL = "accountid='$accountid'";} + $stmtV="SELECT tickersymbol,accountid from vtiger_account where $AID_lookupSQL;"; + $rsltV=mysql_query($stmtV, $linkV); + if ($DB) {echo "$stmtV\n";} + $vat_ct = mysql_num_rows($rsltV); + if ($vat_ct > 0) + { + $row=mysql_fetch_row($rsltV); + $territory = $row[0]; + $accountid = $row[1]; + + $stmt="SELECT count(*) from vicidial_user_territories where territory='$territory' and user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + $stmt="INSERT INTO vicidial_user_territories SET territory='$territory',user='$user',level='STANDARD_AGENT';"; + $rslt=mysql_query($stmt, $link); + + echo "NOTICE: Had to add user territory: $user $territory
\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + $stmtV="SELECT id from vtiger_users where user_name='$user';"; + $rsltV=mysql_query($stmtV, $linkV); + if ($DB) {echo "$stmtV\n";} + $vtu_ct = mysql_num_rows($rsltV); + if ($vtu_ct > 0) + { + $row=mysql_fetch_row($rsltV); + $user_id = $row[0]; + + $stmt="UPDATE vtiger_crmentity SET smownerid='$user_id',smcreatorid='$user_id',modifiedby='$user_id' where crmid='$accountid';"; + $rsltV=mysql_query($stmt, $linkV); + $changed = mysql_affected_rows($linkV); + + $stmtB="UPDATE vtiger_tracker SET user_id='$user_id' where item_id='$accountid';"; + $rsltV=mysql_query($stmtB, $linkV); + + if ( ($vl_owner == 'YES') and ($accountid > 0) ) + { + $stmtB="UPDATE vicidial_list SET owner='$user' where vendor_lead_code='$accountid';"; + $rsltV=mysql_query($stmtB, $link); + } + + echo "Vtiger Territory Owner Changed: $user $territory
\n"; + echo "Records Changed: $changed
\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='VTIGER', event_type='MODIFY', record_id='$accountid', event_code='VTIGER MODIFY TERRITORY OWNER ACCOUNT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + exit; + } +### END process change territory owner for one account + + + + + +##### BEGIN Set variables to make header show properly ##### +$ADD = '0'; +$hh = 'users'; +$LOGast_admin_access = '1'; +$ADMIN = 'admin.php'; +$page_width='770'; +$section_width='750'; +$header_font_size='3'; +$subheader_font_size='2'; +$subcamp_font_size='2'; +$header_selected_bold=''; +$header_nonselected_bold=''; +$users_color = '#FFFF99'; +$users_font = 'BLACK'; +$users_color = '#E6E6E6'; +$subcamp_color = '#C6C6C6'; +##### END Set variables to make header show properly ##### + +require("admin_header.php"); + +$colspan='3'; + +?> + BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0> + + + + + 0) + { ?> + + + + + +
  ">List Territories   ?action=ADD_TERRITORY">Add Territory   ?action=ADD_USER_TERRITORY">Add User Territory   ?action=CHANGE_TERRITORY_OWNER">Change Vtiger Territory Owner
  \n"; + +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_datetime = $STARTtime; + +$ip = getenv("REMOTE_ADDR"); +$date = date("r"); +$browser = getenv("HTTP_USER_AGENT"); +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +$admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; +$admDIR = eregi_replace('audio_store.php','',$admDIR); +$admSCR = 'admin.php'; +$NWB = "   \"HELP\""; + +$secX = date("U"); +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; + + + + + + + +### BEGIN change territory owner in the system +if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) ) + { + echo ""; echo ""; + + ### Log search + echo "
\n"; + echo "
"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo "
\n"; + echo ""; + + echo "
Vtiger Change Territory Owner\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
Territory:
New Owner:
Update ViciDial List Owner:
\n"; + } +### END change territory owner in the system + + +### BEGIN process change territory owner in the system +if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) ) + { + if ( (strlen($territory)<1) or (strlen($user)<1) ) + { + echo "ERROR: Territory and User must be filled in
\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_user_territories where territory='$territory' and user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + $stmt="INSERT INTO vicidial_user_territories SET territory='$territory',user='$user',level='TOP_AGENT';"; + $rslt=mysql_query($stmt, $link); + + $stmtB="UPDATE vicidial_user_territories SET level='STANDARD_AGENT' where territory='$territory' and user!='$user' and level='TOP_AGENT';"; + $rslt=mysql_query($stmtB, $link); + + echo "NOTICE: Had to add user territory: $user $territory
\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + $stmtV="SELECT id from vtiger_users where user_name='$user';"; + $rsltV=mysql_query($stmtV, $linkV); + if ($DB) {echo "$stmtV\n";} + $vtu_ct = mysql_num_rows($rsltV); + if ($vtu_ct > 0) + { + $row=mysql_fetch_row($rsltV); + $user_id = $row[0]; + + $stmtV="SELECT accountid from vtiger_account where tickersymbol='$territory';"; + $rsltV=mysql_query($stmtV, $linkV); + if ($DB) {echo "$stmtV\n";} + $vat_ct = mysql_num_rows($rsltV); + $account_ids[0]=''; + $p=0; + while ($vat_ct > $p) + { + $row=mysql_fetch_row($rsltV); + $account_ids[$p] = $row[0]; + $p++; + } + + $p=0; + while ($vat_ct > $p) + { + $stmt="UPDATE vtiger_crmentity SET smownerid='$user_id',smcreatorid='$user_id',modifiedby='$user_id' where crmid='$account_ids[$p]';"; + $rsltV=mysql_query($stmt, $linkV); + $changedX = mysql_affected_rows($linkV); + if ($DB) {echo "$stmt|$changedX\n";} + $changed = ($changed + $changedX); + + $stmtV="select activityid from vtiger_seactivityrel where crmid='$account_ids[$p]';"; + $rsltV=mysql_query($stmtV, $linkV); + if ($DB) {echo "$stmtV\n";} + $vact_ct = mysql_num_rows($rsltV); + $activity_ids[0]=''; + $r=0; + while ($vact_ct > $r) + { + $row=mysql_fetch_row($rsltV); + $activity_ids[$r] = $row[0]; + $r++; + } + + $r=0; + while ($vact_ct > $r) + { + $stmt="UPDATE vtiger_crmentity SET smownerid='$user_id' where crmid='$activity_ids[$r]';"; + $rsltV=mysql_query($stmt, $linkV); + $AchangedX = mysql_affected_rows($linkV); + if ($DB) {echo "$stmt|$AchangedX\n";} + $Achanged = ($Achanged + $AchangedX); + $r++; + } + + if ( ($vl_owner == 'YES') and ($account_ids[$p] > 0) ) + { + $stmtB="UPDATE vicidial_list SET owner='$user' where vendor_lead_code='$account_ids[$p]';"; + $rslt=mysql_query($stmtB, $link); + $VchangedX = mysql_affected_rows($link); + if ($DB) {echo "$stmtB|$VchangedX\n";} + $Vchanged = ($Vchanged + $VchangedX); + } + + $p++; + } + + + $stmt="UPDATE vtiger_crmentity SET smownerid='$user_id',smcreatorid='$user_id',modifiedby='$user_id' where crmid IN(SELECT accountid from vtiger_account where tickersymbol='$territory');"; + $rsltV=mysql_query($stmt, $linkV); + $Cchanged = mysql_affected_rows($linkV); + if ($DB) {echo "$stmt|$Cchanged\n";} + + $stmtB="UPDATE vtiger_tracker vt, vtiger_account va SET user_id='$user_id' where vt.item_id=va.accountid and va.tickersymbol='$territory';"; + $rsltV=mysql_query($stmtB, $linkV); + + echo "Vtiger Territory Owner Changed: $user $territory       Records Changed: $changed - $Achanged - $Cchanged - $Vchanged
\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='VTIGER', event_type='MODIFY', record_id='$territory', event_code='VTIGER MODIFY TERRITORY OWNER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "MODIFY_TERRITORY"; + } +### END process change territory owner in the system + + + + + +### BEGIN add user territory page +if ($action == "ADD_USER_TERRITORY") + { + echo "
\n"; + echo ""; + + echo "
Add User Territory\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Agent:
Territory:
Level:
\n"; + } +### END add user territory page + + +### BEGIN process add user territory page +if ($action == "PROCESS_ADD_USER_TERRITORY") + { + if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) + { + echo "ERROR: Territory, User and Level must be filled in
\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_user_territories where territory='$territory' and user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + echo "ERROR: this territory user is already in the system
\n"; + } + else + { + $stmt="INSERT INTO vicidial_user_territories SET territory='$territory',user='$user',level='$level';"; + $rslt=mysql_query($stmt, $link); + + if ($level == "TOP_AGENT") + { + $stmtB="UPDATE vicidial_user_territories SET level='STANDARD_AGENT' where territory='$territory' and user!='$user' and level='TOP_AGENT';"; + $rslt=mysql_query($stmtB, $link); + } + + echo "User Territory Added: $user $territory
\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "MODIFY_TERRITORY"; + } +### END process add user territory page + + +### BEGIN process modify user territory page +if ($action == "PROCESS_MODIFY_USER_TERRITORY") + { + if ( (strlen($territory)<1) or (strlen($user)<1) or (strlen($level)<1) ) + { + echo "ERROR: Territory, User and Level must be filled in
\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_user_territories where territory='$territory' and user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 0) + { + echo "ERROR: this territory user is not in the system
\n"; + } + else + { + $stmt="UPDATE vicidial_user_territories SET level='$level' where territory='$territory' and user='$user';"; + $rslt=mysql_query($stmt, $link); + + if ($level == "TOP_AGENT") + { + $stmtB="UPDATE vicidial_user_territories SET level='STANDARD_AGENT' where territory='$territory' and user!='$user' and level='TOP_AGENT';"; + $rslt=mysql_query($stmtB, $link); + } + + echo "User Territory Modified: $user $territory
\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='MODIFY', record_id='$territory', event_code='ADMIN MODIFY USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "MODIFY_TERRITORY"; + } +### END process modify user territory page + + +### BEGIN delete user territory page +if ($action == "DELETE_USER_TERRITORY") + { + if ( (strlen($territory)<1) or (strlen($user)<1) ) + { + echo "ERROR: Territory and User must be filled in
\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_user_territories where territory='$territory' and user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 0) + { + echo "ERROR: this territory user is not in the system
\n"; + } + else + { + $stmt="DELETE from vicidial_user_territories where territory='$territory' and user='$user';"; + $rslt=mysql_query($stmt, $link); + + echo "User Territory Deleted: $user $territory
\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='DELETE', record_id='$territory', event_code='ADMIN DELETE USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "MODIFY_TERRITORY"; + } +### END delete user territory page + + + + + + +### BEGIN add territory page +if ($action == "ADD_TERRITORY") + { + echo "
\n"; + echo ""; + + echo "
Add Territory\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Territory:
Territory Description:
\n"; + } +### END add territory page + + +### BEGIN process add territory page +if ($action == "PROCESS_ADD_TERRITORY") + { + if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) + { + echo "ERROR: Territory and Territory Description must be filled in
\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_territories where territory='$territory';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + echo "ERROR: there is already a territory in the system with this name
\n"; + } + else + { + $stmt="INSERT INTO vicidial_territories SET territory='$territory',territory_description='$territory_description';"; + $rslt=mysql_query($stmt, $link); + + echo "Territory Added: $territory
\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD TERRITORY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "LIST_ALL_TERRITORIES"; + } +### END process add territory page + + +### BEGIN delete territory page +if ($action == "DELETE_TERRITORY") + { + if (strlen($territory)<1) + { + echo "ERROR: Territory must be filled in
\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_territories where territory='$territory';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 0) + { + echo "ERROR: This territory is not in the system with this name
\n"; + } + else + { + $stmt="DELETE from vicidial_territories where territory='$territory';"; + $rslt=mysql_query($stmt, $link); + + echo "Territory Deleted: $territory
\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='DELETE', record_id='$territory', event_code='ADMIN DELETE TERRITORY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "LIST_ALL_TERRITORIES"; + } +### END delete territory page + + +### BEGIN process modify territory page +if ($action == "PROCESS_MODIFY_TERRITORY") + { + if ( (strlen($territory)<1) or (strlen($territory_description)<1) ) + { + echo "ERROR: Territory and Territory Description must be filled in
\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_territories where territory='$territory';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + { + echo "ERROR: This territory is not in the system with this name
\n"; + } + else + { + $stmt="UPDATE vicidial_territories SET territory_description='$territory_description' where territory='$territory';"; + $rslt=mysql_query($stmt, $link); + + echo "Territory Modified: $territory
\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='MODIFY', record_id='$territory', event_code='ADMIN MODIFY TERRITORY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $action = "MODIFY_TERRITORY"; + } +### END process modify territory page + + +### BEGIN modify territory page +if ($action == "MODIFY_TERRITORY") + { + $stmt="SELECT territory,territory_description from vicidial_territories where territory='$territory';"; + $rslt=mysql_query($stmt, $link); + $territories_to_print = mysql_num_rows($rslt); + if ($territories_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + + echo ""; echo ""; + + ### Log search + echo "
\n"; + echo "
"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo "
\n"; + echo ""; + + echo "
Modify Territory\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + $stmt = "SELECT count(*) FROM vicidial_user_territories where territory='$territory';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vut_ct = mysql_num_rows($rslt); + if ($vut_ct > 0) + { + $row=mysql_fetch_row($rslt); + $user_count = $row[0]; + } + echo ""; + + $owner_count=0; + $stmt = "SELECT count(*) FROM vicidial_list where owner='$territory';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VLo_ct = mysql_num_rows($rslt); + if ($VLo_ct > 0) + { + $row=mysql_fetch_row($rslt); + $owner_count = $row[0]; + } + echo ""; + + if ($enable_vtiger_integration > 0) + { + $stmtV = "SELECT count(*) FROM vtiger_account where tickersymbol='$territory';"; + $rsltV=mysql_query($stmtV, $linkV); + if ($DB) {echo "$stmtV\n";} + $vta_ct = mysql_num_rows($rsltV); + if ($vta_ct > 0) + { + $row=mysql_fetch_row($rsltV); + $vtiger_count = $row[0]; + } + echo ""; + } + echo "\n"; + echo "
Territory: $rowx[0]
Territory Description:
Agents: $user_count
Accounts: $owner_count
Vtiger Accounts: $vtiger_count
\n"; + echo "

\n"; + + echo "\n"; + + $stmt="SELECT vut.user,level,full_name from vicidial_user_territories vut,vicidial_users vu where vut.territory='$territory' and vut.user=vu.user order by vu.user;"; + $rslt=mysql_query($stmt, $link); + $territories_to_print = mysql_num_rows($rslt); + $o=0; + while ($territories_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Tuser[$o] = $rowx[0]; + $Tlevel[$o] = $rowx[1]; + $Tfull_name[$o] = $rowx[2]; + $o++; + } + $o=0; + while ($territories_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $p++; + + if (eregi("1$|3$|5$|7$|9$", $p)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + if ($enable_vtiger_integration > 0) + { + $stmtV="SELECT id from vtiger_users where user_name='$Tuser[$o]';"; + $rsltV=mysql_query($stmtV, $linkV); + if ($DB) {echo "$stmtV\n";} + $vtu_ct = mysql_num_rows($rsltV); + if ($vtu_ct > 0) + { + $row=mysql_fetch_row($rsltV); + $user_id = $row[0]; + + $stmtV = "SELECT count(*) FROM vtiger_account where tickersymbol='$territory' and accountid IN(SELECT crmid from vtiger_crmentity where smownerid='$user_id');"; + $rsltV=mysql_query($stmtV, $linkV); + if ($DB) {echo "$stmtV\n";} + $vca_ct = mysql_num_rows($rsltV); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rsltV); + echo ""; + } + } + } + + # $owner_count=0; + # $stmt = "SELECT count(*) FROM vicidial_list where owner='$territory';"; + # $rslt=mysql_query($stmt, $link); + # if ($DB) {echo "$stmt\n";} + # $VLo_ct = mysql_num_rows($rslt); + # if ($VLo_ct > 0) + # { + # $row=mysql_fetch_row($rslt); + # $owner_count = $row[0]; + # } + # echo ""; + + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
Users in this Territory:
$p$Tuser[$o]$Tfull_name[$o]VT Accounts: $row[0]Accounts: $owner_count"; + echo "
"; + echo ""; + echo ""; + echo ""; + echo " "; + echo ""; + echo "
"; + echo "
DELETE
\n"; + echo "


\n"; + + echo "Delete This Territory\n"; + echo "

\n"; + } + else + { + echo "ERROR: Territory not found: $territory
\n"; + } + } +### END modify territory page + + + + + +### BEGIN list all territories in the system +if ($action == "LIST_ALL_TERRITORIES") + { + echo " +
\n"; + echo ""; + echo "
List All Territories:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + if ($enable_vtiger_integration > 0) + { + echo "\n"; + } + echo "\n"; + + $stmt = "SELECT territory_id,territory,territory_description FROM vicidial_territories order by territory;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + $i=0; + while ($vt_ct > $i) + { + $row=mysql_fetch_row($rslt); + $Lterritory_id[$i] = $row[0]; + $Lterritory[$i] = $row[1]; + $Lterritory_description[$i] = $row[2]; + $i++; + } + $i=0; + while ($vt_ct > $i) + { + $stmt = "SELECT count(*) FROM vicidial_user_territories where territory='$Lterritory[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vut_ct = mysql_num_rows($rslt); + if ($vut_ct > 0) + { + $row=mysql_fetch_row($rslt); + $Lterritory_count[$i] = $row[0]; + } + + $stmt = "SELECT count(*) FROM vicidial_list where owner='$Lterritory[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VLo_ct = mysql_num_rows($rslt); + if ($VLo_ct > 0) + { + $row=mysql_fetch_row($rslt); + $Lterritory_owner_count[$i] = $row[0]; + } + + if ($enable_vtiger_integration > 0) + { + $stmtV = "SELECT count(*) FROM vtiger_account where tickersymbol='$Lterritory[$i]';"; + $rsltV=mysql_query($stmtV, $linkV); + if ($DB) {echo "$stmtV\n";} + $va_ct = mysql_num_rows($rsltV); + if ($va_ct > 0) + { + $row=mysql_fetch_row($rsltV); + $Lvtiger_count[$i] = $row[0]; + } + } + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + if ($enable_vtiger_integration > 0) + { + echo ""; + } + echo "\n"; + + $i++; + } + echo "
#IDTERRITORYDESCRIPTIONAGENTSACCOUNTSVT ACCOUNTS
$i $Lterritory_id[$i] $Lterritory[$i] $Lterritory_description[$i] $Lterritory_count[$i] $Lterritory_owner_count[$i] $Lvtiger_count[$i]


\n"; + echo "\n"; + echo "
\n"; + } +### END list all territories in the system + + + + + + + + +?> + + + +
User Territories     VERSION:     BUILD:    
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vdremote.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vdremote.php new file mode 100644 index 00000000..21bbc65d --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vdremote.php @@ -0,0 +1,591 @@ + LICENSE: AGPLv2 +# +# Changes +# 50307-1721 - First version +# 51123-1502 - removed requirement of PHP Globals=on +# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1603 - Added variable filtering to eliminate SQL injection attack threat +# 90508-0644 - Changed to PHP long tags +# 91129-2249 - Replaced SELECT STAR in SQL queries, formatting fixes +# + +$version = '2.2.0'; +$build = '91129-2249'; + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} + elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} + elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} +if (isset($_GET["groups"])) {$groups=$_GET["groups"];} + elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} +if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} + elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} +if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} + elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} +if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} + elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} + elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["groups"])) {$groups=$_GET["groups"];} + elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +if (!isset($force_logout)) {$force_logout = 0;} + +if ($force_logout) + { + if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + } + echo "Voce efetuou logout. Obrigado\n"; + exit; + } + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + + +$popup_page = './closer_popup.php'; +$STARTtime = date("U"); +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 3;"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$fp = fopen ("./project_auth_entries.txt", "a"); +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } +else + { + header ("Content-type: text/html; charset=utf-8"); + + if($auth>0) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname=$row[0]; + + $stmt="SELECT count(*) from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $authx=$row[0]; + + if($authx>0) + { + $stmt="SELECT remote_agent_id,server_ip,number_of_lines from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $remote_agent_id=$row[0]; + $server_ip=$row[1]; + if (!$number_of_lines) {$number_of_lines=$row[2];} + + fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } + else + { + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; + exit; + } + } + else + { + fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } + } + +echo "\n"; +echo "\n"; +echo "\n"; +if ($ADD==61111) + { + echo"\n"; + } +echo "\n"; +?> + +AGENTES REMOTOS: $LOGfullname - $PHP_AUTH_USER "; + +if (!$ADD) {$ADD="31111";} +if ($ADD==31111) {echo "Alterar Agentes Remotos";} +if ($ADD==41111) {echo "Alterar Agentes Remotos";} +if ($ADD==61111) {echo "Remote Agent Status";} +if ($ADD==71111) {echo "Remote Agent Closer Stats";} + + +if (strlen($ADD)>4) + { + ##### get server listing for dynamic pulldown + $stmt="SELECT server_ip,server_description from servers order by server_ip"; + $rslt=mysql_query($stmt, $link); + $servers_to_print = mysql_num_rows($rslt); + $servers_list=''; + + $o=0; + while ($servers_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $servers_list .= "\n"; + $o++; + } + + ##### get campaigns listing for dynamic pulldown + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + $campaigns_list=''; + + $o=0; + while ($campaigns_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "\n"; + $o++; + } + + ##### get inbound groups listing for checkboxes + if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) + { + $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); + $groups = explode(" ", $closer_campaigns); + } + + $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; + $rslt=mysql_query($stmt, $link); + $groups_to_print = mysql_num_rows($rslt); + $groups_list=''; + $groups_value=''; + + $o=0; + while ($groups_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $group_id_value = $rowx[0]; + $group_name_value = $rowx[1]; + $groups_list .= "2) {$groups_value .= " -";} + } + +?> + + + +
+ + + + +
  AGENTES REMOTOS:   Sair  
  ALTERAR | ">STATUS | ">ESTATÍSTICAS DE ENTRADA
+"; + + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $remote_agent_id = $row[0]; + $user_start = $row[1]; + $number_of_lines = $row[2]; + $server_ip = $row[3]; + $conf_exten = $row[4]; + $status = $row[5]; + $campaign_id = $row[6]; + + echo "
ALTERAR AGENTES REMOTOS: $row[0]
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Início do ID do Usuário: $user_start
Número de linhas: (somente números)
IP do Servidor: $row[3]
Extensão Externa: (number dialed to reach agents [i.e. 913125551212])
Status:
Campanha: $campaign_id
Grupos de Entrada: \n"; + echo "$groups_list"; + echo "
\n"; + echo "AVISO: Pode demorar até 30 segundos para que as alterações enviadas por essa tela se tornem ativas\n"; + } + + + +###################### +# ADD=41111 modify remote agents info in the system +###################### + +if ($ADD==41111) + { + echo ""; + + if ( (strlen($number_of_lines) < 1) or (strlen($conf_exten) < 2) ) + {echo "
AGENTES REMOTOS NÃO ALTERADOS - Por favor volte e verifique os dados digitados\n";} + else + { + $stmt="UPDATE vicidial_remote_agents set number_of_lines='" . mysql_real_escape_string($number_of_lines) . "', conf_exten='" . mysql_real_escape_string($conf_exten) . "', status='" . mysql_real_escape_string($status) . "', closer_campaigns='" . mysql_real_escape_string($groups_value) . "' where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; + $rslt=mysql_query($stmt, $link); + +# echo "$stmt\n"; + echo "
AGENTES REMOTOS ALTERADOS\n"; + + ### LOG CHANGES TO LOG FILE ### + $fp = fopen ("./admin_changes_log.txt", "a"); + fwrite ($fp, "$date|MODIFY AGENTES REMOTOS ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); + fclose($fp); + } + + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $remote_agent_id = $row[0]; + $user_start = $row[1]; + $number_of_lines = $row[2]; + $server_ip = $row[3]; + $conf_exten = $row[4]; + $status = $row[5]; + $campaign_id = $row[6]; + + echo "
ALTERAR AGENTES REMOTOS: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Início do ID do Usuário: $user_start
Número de linhas: (somente números)
IP do Servidor: $row[3]
Extensão Externa: (number dialed to reach agents [i.e. 913125551212])
Status:
Campanha: $campaign_id
Grupos de Entrada: \n"; + echo "$groups_list"; + echo "
\n"; + echo "AVISO: Pode demorar até 30 segundos para que as alterações enviadas por essa tela se tornem ativas\n"; + } + + + +###################### +# ADD=61111 status of remote agent in the system and active calls and queue +###################### + +if ($ADD==61111) + { + echo "
";
+
+	if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
+		{echo "
ERRO DE AGENTES REMOTOS – Por favor volte e verifique os dados digitados \n";} + else + { + $users_list = ''; + $k=0; + while($k < $number_of_lines) + { + $nextuser=($user + $k); + $users_list .= "'" . mysql_real_escape_string($nextuser) . "',"; + $k++; + } + $users_list = preg_replace("/.$/","",$users_list); + + echo "Remote Agent Time On Calls $NOW_TIME\n\n"; + echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; + echo "| STATION | USER | LEADID | CHANNEL | STATUS | START TIME | MINUTES |\n"; + echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; + + + $stmt="select extension,user,lead_id,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' and user IN($users_list) order by extension;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $talking_to_print = mysql_num_rows($rslt); + if ($talking_to_print > 0) + { + $i=0; + while ($i < $talking_to_print) + { + $leadlink=0; + $row=mysql_fetch_row($rslt); + if (eregi("READY|PAUSED",$row[4])) + { + $row[3]=''; + $row[5]='- AGUARDANDO -'; + $row[6]=$row[7]; + } + $extension = sprintf("%-10s", $row[0]); + $user = sprintf("%-6s", $row[1]); + $leadid = sprintf("%-12s", $row[2]); + if ($row[2] > 0) + { + $leadidLINK=$row[2]; + $leadlink++; + if ( eregi("QUEUE",$row[4]) ) {$row[6]=$STARTtime;} + $leadid = "$leadid"; + } + $channel = sprintf("%-10s", $row[3]); + $cc=0; + while ( (strlen($channel) > 10) and ($cc < 100) ) + { + $channel = eregi_replace(".$","",$channel); + $cc++; + if (strlen($channel) <= 10) {$cc=101;} + } + $status = sprintf("%-6s", $row[4]); + $start_time = sprintf("%-19s", $row[5]); + $call_time_S = ($STARTtime - $row[6]); + + $call_time_M = ($call_time_S / 60); + $call_time_M = round($call_time_M, 2); + $call_time_M_int = intval("$call_time_M"); + $call_time_SEC = ($call_time_M - $call_time_M_int); + $call_time_SEC = ($call_time_SEC * 60); + $call_time_SEC = round($call_time_SEC, 0); + if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} + $call_time_MS = "$call_time_M_int:$call_time_SEC"; + $call_time_MS = sprintf("%7s", $call_time_MS); + $G = ''; $EG = ''; + if ($call_time_M_int >= 5) {$G=''; $EG='';} + if ($call_time_M_int >= 10) {$G=''; $EG='';} + + echo "| $G$extension$EG | $G$user$EG | $G$leadid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; + + $i++; + } + + echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; + echo " $i agentes conectados ao servidor $server_ip\n\n"; + + echo " - Acima de 5 minutos em chamada\n"; + echo " - Acima de 10 minutos em chamada\n"; + } + else + { + echo "**************************************************************************************\n"; + echo "*********************************AGENTES SEM CHAMADAS*********************************\n"; + echo "**************************************************************************************\n"; + } + } + + echo "
\n\n"; + } + + +###################### +# ADD=71111 stats for remote agents from closer logs(vicidial_closer_log) +###################### + +if ($ADD==71111) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n\n"; + echo "
";
+
+	if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
+		{echo "
ERRO DE AGENTES REMOTOS – Por favor volte e verifique os dados digitados \n";} + else + { + $users_list = ''; + $k=0; + while($k < $number_of_lines) + { + $nextuser=($user + $k); + $users_list .= "'$nextuser',"; + $k++; + } + $users_list = preg_replace("/.$/","",$users_list); + + $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list);"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $in_calls = $row[0]; + $in_time = $row[1]; + $in_time_M = ($in_time / 60); + $in_time_M = round($in_time_M, 2); + $in_time_M_int = intval("$in_time_M"); + $in_time_SEC = ($in_time_M - $in_time_M_int); + $in_time_SEC = ($in_time_SEC * 60); + $in_time_SEC = round($in_time_SEC, 0); + if ($in_time_SEC < 10) {$in_time_SEC = "0$in_time_SEC";} + $in_time_MS = "$in_time_M_int:$in_time_SEC"; + $in_time_MS = sprintf("%7s", $in_time_MS); + + echo "Estatísticas de entrada para Agentes Remotos $NOW_TIME\n\n"; + echo "\n"; + echo "Chamadas totais atendidas $query_date: $in_calls\n"; + echo "Tempo total de conversação $query_date: $in_time_MS (minutes:seconds)\n"; + echo "\n"; + echo "\n"; + echo "Lista de chamadas para $query_date:\n"; + echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; + echo "| USER | LEADID | GROUP | PHONE NUM | STATUS | CALL TIME | MINUTES |\n"; + echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; + + + $stmt="select user,lead_id,campaign_id,phone_number,status,call_date,length_in_sec from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list) order by call_date;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $talking_to_print = mysql_num_rows($rslt); + if ($talking_to_print > 0) + { + $i=0; + while ($i < $talking_to_print) + { + $row=mysql_fetch_row($rslt); + $user = sprintf("%-8s", $row[0]); + $leadid = sprintf("%-10s", $row[1]); + $group = sprintf("%-14s", $row[2]); + $phone = sprintf("%-10s", $row[3]); + $status = sprintf("%-6s", $row[4]); + $start_time = sprintf("%-19s", $row[5]); + $call_time_S = $row[6]; + + $call_time_M = ($call_time_S / 60); + $call_time_M = round($call_time_M, 2); + $call_time_M_int = intval("$call_time_M"); + $call_time_SEC = ($call_time_M - $call_time_M_int); + $call_time_SEC = ($call_time_SEC * 60); + $call_time_SEC = round($call_time_SEC, 0); + if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} + $call_time_MS = "$call_time_M_int:$call_time_SEC"; + $call_time_MS = sprintf("%7s", $call_time_MS); + $G = ''; $EG = ''; + # if ($call_time_M_int >= 5) {$G=''; $EG='';} + # if ($call_time_M_int >= 10) {$G=''; $EG='';} + + echo "| $G$user$EG | $G$leadid$EG | $G$group$EG | $G$phone$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; + + $i++; + } + + echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; +# echo " $i agents logged in on server $server_ip\n\n"; + +# echo " - 5 minutes or more on call\n"; +# echo " - Over 10 minutes on call\n"; + } + else + { + echo "**************************************************************************************\n"; + echo "*********************************NENHUMA CHAMADA HOJE*******************************\n"; + echo "**************************************************************************************\n"; + } + } + + echo "
\n\n"; + } + + + + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "\n\n\n


\n\n"; + + +echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; + + +?> + + +
+ + + + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vicidial_admin_web_logo.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vicidial_admin_web_logo.gif new file mode 100644 index 00000000..8c5a9d22 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vicidial_admin_web_logo.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vicidial_admin_web_logo_small.gif b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vicidial_admin_web_logo_small.gif new file mode 100644 index 00000000..95738d49 Binary files /dev/null and b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vicidial_admin_web_logo_small.gif differ diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vicidial_sales_viewer.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vicidial_sales_viewer.php new file mode 100644 index 00000000..2ffcb03b --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vicidial_sales_viewer.php @@ -0,0 +1,258 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 80310-1500 - first build +# 90310-2135 - Added admin header +# 90508-0644 - Changed to PHP long tags +# + +if (isset($_GET["dcampaign"])) {$dcampaign=$_GET["dcampaign"];} + elseif (isset($_POST["dcampaign"])) {$dcampaign=$_POST["dcampaign"];} +if (isset($_GET["submit_report"])) {$submit_report=$_GET["submit_report"];} + elseif (isset($_POST["submit_report"])) {$submit_report=$_POST["submit_report"];} +if (isset($_GET["list_ids"])) {$list_ids=$_GET["list_ids"];} + elseif (isset($_POST["list_ids"])) {$list_ids=$_POST["list_ids"];} +if (isset($_GET["sales_number"])) {$sales_number=$_GET["sales_number"];} + elseif (isset($_POST["sales_number"])) {$sales_number=$_POST["sales_number"];} +if (isset($_GET["sales_time_frame"])) {$sales_time_frame=$_GET["sales_time_frame"];} + elseif (isset($_POST["sales_time_frame"])) {$sales_time_frame=$_POST["sales_time_frame"];} +if (isset($_GET["forc"])) {$forc=$_GET["forc"];} + elseif (isset($_POST["forc"])) {$forc=$_POST["forc"];} + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; + +$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); +$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { +# Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); +# Header("HTTP/1.0 401 Unauthorized"); + echo "Nome ou Senha inválidos or no export report permission: |$PHP_AUTH_USER|\n"; + exit; + } + + +?> + + +Recent Sales Lookup + + + + + +
"; +?> + +
+ + + + + + + + + + + + + + + + + + + + + +
Vicidial SAINTE recent sales report               Back to Admin +
+ + + + + + + + + + +
Select a campaign:
Select list ID(s) # (optional):
+
View sales made within the last OR...View the last sales**
(If you enter values in both fields, the results will be limited by the first criteria met)
Campanha is:    Transfer  Non-transfer
** - sorted by call date
+
+0)) { $list_id_clause.="$lists[$i], "; } + } + $list_id_clause=substr($list_id_clause, 0, -2); + $list_id_clause.=")"; + + if ($sales_number && $sales_number>0) { + $sales_number=eregi_replace("[^0-9]", "", $sales_number); + $limit_clause="limit $sales_number"; + } else { + $sales_number=0; + $limit_clause=""; + } + if ($sales_time_frame && $sales_time_frame>0) { + $hours=$sales_time_frame/60; + $timestamp=date("YmdHis", mktime(date("H"),(date("i")-$sales_time_frame),date("s"),date("m"),date("d"),date("Y"))); + } else { + $timestamp=date("YmdHis", mktime(date("H"),date("i"),date("s"),date("m"),(date("d")-1),date("Y"))); + $hours=24; + } + print "
"; + print ""; + $i=0; + + $dfile=fopen("discover_stmts.txt", "w"); + if ($forc=="C") { + $stmt="select v.first_name, v.last_name, v.phone_number, vl.call_date, v.lead_id, u.full_name from vicidial_users u, vicidial_list v, vicidial_log vl where vl.call_date>='$timestamp' and vl.lead_id=v.lead_id and v.status='SALE' $list_id_clause and vl.user=u.user order by call_date desc $limit_clause"; + } else { + $stmt="select v.first_name, v.last_name, v.phone_number, vl.call_date, v.lead_id, vl.user, vl.closer from vicidial_list v, vicidial_xfer_log vl where vl.call_date>='$timestamp' and vl.lead_id=v.lead_id and v.status='SALE' $list_id_clause order by call_date desc $limit_clause"; + } + fwrite($dfile, "$stmt\n"); + $rslt=mysql_query($stmt, $link); + $q=0; + print "\n"; + print "\n"; + print "\t\n"; + print "\t\n"; + print "\t\n"; + print "\t\n"; + print "\t\n"; + print "\n"; + while ($row=mysql_fetch_row($rslt)) { + $rec_stmt="select max(recording_id) from recording_log where lead_id='$row[4]'"; + $rec_rslt=mysql_query($rec_stmt, $link); + $rec_row=mysql_fetch_row($rec_rslt); + + if ($forc=="F") { + $rep_stmt="select full_name from vicidial_users where user='$row[5]'"; + $rep_rslt=mysql_query($rep_stmt, $link); + $fr_row=mysql_fetch_array($rep_rslt); + + $rep_stmt="select full_name from vicidial_users where user='$row[6]'"; + $rep_rslt=mysql_query($rep_stmt, $link); + $cl_row=mysql_fetch_array($rep_rslt); + + $rep_name="$fr_row[full_name]/$cl_row[full_name]"; + } else { + $rep_name=$row[5]; + } + + if ($i%2==0) {$bgcolor="#999999";} else {$bgcolor="#CCCCCC";} + print "\n"; + print "\t\n"; + print "\t\n"; + print "\t\n"; + print "\t\n"; + print "\t\n"; + print "\n"; + flush(); + } + print "
Last ".mysql_num_rows($rslt)." sales made
Sales Rep(s)Customer NamePhoneRecording IDTimestamp
$rep_name$row[0] $row[1]$row[2]$rec_row[0]$row[3]
"; + passthru("$WeBServeRRooT/vicidial/spreadsheet_sales_viewer.pl $list_ids $sales_number $timestamp $forc $now $dcampaign"); +# print "\n\n
$WeBServeRRooT/vicidial/spreadsheet_sales_viewer.pl $list_ids $sales_number $timestamp $forc $now $dcampaign
\n"; + flush(); + print ""; + if ($forc=="F") { + print ""; + } + print ""; + print "
View complete Excel fronter report for this shiftView complete Excel sales report for this shift
"; +} +?> + +
+ + + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vtiger_search.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vtiger_search.php new file mode 100644 index 00000000..6636a431 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vtiger_search.php @@ -0,0 +1,885 @@ + LICENSE: AGPLv2 +# +# This page does a search against a standard vtiger CRM system. If the record +# is not present, it will create a new one and send the agent's screen to that new page. +# +# This code is tested against vtiger 5.0.4 and 5.1.0 +# +# CHANGES +# 60719-1615 - First version +# 60801-2304 - Added mysql debug and auto-forward +# 60802-1111 - Added insertion of not-found record into vtiger system +# 71220-0000 - Modified by I. Taushanov for VTiger 5.03- search/create lead +# 80120-1934 - Added changes for compatibility with vtiger 5.0.3 +# 81229-1017 - Added usage of system_settings connection settings for vtiger database +# 81229-1441 - Added options for searching by ACCTID, ACCOUNT, VENDOR and LEAD +# 90111-1451 - Added logging of call as activity for account/lead +# 90112-0336 - Added create call and create lead options +# 90323-2104 - Added deleted account/lead check and reactivation from campaign option +# 91228-1751 - Added UNIFIED_CONTACT search option +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["address1"])) {$address1=$_GET["address1"];} + elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} +if (isset($_GET["address2"])) {$address2=$_GET["address2"];} + elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} +if (isset($_GET["address3"])) {$address3=$_GET["address3"];} + elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} +if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} + elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} +if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} + elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} +if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} + elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} +if (isset($_GET["channel"])) {$channel=$_GET["channel"];} + elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} +if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} + elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} +if (isset($_GET["city"])) {$city=$_GET["city"];} + elseif (isset($_POST["city"])) {$city=$_POST["city"];} +if (isset($_GET["comments"])) {$comments=$_GET["comments"];} + elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} +if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} + elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} +if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} + elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} + elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["email"];} +if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} + elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} + elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} + elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} + elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} +if (isset($_GET["phone"])) {$phone=$_GET["phone"];} + elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} +if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} + elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} +if (isset($_GET["province"])) {$province=$_GET["province"];} + elseif (isset($_POST["province"])) {$province=$_POST["province"];} +if (isset($_GET["security"])) {$security=$_GET["security"];} + elseif (isset($_POST["security"])) {$security=$_POST["security"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["state"])) {$state=$_GET["state"];} + elseif (isset($_POST["state"])) {$state=$_POST["state"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} + elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} + elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} +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"];} + +#$DB = '1'; # DEBUG override +$US = '_'; +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$HHMMnow = date("H:i"); +$minute_old = mktime(date("H"), date("i")+5, date("s"), date("m"), date("d"), date("Y")); +$HHMMend = date("H:i",$minute_old); +$NOW_TIME = date("Y-m-d H:i:s"); +$REC_TIME = date("Ymd-His"); +$FILE_datetime = $STARTtime; +$parked_time = $STARTtime; + +############################################################### +##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### +$stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } +##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### +############################################################# + + +echo "\n"; +echo "\n"; +echo "VICIDIAL Vtiger Lookup\n"; +echo "\n"; + + +if ($enable_vtiger_integration < 1) + { + echo "ERROR! - Vtiger integration is disabled in the VICIDIAL system_settings"; + exit; + } + +$stmt = "SELECT vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_search_dead FROM vicidial_campaigns where campaign_id='$campaign';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$vtc_conf_ct = mysql_num_rows($rslt); +if ($vtc_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $vtiger_search_category = $row[0]; + $vtiger_create_call_record = $row[1]; + $vtiger_create_lead_record = $row[2]; + $vtiger_search_dead = $row[3]; + } +if (strlen($vtiger_search_category)<1) + {$vtiger_search_category = 'LEAD';} + +### connect to your vtiger database +$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); +if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} +echo 'Connected successfully'; +mysql_select_db("$vtiger_dbname", $linkV); + +# Methods of searching for records: +# +# ACCTID: +# $stmt="SELECT count(*) from vtiger_account where accountid='$vendor_id';"; +# +# ACCOUNT: +# $stmt="SELECT count(*) from vtiger_account where phone='$phone' or otherphone='$phone' or fax='$phone';"; +# $stmt="SELECT count(*) from vtiger_contactdetails where phone='$phone' or mobile='$phone' or fax='$phone';"; +# $stmt="SELECT count(*) from vtiger_contactsubdetails where homephone='$phone' or otherphone='$phone' or assistantphone='$phone';"; +# +# VENDOR: +# $stmt="SELECT count(*) from vtiger_vendor where phone='$phone';"; +# +# LEAD: +# $stmt="SELECT count(*) from vtiger_leadaddress where phone='$phone' or mobile='$phone' or fax='$phone';"; + +$lead_search=0; $account_search=0; $vendor_search=0; $acctid_search=0; $unified_contact=0; + +if (ereg('ACCTID',$vtiger_search_category)) {$acctid_search=1;} +if (ereg('ACCOUNT',$vtiger_search_category)) {$account_search=1;} +if (ereg('VENDOR',$vtiger_search_category)) {$vendor_search=1;} +if (ereg('LEAD',$vtiger_search_category)) {$lead_search=1;} +if (ereg('UNIFIED_CONTACT',$vtiger_search_category)) {$unified_contact=1;} + + + +########################################################################## +##### BEGIN - UNIFIED_CONTACT - Search using beta 5.1.0 unified search feature +########################################################################## +if ($unified_contact > 0) + { + $unified_contact_URL = "$vtiger_url/index.php?action=UnifiedSearch&module=Home&search_module=Contacts&query_string=$phone&_service=vicidial"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + + echo "
";
+	echo "Forwarding to Vtiger Unified Contact Search page...\n";
+	echo "phone number:   $phone\n";
+	echo "

"; + exit; + } +########################################################################## +##### END - UNIFIED_CONTACT +########################################################################## + + + +########################################################################## +##### BEGIN - ACCTID - Search in the account records for accountid number +########################################################################## +if ($acctid_search > 0) + { + $stmt="SELECT count(*) from vtiger_account where accountid='$vendor_id';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + if ($DB) {echo "
\nACCTID|$vendor_id|$found_count|\n";} + + if ($found_count < 1) + { + echo "\n"; + } + else + { + $stmt="SELECT count(*) from vtiger_crmentity where crmid='$vendor_id' and deleted='1';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $deleted_count = $row[0]; + if ( ($deleted_count > 0) and (ereg('DISABLED',$vtiger_search_dead)) ) + { + echo "\n"; + } + else + { + if ( ($deleted_count > 0) and ( (ereg('RESURRECT',$vtiger_search_dead)) or (ereg('ASK',$vtiger_search_dead)) ) ) + { + # un-delete the record + $stmt="UPDATE vtiger_crmentity SET deleted='0' where crmid='$vendor_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + echo "\n"; + } + + if (ereg('Y',$vtiger_create_call_record)) + { + ### Log the call in Vtiger + + #Get logged in user ID + $stmt="SELECT id from vtiger_users where user_name='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $user_id = $row[0]; + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Get next aviable id from vtiger_crmentity_seq to use as activityid in vtiger_crmentity + $stmt="SELECT id from vtiger_crmentity_seq ;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $activityid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next aviable crmid with 1 so next record gets proper id + $stmt="UPDATE vtiger_crmentity_seq SET id = '$activityid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_salesmanactivityrel + $stmt = "INSERT INTO vtiger_salesmanactivityrel SET smid='$user_id',activityid='$activityid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_seactivityrel + $stmt = "INSERT INTO vtiger_seactivityrel SET crmid='$vendor_id',activityid='$activityid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_crmentity + $stmt = "INSERT INTO vtiger_crmentity (crmid, smcreatorid, smownerid, modifiedby, setype, description, createdtime, modifiedtime, viewedtime, status, version, presence, deleted) VALUES ('$activityid', '$user_id', '$user_id','$user_id', 'Calendar', 'VICIDIAL Call user $user', '$NOW_TIME', '$NOW_TIME', '$NOW_TIME', NULL, '0', '1', '0');"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_activity + $stmt = "INSERT INTO vtiger_activity SET activityid='$activityid',subject='VICIDIAL Account call $vendor_id',activitytype='Call',date_start='$TODAY',due_date='$TODAY',time_start='$HHMMnow',time_end='$HHMMend',sendnotification='0',duration_hours='0',duration_minutes='1',status='',eventstatus='Held',priority='Medium',location='VICIDIAL User $user',notime='0',visibility='Public',recurringtype='--None--';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # http://mysite.com/vtigercrm/index.php?module=Calendar&action=EditView&return_module=Accounts&return_action=DetailView&record=16&activity_mode=Events&return_id=9&parenttab=Sales + $account_URL = "$vtiger_url/index.php?module=Calendar&action=EditView&return_module=Accounts&return_action=DetailView&record=$activityid&activity_mode=Events&return_id=$vendor_id&parenttab=Sales"; + } + else + { + # http://mysite.com/vtigercrm/index.php?module=Accounts&action=DetailView&record=2&parenttab=Sales + $account_URL = "$vtiger_url/index.php?module=Accounts&action=DetailView&record=$vendor_id&parenttab=Sales"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + + echo "
";
+			echo "account found! ACCTID\n";
+			echo "accountid:   $vendor_id\n";
+			echo "

"; + exit; + } + } + } +########################################################################## +##### END - ACCTID - Search in the account records for accountid number +########################################################################## + + +########################################################################## +##### BEGIN - ACCOUNT - Search in the account records for phone number +########################################################################## +if ($account_search > 0) + { + $stmt="SELECT count(*) from vtiger_account where phone='$phone' or otherphone='$phone' or fax='$phone';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + if ($DB) {echo "
\nACCOUNT|$phone|$found_count|vtiger_account\n";} + + if ($found_count < 1) + { + echo "\n"; + + $stmt="SELECT count(*) from vtiger_contactdetails where phone='$phone' or mobile='$phone' or fax='$phone';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + if ($DB) {echo "
\nACCOUNT|$phone|$found_count|vtiger_contactdetails\n";} + + if ($found_count < 1) + { + echo "\n"; + + $stmt="SELECT count(*) from vtiger_contactsubdetails where homephone='$phone' or otherphone='$phone' or assistantphone='$phone';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + if ($DB) {echo "
\nACCOUNT|$phone|$found_count|vtiger_contactsubdetails\n";} + + if ($found_count < 1) + { + echo "\n"; + } + else + { + # find vtiger_contact + $stmt="SELECT contactsubscriptionid from vtiger_contactsubdetails where homephone='$phone' or otherphone='$phone' or assistantphone='$phone';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $contactid = $row[0]; + + # find vtiger_account + $stmt="SELECT accountid from vtiger_contactdetails where contactid='$contactid';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $accountid = $row[0]; + } + } + else + { + # find vtiger_account + $stmt="SELECT accountid from vtiger_contactdetails where phone='$phone' or mobile='$phone' or fax='$phone';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $accountid = $row[0]; + } + } + else + { + # find vtiger_account + $stmt="SELECT accountid from vtiger_account where phone='$phone' or otherphone='$phone' or fax='$phone';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $accountid = $row[0]; + } + if (strlen($accountid) > 0) + { + $stmt="SELECT count(*) from vtiger_crmentity where crmid='$accountid' and deleted='1';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $deleted_count = $row[0]; + if ( ($deleted_count > 0) and (ereg('DISABLED',$vtiger_search_dead)) ) + { + echo "\n"; + } + else + { + if ( ($deleted_count > 0) and ( (ereg('RESURRECT',$vtiger_search_dead)) or (ereg('ASK',$vtiger_search_dead)) ) ) + { + # un-delete the record + $stmt="UPDATE vtiger_crmentity SET deleted='0' where crmid='$accountid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + echo "\n"; + } + if (ereg('Y',$vtiger_create_call_record)) + { + ### Log the call in Vtiger + + #Get logged in user ID + $stmt="SELECT id from vtiger_users where user_name='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $user_id = $row[0]; + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Get next aviable id from vtiger_crmentity_seq to use as activityid in vtiger_crmentity + $stmt="SELECT id from vtiger_crmentity_seq ;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $activityid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next aviable crmid with 1 so next record gets proper id + $stmt="UPDATE vtiger_crmentity_seq SET id = '$activityid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_salesmanactivityrel + $stmt = "INSERT INTO vtiger_salesmanactivityrel SET smid='$user_id',activityid='$activityid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_seactivityrel + $stmt = "INSERT INTO vtiger_seactivityrel SET crmid='$accountid',activityid='$activityid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_crmentity + $stmt = "INSERT INTO vtiger_crmentity (crmid, smcreatorid, smownerid, modifiedby, setype, description, createdtime, modifiedtime, viewedtime, status, version, presence, deleted) VALUES ('$activityid', '$user_id', '$user_id','$user_id', 'Calendar', 'VICIDIAL Call user $user', '$NOW_TIME', '$NOW_TIME', '$NOW_TIME', NULL, '0', '1', '0');"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_activity + $stmt = "INSERT INTO vtiger_activity SET activityid='$activityid',subject='VICIDIAL Account call $phone',activitytype='Call',date_start='$TODAY',due_date='$TODAY',time_start='$HHMMnow',time_end='$HHMMend',sendnotification='0',duration_hours='0',duration_minutes='1',status='',eventstatus='Held',priority='Medium',location='VICIDIAL User $user',notime='0',visibility='Public',recurringtype='--None--';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # http://mysite.com/vtigercrm/index.php?module=Calendar&action=EditView&return_module=Accounts&return_action=DetailView&record=16&activity_mode=Events&return_id=9&parenttab=Sales + $account_URL = "$vtiger_url/index.php?module=Calendar&action=EditView&return_module=Accounts&return_action=DetailView&record=$activityid&activity_mode=Events&return_id=$accountid&parenttab=Sales"; + } + else + { + # http://mysite.com/vtigercrm/index.php?module=Accounts&action=DetailView&record=2&parenttab=Sales + $account_URL = "$vtiger_url/index.php?module=Accounts&action=DetailView&record=$accountid&parenttab=Sales"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + + echo "
";
+			echo "account found! ACCOUNT\n";
+			echo "accountid:   $accountid\n";
+			echo "phone:       $phone\n";
+			echo "

"; + exit; + } + } + } +########################################################################## +##### END - ACCOUNT - Search in the account records for phone number +########################################################################## + + +########################################################################## +##### BEGIN - VENDOR - Search in the vendor records for phone number +########################################################################## +if ($vendor_search > 0) + { + $stmt="SELECT count(*) from vtiger_vendor where phone='$phone';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + if ($DB) {echo "
\nVENDOR|$phone|$found_count|\n";} + + if ($found_count < 1) + { + echo "\n"; + } + else + { + # find vtiger_vendor + $stmt="SELECT vendorid from vtiger_vendor where phone='$phone';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $vendorid = $row[0]; + + # http://mysite.com/vtigercrm/index.php?module=Vendors&action=DetailView&record=2&parenttab=Inventory + $account_URL = "$vtiger_url/index.php?module=Vendors&action=DetailView&record=$vendorid&parenttab=Inventory"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + + echo "
";
+		echo "account found! VENDOR\n";
+		echo "vendorid:   $vendorid\n";
+		echo "phone:       $phone\n";
+		echo "

"; + exit; + } + } +########################################################################## +##### END - VENDOR - Search in the vendor records for phone number +########################################################################## + + +########################################################################## +##### BEGIN - LEAD - Search in the leads records for phone number +########################################################################## +if ($lead_search > 0) + { + $stmt="SELECT count(*) from vtiger_leadaddress where phone='$phone' or mobile='$phone' or fax='$phone';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + if ($DB) {echo "
\nLEAD|$phone|$found_count|\n";} + + if ($found_count < 1) + { + echo "\n"; + if (ereg('Y',$vtiger_create_lead_record)) + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo "$phone not found, creating account...\n"; + + $DB=1; + + #Get logged in user ID + if ($DB) {echo "
";}
+			$stmt="SELECT id from vtiger_users where user_name='$user';";
+			if ($DB) {echo "$stmt\n";}
+			$rslt=mysql_query($stmt, $linkV);
+			$row=mysql_fetch_row($rslt);
+			$user_id = $row[0];
+			if (!$rslt) {die('Could not execute: ' . mysql_error());}
+			
+			#Vtiger no longer use auto increment for vtiger_crmentity crmid, vtiger_crmentity_seq is used instead to list next aviable entity ID
+			# Get next aviable id to use as  crmid in vtiger_crmentity	
+			$stmt="SELECT id from vtiger_crmentity_seq ;";
+			if ($DB) {echo "$stmt\n";}
+			$rslt=mysql_query($stmt, $linkV);
+			$row=mysql_fetch_row($rslt);
+			$leadid = ($row[0] + 1);
+			if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+			# Increase 	next aviable crmid with 1 so next record gets proper id
+			$stmt="UPDATE vtiger_crmentity_seq SET id = '$leadid';";
+			if ($DB) {echo "$stmt\n";}
+			$rslt=mysql_query($stmt, $linkV);
+			if (!$rslt) {die('Could not execute: ' . mysql_error());}
+			
+			#Insert values into vtiger_crmentity
+			$stmt = "INSERT INTO vtiger_crmentity (crmid, smcreatorid, smownerid, modifiedby, setype, description, createdtime, modifiedtime, viewedtime, status, version, presence, deleted) VALUES ('$leadid', '$user_id', '$user_id','$user_id', 'Leads', '(Memo)', '$NOW_TIME', '$NOW_TIME', '$NOW_TIME', NULL, '0', '1', '0');";
+			if ($DB) {echo "|$stmt|\n";}
+			$rslt=mysql_query($stmt, $linkV);
+			if ($DB) {echo "|$leadid|\n";}
+			if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+			#Insert values into vtiger_leaddetails	
+			$stmt = "INSERT INTO vtiger_leaddetails (leadid,firstname,lastname,company) values('$leadid','$first_name','$last_name','$first_name $last_name');";
+			if ($DB) {echo "|$stmt|\n";}
+			$rslt=mysql_query($stmt, $linkV);
+			if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+			#Insert values into vtiger_leaddetails
+			$stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$province','$country','$phone','$alt_phone','$address1 $address2');";
+			if ($DB) {echo "|$stmt|\n";}
+			$rslt=mysql_query($stmt, $linkV);
+			if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+			#Insert values into vtiger_leadsubdetails	
+			$stmt = "INSERT INTO vtiger_leadsubdetails (leadsubscriptionid) VALUES ('$leadid');";
+			if ($DB) {echo "|$stmt|\n";}
+			$rslt=mysql_query($stmt, $linkV);
+			if (!$rslt) {die('Could not execute: ' . mysql_error());}
+			
+			#Insert values into vtiger_leadscf, these are custom created fields example	
+			$stmt = "INSERT INTO vtiger_leadscf (leadid) VALUES ('$leadid');";
+			if ($DB) {echo "|$stmt|\n";}
+			$rslt=mysql_query($stmt, $linkV);
+			if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+			if ($DB) {echo "DONE creating lead records\n";}
+
+			if (ereg('Y',$vtiger_create_call_record))
+				{
+				### Log the call in Vtiger
+
+				#Get logged in user ID
+				$stmt="SELECT id from vtiger_users where user_name='$user';";
+				if ($DB) {echo "$stmt\n";}
+				$rslt=mysql_query($stmt, $linkV);
+				$row=mysql_fetch_row($rslt);
+				$user_id = $row[0];
+				if (!$rslt) {die('Could not execute: ' . mysql_error());}
+				
+				# Get next aviable id from vtiger_crmentity_seq to use as activityid in vtiger_crmentity	
+				$stmt="SELECT id from vtiger_crmentity_seq ;";
+				if ($DB) {echo "$stmt\n";}
+				$rslt=mysql_query($stmt, $linkV);
+				$row=mysql_fetch_row($rslt);
+				$activityid = ($row[0] + 1);
+				if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+				# Increase next aviable crmid with 1 so next record gets proper id
+				$stmt="UPDATE vtiger_crmentity_seq SET id = '$activityid';";
+				if ($DB) {echo "$stmt\n";}
+				$rslt=mysql_query($stmt, $linkV);
+				if (!$rslt) {die('Could not execute: ' . mysql_error());}
+				
+				#Insert values into vtiger_salesmanactivityrel
+				$stmt = "INSERT INTO vtiger_salesmanactivityrel SET smid='$user_id',activityid='$activityid';";
+				if ($DB) {echo "|$stmt|\n";}
+				$rslt=mysql_query($stmt, $linkV);
+				if ($DB) {echo "|$leadid|\n";}
+				if (!$rslt) {die('Could not execute: ' . mysql_error());}
+				
+				#Insert values into vtiger_seactivityrel
+				$stmt = "INSERT INTO vtiger_seactivityrel SET crmid='$leadid',activityid='$activityid';";
+				if ($DB) {echo "|$stmt|\n";}
+				$rslt=mysql_query($stmt, $linkV);
+				if ($DB) {echo "|$leadid|\n";}
+				if (!$rslt) {die('Could not execute: ' . mysql_error());}
+				
+				#Insert values into vtiger_crmentity
+				$stmt = "INSERT INTO vtiger_crmentity (crmid, smcreatorid, smownerid, modifiedby, setype, description, createdtime, modifiedtime, viewedtime, status, version, presence, deleted) VALUES ('$activityid', '$user_id', '$user_id','$user_id', 'Calendar', 'VICIDIAL Call user $user', '$NOW_TIME', '$NOW_TIME', '$NOW_TIME', NULL, '0', '1', '0');";
+				if ($DB) {echo "|$stmt|\n";}
+				$rslt=mysql_query($stmt, $linkV);
+				if ($DB) {echo "|$leadid|\n";}
+				if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+				#Insert values into vtiger_activity
+				$stmt = "INSERT INTO vtiger_activity SET activityid='$activityid',subject='VICIDIAL Lead call $phone',activitytype='Call',date_start='$TODAY',due_date='$TODAY',time_start='$HHMMnow',time_end='$HHMMend',sendnotification='0',duration_hours='0',duration_minutes='1',status='',eventstatus='Held',priority='Medium',location='VICIDIAL user $user',notime='0',visibility='Public',recurringtype='--None--';";
+				if ($DB) {echo "|$stmt|\n";}
+				$rslt=mysql_query($stmt, $linkV);
+				if ($DB) {echo "|$leadid|\n";}
+				if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+
+				# http://mysite.com/vtigercrm/index.php?module=Calendar&action=EditView&return_module=Accounts&return_action=DetailView&record=16&activity_mode=Events&return_id=9&parenttab=Sales
+				$account_URL = "$vtiger_url/index.php?module=Calendar&action=EditView&return_module=Leads&return_action=DetailView&record=$activityid&activity_mode=Events&return_id=$leadid&parenttab=Sales";
+				}
+			else
+				{
+				# http://mysite.com/vtigercrm/index.php?module=Accounts&action=EditView&record=2&parenttab=Sales
+				$account_URL = "$vtiger_url/index.php?module=Leads&action=EditView&record=$leadid&parenttab=Sales";
+				}
+
+			echo "\n";
+			echo "\n";
+			echo "\n";
+			echo "
\n"; + + echo "
";
+			echo "account created! LEAD\n";
+			echo "leadid:   $leadid\n";
+			echo "phone:       $phone\n";
+			echo "

"; + exit; + } + } + else + { + $stmt="SELECT leadaddressid from vtiger_leadaddress where phone='$phone' or mobile='$phone' or fax='$phone';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $leadid = $row[0]; + + $stmt="SELECT count(*) from vtiger_crmentity where crmid='$leadid' and deleted='1';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $deleted_count = $row[0]; + if ( ($deleted_count > 0) and (ereg('DISABLED',$vtiger_search_dead)) ) + { + echo "\n"; + } + else + { + if ( ($deleted_count > 0) and ( (ereg('RESURRECT',$vtiger_search_dead)) or (ereg('ASK',$vtiger_search_dead)) ) ) + { + # un-delete the record + $stmt="UPDATE vtiger_crmentity SET deleted='0' where crmid='$leadid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + echo "\n"; + } + + if (ereg('Y',$vtiger_create_call_record)) + { + ### Log the call in Vtiger + + #Get logged in user ID + $stmt="SELECT id from vtiger_users where user_name='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $user_id = $row[0]; + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Get next aviable id from vtiger_crmentity_seq to use as activityid in vtiger_crmentity + $stmt="SELECT id from vtiger_crmentity_seq ;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $activityid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + # Increase next aviable crmid with 1 so next record gets proper id + $stmt="UPDATE vtiger_crmentity_seq SET id = '$activityid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_salesmanactivityrel + $stmt = "INSERT INTO vtiger_salesmanactivityrel SET smid='$user_id',activityid='$activityid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_seactivityrel + $stmt = "INSERT INTO vtiger_seactivityrel SET crmid='$leadid',activityid='$activityid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_crmentity + $stmt = "INSERT INTO vtiger_crmentity (crmid, smcreatorid, smownerid, modifiedby, setype, description, createdtime, modifiedtime, viewedtime, status, version, presence, deleted) VALUES ('$activityid', '$user_id', '$user_id','$user_id', 'Calendar', 'VICIDIAL Call user $user', '$NOW_TIME', '$NOW_TIME', '$NOW_TIME', NULL, '0', '1', '0');"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + #Insert values into vtiger_activity + $stmt = "INSERT INTO vtiger_activity SET activityid='$activityid',subject='VICIDIAL Lead call $phone',activitytype='Call',date_start='$TODAY',due_date='$TODAY',time_start='$HHMMnow',time_end='$HHMMend',sendnotification='0',duration_hours='0',duration_minutes='1',status='',eventstatus='Held',priority='Medium',location='VICIDIAL user $user',notime='0',visibility='Public',recurringtype='--None--';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "|$leadid|\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + + # http://mysite.com/vtigercrm/index.php?module=Calendar&action=EditView&return_module=Accounts&return_action=DetailView&record=16&activity_mode=Events&return_id=9&parenttab=Sales + $account_URL = "$vtiger_url/index.php?module=Calendar&action=EditView&return_module=Leads&return_action=DetailView&record=$activityid&activity_mode=Events&return_id=$leadid&parenttab=Sales"; + } + else + { + # http://mysite.com/vtigercrm/index.php?module=Accounts&action=DetailView&record=2&parenttab=Sales + $account_URL = "$vtiger_url/index.php?module=Leads&action=DetailView&record=$leadid&parenttab=Sales"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + + echo "
";
+			echo "lead found! LEAD\n";
+			echo "leadid:   $leadid\n";
+			echo "phone:       $phone\n";
+			echo "

"; + exit; + } + } + } +########################################################################## +##### END - LEAD - Search in the leads records for phone number +########################################################################## + + + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "\n\n\n
$phone NOT FOUND

\n\n"; +echo "Click here to go to the Vtiger home page\n"; + +# echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; + + +?> + + + + + + + + + + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vtiger_user.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vtiger_user.php new file mode 100644 index 00000000..f53a989a --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/vtiger_user.php @@ -0,0 +1,317 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 81231-1307 - First build +# 90228-2152 - Added Groups support +# 90508-0644 - Changed to PHP long tags +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; + + +#$DB = '1'; # DEBUG override +$US = '_'; +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$REC_TIME = date("Ymd-His"); +$FILE_datetime = $STARTtime; +$parked_time = $STARTtime; + +############################################################### +##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### +$stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$ss_conf_ct = mysql_num_rows($rslt); +if ($ss_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_vtiger_integration = $row[0]; + $vtiger_server_ip = $row[1]; + $vtiger_dbname = $row[2]; + $vtiger_login = $row[3]; + $vtiger_pass = $row[4]; + $vtiger_url = $row[5]; + } +##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP ##### +############################################################# + +echo "\n"; +echo "\n"; +echo "VICIDIAL Vtiger user synchronization utility\n"; +echo "\n"; + +if ($enable_vtiger_integration < 1) + { + echo "ERROR! - Vtiger integration is disabled in the VICIDIAL system_settings"; + exit; + } + +##### grab the existing user_groups in the vicidial_user_groups table +$stmt="SELECT user_group,group_name FROM vicidial_user_groups;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$VD_groups_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $VD_groups_ct) + { + $row=mysql_fetch_row($rslt); + $UGid[$i] = $row[0]; + $UGname[$i] = $row[1]; + $i++; + } + +##### grab the existing users in the vicidial_users table +$stmt="SELECT user,pass,full_name,user_level,active,user_group FROM vicidial_users;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$VD_users_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $VD_users_ct) + { + $row=mysql_fetch_row($rslt); + $user[$i] = $row[0]; + $pass[$i] = $row[1]; + $full_name[$i] = $row[2]; while (strlen($full_name[$i])>30) {$full_name[$i] = eregi_replace(".$",'',$full_name[$i]);} + $user_level[$i] = $row[3]; + $active[$i] = $row[4]; + $user_group[$i] = $row[5]; + $i++; + } + + +### connect to your vtiger database +$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass"); +if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());} +echo "Connected successfully\n
\n"; +mysql_select_db("$vtiger_dbname", $linkV); + + +########################## +### BEGIN Group export +$i=0; +while ($i < $VD_groups_ct) + { + $VTgroup_name = $UGid[$i]; + $VTgroup_description = $UGname[$i]; + + $stmt="SELECT count(*) from vtiger_groups where groupname='$VTgroup_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $group_found_count = $row[0]; + + ### group exists in vtiger, grab groupid, update description + if ($group_found_count > 0) + { + $stmt="SELECT groupid from vtiger_groups where groupname='$VTgroup_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $groupid = $row[0]; + $VTugID[$i] = $groupid; + + $stmtA = "UPDATE vtiger_groups SET description='$VTgroup_description' where groupid='$groupid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + echo "GROUP- $VTgroup_name: $groupid
\n"; + echo "
\n"; + } + + ### group doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW GROUP RECORD IN VTIGER + + # Get next available id from vtiger_users_seq to use as groupid + $stmt="SELECT id from vtiger_users_seq;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + $row=mysql_fetch_row($rslt); + $groupid = ($row[0] + 1); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $VTugID[$i] = $groupid; + + # Increase next available groupid with 1 so next record gets proper id + $stmt="UPDATE vtiger_users_seq SET id = '$groupid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$VTgroup_name',description='$VTgroup_description';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + echo "GROUP- $VTgroup_name: $groupid
\n"; + echo "
\n"; + #### END CREATE NEW GROUP RECORD IN VTIGER + } + $i++; + } +### END Group export +########################## + + + +########################## +### BEGIN User export +$i=0; +while ($i < $VD_users_ct) + { + $user_name = $user[$i]; + $VUgroup = $user_group[$i]; + $user_password = $pass[$i]; + $last_name = $full_name[$i]; + $is_admin = 'off'; + $roleid = 'H5'; + $status = 'Active'; + $groupid = '1'; + if ($user_level[$i] >= 7) {$roleid = 'H4';} + if ($user_level[$i] >= 8) {$roleid = 'H3';} + if ($user_level[$i] >= 9) {$roleid = 'H2';} + if ($user_level[$i] >= 9) {$is_admin = 'on';} + if (ereg('N',$active[$i])) {$status = 'Inactive';} + $salt = substr($user_name, 0, 2); + $salt = '$1$' . $salt . '$'; + $encrypted_password = crypt($user_password, $salt); + $i++; + + $j=0; + $all_VICIDIAL_groups_SQL=''; + while ($j < $VD_groups_ct) + { + if ( (eregi("$UGid[$j]",$VUgroup)) and ( (strlen($UGid[$j]))==(strlen($VUgroup)) ) ) + { + $groupid = $VTugID[$j]; + $VTgroup_name = $UGid[$j]; + $VTgroup_description = $UGname[$j]; + } + else + {$all_VICIDIAL_groups_SQL .= "'$VTugID[$j]',";} + $j++; + } + $all_VICIDIAL_groups_SQL = preg_replace("/.$/",'',$all_VICIDIAL_groups_SQL); + + $stmt="SELECT count(*) from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $found_count = $row[0]; + + ### user exists in vtiger, update it + if ($found_count > 0) + { + $stmt="SELECT id from vtiger_users where user_name='$user_name';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $userid = $row[0]; + + $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; + $rslt=mysql_query($stmt, $linkV); + if ($DB) {echo "$stmt\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $row=mysql_fetch_row($rslt); + $usergroupcount = $row[0]; + + $stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + if ($usergroupcount < 1) + { + $stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN($all_VICIDIAL_groups_SQL);"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + else + {$stmtC='';} + + echo "$user_name: $userid
\n"; + echo "$stmtA
\n"; + echo "$stmtB
\n"; + echo "$stmtC
\n"; + echo "$stmtD
\n"; + echo "
\n"; + + } + + ### user doesn't exist in vtiger, insert it + else + { + #### BEGIN CREATE NEW USER RECORD IN VTIGER + $stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';"; + if ($DB) {echo "|$stmtA|\n";} + $rslt=mysql_query($stmtA, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + $userid = mysql_insert_id($linkV); + + $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; + if ($DB) {echo "|$stmtB|\n";} + $rslt=mysql_query($stmtB, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; + if ($DB) {echo "|$stmtC|\n";} + $rslt=mysql_query($stmtC, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; + if ($DB) {echo "|$stmtD|\n";} + $rslt=mysql_query($stmtD, $linkV); + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + echo "$user_name:
\n"; + echo "$stmtA
\n"; + echo "$stmtB
\n"; + echo "$stmtC
\n"; + echo "$stmtD
\n"; + echo "
\n"; + #### END CREATE NEW USER RECORD IN VTIGER + } + + + } +### END User export +########################## + + + + + +echo "DONE\n"; + +exit; + + diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/welcome.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/welcome.php new file mode 100644 index 00000000..5eeba0ad --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/welcome.php @@ -0,0 +1,26 @@ + LICENSE: AGPLv2 +# + +echo "ViciDial Bem vindo\n"; +echo "\n"; +echo "\n"; +echo "




"; +echo ""; +echo ""; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
Bemvindo
 
Agent Login
 
Relógio Ponto
 
Administration
 
\n"; +echo "\n\n"; +echo "\n\n"; +echo "\n\n"; + +?> \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/welcome_demo.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/welcome_demo.php new file mode 100644 index 00000000..238cf5cf --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/welcome_demo.php @@ -0,0 +1,88 @@ + LICENSE: GPLv2 +# +header ("Content-type: text/html; charset=utf-8"); + +echo "ViciDial Welcome\n"; +echo "\n"; +echo "\n"; +echo "



"; +echo ""; +echo ""; +echo ""; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
Welcome! Bienvenue!   Willkommen! Benvenuto! Υποδοχή!
 
\n"; + +echo ""; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
"; +echo "   English Agent Login"; +echo "
"; +echo "   Spanish Agent Login"; +echo "
"; +echo "   German Agent Login"; +echo "
"; +echo "   Italian Agent Login"; +echo "
"; +echo "   Greek Agent Login"; +echo "
"; +echo "   French Agent Login"; +echo "
"; +echo "   Brazillian Portuguese Agent Login"; +echo "
"; +echo "   Portuguese Agent Login"; +echo "
"; +echo "   Polish Agent Login"; +echo "
"; +echo "   Slovak Agent Login"; +echo "
"; +echo "   Russian Agent Login"; +echo "
"; +echo "   Dutch Agent Login"; +echo "
"; +echo "   Chinese(T) Agent Login"; +echo "
\n"; + +echo "
\n"; + +echo ""; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
"; +echo "   English Administration"; +echo "
"; +echo "   Spanish Administration"; +echo "
"; +echo "   German Administration"; +echo "
"; +echo "   Italian Administration"; +echo "
"; +echo "   Greek Administration"; +echo "
"; +echo "   French Administration"; +echo "
\n"; +echo "
 
\n"; +echo "\n\n"; +echo "\n\n"; +echo "\n\n"; + +?> \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/welcome_languages.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/welcome_languages.php new file mode 100644 index 00000000..d53707a9 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_br/welcome_languages.php @@ -0,0 +1,88 @@ + LICENSE: GPLv2 +# +header ("Content-type: text/html; charset=utf-8"); + +echo "ViciDial Welcome\n"; +echo "\n"; +echo "\n"; +echo "



"; +echo ""; +echo ""; +echo ""; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
Welcome! Bienvenue!   Willkommen! Benvenuto! Υποδοχή!
 
\n"; + +echo ""; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
"; +echo "   English Agent Login"; +echo "
"; +echo "   Spanish Agent Login"; +echo "
"; +echo "   German Agent Login"; +echo "
"; +echo "   Italian Agent Login"; +echo "
"; +echo "   Greek Agent Login"; +echo "
"; +echo "   French Agent Login"; +echo "
"; +echo "   Brazillian Portuguese Agent Login"; +echo "
"; +echo "   Portuguese Agent Login"; +echo "
"; +echo "   Polish Agent Login"; +echo "
"; +echo "   Slovak Agent Login"; +echo "
"; +echo "   Russian Agent Login"; +echo "
"; +echo "   Dutch Agent Login"; +echo "
"; +echo "   Chinese(T) Agent Login"; +echo "
\n"; + +echo "
\n"; + +echo ""; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
"; +echo "   English Administration"; +echo "
"; +echo "   Spanish Administration"; +echo "
"; +echo "   German Administration"; +echo "
"; +echo "   Italian Administration"; +echo "
"; +echo "   Greek Administration"; +echo "
"; +echo "   French Administration"; +echo "
\n"; +echo "
 
\n"; +echo "\n\n"; +echo "\n\n"; +echo "\n\n"; + +?> \ No newline at end of file diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_days_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_days_detail.php index 86fad8b2..fa59d86d 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_days_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_days_detail.php @@ -273,12 +273,12 @@ else { echo "LEAD STATS BREAKDOWN:\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| DATE | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| DATE | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } ### BEGIN loop through each user ### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_performance_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_performance_detail.php index ab6e20ad..9f9d61c6 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_performance_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_performance_detail.php @@ -364,7 +364,7 @@ while ($i < $rows_to_print) echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | LEADS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_status_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_status_detail.php index 86487bf1..7fc8a5c2 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_status_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_status_detail.php @@ -319,14 +319,14 @@ else if ($file_download < 1) { - echo "LEADS STATS BREAKDOWN:\n"; + echo "CALLS STATS BREAKDOWN:\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_time_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_time_detail.php index 3f3edb50..bc97301f 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_time_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_time_detail.php @@ -421,12 +421,12 @@ else { echo "AGENT TIME BREAKDOWN:\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_timeclock_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_timeclock_detail.php index e8d0b8b8..e3d7b036 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_timeclock_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_agent_timeclock_detail.php @@ -145,6 +145,7 @@ if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { + $TCuser_group_SQL = $user_group_SQL; $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); @@ -636,7 +637,7 @@ else $o=0; while ($user_groups_to_print > $o) { - if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "\n";} + if (eregi("\|$user_groups[$o]\|",$user_group_string)) {echo "\n";} else {echo "\n";} $o++; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_timeonVDADall.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_timeonVDADall.php index f3cd3dd1..85cf7923 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_timeonVDADall.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/AST_timeonVDADall.php @@ -1166,10 +1166,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $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 $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($ALLcloser_campaignsSQL)"; + $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 $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; @@ -1596,7 +1594,7 @@ if ($campaign_allow_inbound > 0) $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $closer_campaignsSQL = "'$closer_campaigns'"; - } + } $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; } else @@ -1722,15 +1720,15 @@ if ($agentonlycount > 0) {$agentonlyheader = 'AGENTONLY';} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITY | $agentonlyheader\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITY | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { $Cstatus = sprintf("%-6s", $CDstatus[$p]); - $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); @@ -1755,7 +1753,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin.php index 053bfabf..bf175ad9 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin.php @@ -2047,11 +2047,12 @@ else # 100104-1454 - Fixed in-group/campaign copy duplication issue # 100116-0718 - Added presets to script select list # 100319-1708 - Changed user/pass for users to 20 characters in length, highlighted conf file secret in phones +# 100413-2328 - several small fixes, logging, removal of old SIP/IAX monitor/barge links # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.2.0-235'; -$build = '100319-1708'; +$admin_version = '2.2.0-236'; +$build = '100413-2328'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2584,6 +2585,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { + $stmt_grp_values=''; if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} if (isset($_GET["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_GET["WEB_$campaign_id_values[$o]"];} @@ -2598,15 +2600,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$campaign_rank = $SELECT_campaign_rank;} @@ -2769,15 +2774,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$group_rank = $SELECT_group_rank;} @@ -10466,7 +10474,7 @@ if ($ADD=="4A") $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmt_grp_values|"; $SQL_log = ereg_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='BENUTZER', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; @@ -22495,7 +22503,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

Klicken Sie hier, um zu sehen, Admin chages auf die System-Einstellungen
\n"; + echo "

Klicken Sie hier, um zu sehen, Admin chages auf die System-Einstellungen
\n"; } } else @@ -24388,73 +24396,81 @@ if ($ADD==710000000000000) if ($ADD==720000000000000) { - echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - echo "
Änderung der Registrierung ADMIN: Abschnitt Records - $category - $stage\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $logs_printed = ''; - $o=0; - while ($logs_to_print > $o) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDBESCHREIBUNGGOTO
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $logs_printed .= "'$row[0]',"; - $o++; + echo "
Änderung der Registrierung ADMIN: Abschnitt Records - $category - $stage\n"; + echo "
\n"; + echo ""; - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDBESCHREIBUNGGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


\n"; + echo "\n"; + echo "
\n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; } - echo "


\n"; - echo "\n"; - echo "
\n"; } @@ -24464,53 +24480,62 @@ if ($ADD==720000000000000) if ($ADD==730000000000000) { - echo ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + + echo "
Anrufinformationen: $first_name $last_name - $phone_number

\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - if ($logs_to_print > 0) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); - echo "
Änderung der Registrierung ADMIN: Record Detail - $stage

\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - $row[9] = eregi_replace("',","' ,",$row[9]); - echo ""; - echo ""; - echo "\n"; - echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; - echo "\n"; - echo "
\n"; + echo "\n"; } - ##### grab vicidial_log records ##### - $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - $call_log .= ""; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_agent_log records ##### - $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Alogs_to_print = mysql_num_rows($rslt); - - $y=0; - $agent_log = ''; - $Alog_campaign = ''; - while ($Alogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - - $campaign_id = $row[5]; - } - - ##### grab vicidial_closer_log records ##### - $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Clogs_to_print = mysql_num_rows($rslt); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $gmt_offset_now = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; - $address1 = "$row[16]"; - $address2 = "$row[17]"; - $address3 = "$row[18]"; - $city = "$row[19]"; - $state = "$row[20]"; - $province = "$row[21]"; - $postal_code = "$row[22]"; - $country_code = "$row[23]"; - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; - $email = "$row[27]"; - $security = "$row[28]"; - $comments = "$row[29]"; - $called_count = "$row[30]"; - $last_local_call_time = "$row[31]"; - $rank = "$row[32]"; - $owner = "$row[33]"; - - echo "
Anrufinformationen: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
Änderung der Registrierung ADMIN: Record Detail - $stage

\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + $row[9] = eregi_replace("',","' ,",$row[9]); + $row[9] = preg_replace("/\|/","
",$row[9]); + echo ""; + echo ""; + echo "\n"; + echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; + echo "\n"; + echo "
\n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; } } @@ -24568,8 +24593,8 @@ if ($ADD==999999) Real-Time Berichte

Inbound and Outbound Calling Berichte
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin_modify_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin_modify_lead.php index 6695a105..6cfa57d9 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin_modify_lead.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin_modify_lead.php @@ -8,7 +8,7 @@ # just needs to enter the leadID and then they can view and modify the # information in the record for that lead # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,7 @@ # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads # require("dbconnect.php"); @@ -366,271 +367,6 @@ else $alts_output .= "
$row[4]
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     Liste Identifikation: $list_id
Vorname:   \n"; - echo " Letzter Name:
  \n"; - echo "Postcode:
Main Phone :
Rank :
Owner :
(with $log_campaign statuses)
Ändernvicidial log
Ändernagent log
Änderncloser log
Add closer log record
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } } else { @@ -638,6 +374,272 @@ else # echo "Close this window\n

\n"; } + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $call_log .= "
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     Liste Identifikation: $list_id
Vorname:   \n"; + echo " Letzter Name:
  \n"; + echo "Postcode:
Main Phone :
Rank :
Owner :
(with $log_campaign statuses)
Ändernvicidial log
Ändernagent log
Änderncloser log
Add closer log record
\n"; + echo "


\n"; + + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); + + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UserID: \n"; + echo "

\n"; + } + else + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UserID: \n"; + echo "

\n"; + } + } + else + { + echo "
No Callback records found
\n"; + } + } echo "

\n"; @@ -692,6 +694,7 @@ else $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} $u=0; while ($logs_to_print > $u) diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin_search_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin_search_lead.php index e4761c5e..4623d3bc 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin_search_lead.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/admin_search_lead.php @@ -22,6 +22,7 @@ # 90917-2307 - Added alternate phone number searching option # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability # require("dbconnect.php"); @@ -39,6 +40,10 @@ if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -146,8 +151,9 @@ echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); echo "
\n"; -if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) { + ### Lead search echo "
\n"; echo "
\n"; echo "\n"; @@ -192,6 +198,27 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "
Letzter Name:  
 
Log Search Options:
Lead ID:  
 
Telefonnummer Dialed:  
 
\n"; echo "\n\n"; echo "\n"; @@ -200,6 +227,189 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and else { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no outbound calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
OUTBOUND LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#LEAD ID  PHONE  CAMPAIGN  CALLDATUM  STATUS  USER  LISTE IDENTIFIKATION  LENGTH  DIAL
$o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]
\n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no inbound calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
INBOUND LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#LEAD ID  PHONE  INGROUP  CALLDATUM  STATUS  USER  LISTE IDENTIFIKATION  LENGTH  
$o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]
\n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no inbound did calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
INBOUND DID LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#DID  PHONE  DID ID  CALLDATUM  
$o$row[0]$row[1]$row[2]$row[3]
\n"; + } + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n


\nNEUE SUCHE"; + + echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds"; + + echo "\n\n\n"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### if ($vendor_id) { $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; @@ -365,6 +575,7 @@ else if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } + ##### END Lead search ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/audio_store.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/audio_store.php index 4f8941ea..f3e0624e 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/audio_store.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_de/audio_store.php @@ -1,17 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # # CHANGES # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads # -$version = '2.2.0-2'; -$build = '90618-0640'; +$version = '2.2.0-3'; +$build = '100401-1037'; $MT[0]=''; @@ -191,8 +192,12 @@ if ($action == "LIST") # curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" if ($action == "AUTOUPLOAD") { - if ($audiofile) + if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -277,6 +282,10 @@ if ($action == "MANUALUPLOAD") { if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,6 +293,14 @@ if ($action == "MANUALUPLOAD") $stmt="UPDATE servers SET sounds_update='Y';"; $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } else { @@ -309,8 +326,18 @@ if ($action == "MANUALUPLOAD")
  Audio Store-     VERSION:     BUILD:    


-
We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) -

-audio file list
+
We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) +

All spaces will be stripped from uploaded audio file names

+audio file list
+ + + +




\n"; + +echo "


Click here to see a log of the uploads to the audio store
\n"; + +?>
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_days_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_days_detail.php index 033dd003..666e0f4f 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_days_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_days_detail.php @@ -273,12 +273,12 @@ else { echo "LEAD STATS BREAKDOWN:\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| DATE | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| DATE | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } ### BEGIN loop through each user ### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_performance_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_performance_detail.php index 10e5bc67..7736d9ff 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_performance_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_performance_detail.php @@ -364,7 +364,7 @@ while ($i < $rows_to_print) echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | LEADS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_status_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_status_detail.php index 9a1863c3..7cd304f6 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_status_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_status_detail.php @@ -319,14 +319,14 @@ else if ($file_download < 1) { - echo "LEADS STATS BREAKDOWN:\n"; + echo "CALLS STATS BREAKDOWN:\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_time_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_time_detail.php index 3f3edb50..bc97301f 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_time_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_time_detail.php @@ -421,12 +421,12 @@ else { echo "AGENT TIME BREAKDOWN:\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_timeclock_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_timeclock_detail.php index e8d0b8b8..e3d7b036 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_timeclock_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_agent_timeclock_detail.php @@ -145,6 +145,7 @@ if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { + $TCuser_group_SQL = $user_group_SQL; $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); @@ -636,7 +637,7 @@ else $o=0; while ($user_groups_to_print > $o) { - if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "\n";} + if (eregi("\|$user_groups[$o]\|",$user_group_string)) {echo "\n";} else {echo "\n";} $o++; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_timeonVDADall.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_timeonVDADall.php index 6ca72a90..4ef3c218 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_timeonVDADall.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/AST_timeonVDADall.php @@ -1166,10 +1166,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $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 $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($ALLcloser_campaignsSQL)"; + $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 $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; @@ -1596,7 +1594,7 @@ if ($campaign_allow_inbound > 0) $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $closer_campaignsSQL = "'$closer_campaigns'"; - } + } $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; } else @@ -1722,15 +1720,15 @@ if ($agentonlycount > 0) {$agentonlyheader = 'AGENTONLY';} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | ΠΡΟΤΕΡΑΙΟΤΗΤΑΣ | $agentonlyheader\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | ΠΡΟΤΕΡΑΙΟΤΗΤΑΣ | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { $Cstatus = sprintf("%-6s", $CDstatus[$p]); - $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); @@ -1755,7 +1753,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin.php index bc694e93..8dde86f7 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin.php @@ -2047,11 +2047,12 @@ else # 100104-1454 - Fixed in-group/campaign copy duplication issue # 100116-0718 - Added presets to script select list # 100319-1708 - Changed user/pass for users to 20 characters in length, highlighted conf file secret in phones +# 100413-2328 - several small fixes, logging, removal of old SIP/IAX monitor/barge links # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.2.0-235'; -$build = '100319-1708'; +$admin_version = '2.2.0-236'; +$build = '100413-2328'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2584,6 +2585,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { + $stmt_grp_values=''; if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} if (isset($_GET["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_GET["WEB_$campaign_id_values[$o]"];} @@ -2598,15 +2600,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$campaign_rank = $SELECT_campaign_rank;} @@ -2769,15 +2774,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$group_rank = $SELECT_group_rank;} @@ -10470,7 +10478,7 @@ if ($ADD=="4A") $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmt_grp_values|"; $SQL_log = ereg_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='ΧΡΗΣΤΕΣ', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; @@ -22513,7 +22521,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

Κάντε κλικ εδώ για να δείτε Admin chages για τις ρυθμίσεις του συστήματος
\n"; + echo "

Κάντε κλικ εδώ για να δείτε Admin chages για τις ρυθμίσεις του συστήματος\n"; } } else @@ -24406,73 +24414,81 @@ if ($ADD==710000000000000) if ($ADD==720000000000000) { - echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - echo "
ADMIN CHANGE LOG: Τμήμα Εγγραφές - $category - $stage\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $logs_printed = ''; - $o=0; - while ($logs_to_print > $o) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDΠΕΡΙΓΡΑΦΗGOTO
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $logs_printed .= "'$row[0]',"; - $o++; + echo "
ADMIN CHANGE LOG: Τμήμα Εγγραφές - $category - $stage\n"; + echo "
\n"; + echo ""; - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDΠΕΡΙΓΡΑΦΗGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


\n"; + echo "\n"; + echo "
\n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; } - echo "


\n"; - echo "\n"; - echo "\n"; } @@ -24482,53 +24498,62 @@ if ($ADD==720000000000000) if ($ADD==730000000000000) { - echo ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + + echo "
Πληροφορίες Κλήσης: $first_name $last_name - $phone_number

\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - if ($logs_to_print > 0) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); - echo "
ADMIN CHANGE LOG: Εγγραφή Λεπτομέρειες - $stage

\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - $row[9] = eregi_replace("',","' ,",$row[9]); - echo ""; - echo ""; - echo "\n"; - echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; - echo "\n"; - echo "
\n"; + echo "\n"; } - ##### grab vicidial_log records ##### - $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - $call_log .= ""; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_agent_log records ##### - $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Alogs_to_print = mysql_num_rows($rslt); - - $y=0; - $agent_log = ''; - $Alog_campaign = ''; - while ($Alogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - - $campaign_id = $row[5]; - } - - ##### grab vicidial_closer_log records ##### - $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Clogs_to_print = mysql_num_rows($rslt); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $gmt_offset_now = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; - $address1 = "$row[16]"; - $address2 = "$row[17]"; - $address3 = "$row[18]"; - $city = "$row[19]"; - $state = "$row[20]"; - $province = "$row[21]"; - $postal_code = "$row[22]"; - $country_code = "$row[23]"; - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; - $email = "$row[27]"; - $security = "$row[28]"; - $comments = "$row[29]"; - $called_count = "$row[30]"; - $last_local_call_time = "$row[31]"; - $rank = "$row[32]"; - $owner = "$row[33]"; - - echo "
Πληροφορίες Κλήσης: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
ADMIN CHANGE LOG: Εγγραφή Λεπτομέρειες - $stage

\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + $row[9] = eregi_replace("',","' ,",$row[9]); + $row[9] = preg_replace("/\|/","
",$row[9]); + echo ""; + echo ""; + echo "\n"; + echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; + echo "\n"; + echo "
\n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; } } @@ -24586,8 +24611,8 @@ if ($ADD==999999) Real-Time Εκθέσεις

Inbound and Outbound Calling Εκθέσεις
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin_modify_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin_modify_lead.php index 1d994118..d4e5a651 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin_modify_lead.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin_modify_lead.php @@ -8,7 +8,7 @@ # just needs to enter the leadID and then they can view and modify the # information in the record for that lead # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,7 @@ # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads # require("dbconnect.php"); @@ -366,271 +367,6 @@ else $alts_output .= "
$row[4]
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID Λίστας: $list_id
Ονομα:   \n"; - echo " Επίθετο:
Διεύθυνση 1 :
Διεύθυνση 2 :
Διεύθυνση 3 :
Πόλη :
Κράτος:   \n"; - echo "Ταχ.Κωδ.
Χώρα :
Main Phone :
Εναλ Τηλέφωνο :
Ασφάλεια :
Rank :
Owner :
Σχόλια :
Τερματισμός: (with $log_campaign statuses)
Modifyvicidial log
Modifyagent log
Modifycloser log
Add closer log record
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner ΧρήστηςID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner ΧρήστηςID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } } else { @@ -638,6 +374,272 @@ else # echo "Close this window\n

\n"; } + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $call_log .= "
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID Λίστας: $list_id
Ονομα:   \n"; + echo " Επίθετο:
Διεύθυνση 1 :
Διεύθυνση 2 :
Διεύθυνση 3 :
Πόλη :
Κράτος:   \n"; + echo "Ταχ.Κωδ.
Χώρα :
Main Phone :
Εναλ Τηλέφωνο :
Ασφάλεια :
Rank :
Owner :
Σχόλια :
Τερματισμός: (with $log_campaign statuses)
Modifyvicidial log
Modifyagent log
Modifycloser log
Add closer log record
\n"; + echo "


\n"; + + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); + + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner ΧρήστηςID: \n"; + echo "

\n"; + } + else + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner ΧρήστηςID: \n"; + echo "

\n"; + } + } + else + { + echo "
No Callback records found
\n"; + } + } echo "

\n"; @@ -692,6 +694,7 @@ else $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} $u=0; while ($logs_to_print > $u) diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin_search_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin_search_lead.php index 4f61257e..32811f16 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin_search_lead.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/admin_search_lead.php @@ -22,6 +22,7 @@ # 90917-2307 - Added alternate phone number searching option # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability # require("dbconnect.php"); @@ -39,6 +40,10 @@ if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} @@ -146,8 +151,9 @@ echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); echo "
\n"; -if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) { + ### Lead search echo "
\n"; echo "
\n"; echo "\n"; @@ -192,6 +198,27 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "
Επίθετο:  
 
Log Search Επιλογήs:
Lead ID:  
 
Τηλεφωνικός αριθμός Dialed:  
 
\n"; echo "\n\n"; echo "\n"; @@ -200,6 +227,189 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and else { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no outbound calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
ΕΞΕΡΧΟΜΕΝΟ LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#LEAD ID  PHONE  CAMPAIGN  CALL ΗΜΕΡΑ  ΚΑΤΑΣΤΑΣΗ  USER  ID ΛΙΣΤΑΣ  LENGTH  DIAL
$o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]
\n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no inbound calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
Εισερχόμενα LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#LEAD ID  PHONE  INGROUP  CALL ΗΜΕΡΑ  ΚΑΤΑΣΤΑΣΗ  USER  ID ΛΙΣΤΑΣ  LENGTH  
$o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]
\n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no inbound did calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
Εισερχόμενα DID LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#DID  PHONE  DID ID  CALL ΗΜΕΡΑ  
$o$row[0]$row[1]$row[2]$row[3]
\n"; + } + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n


\nΝΕΑ ΑΝΑΖΗΤΗΣΗ"; + + echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds"; + + echo "\n\n\n"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### if ($vendor_id) { $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; @@ -365,6 +575,7 @@ else if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } + ##### END Lead search ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/audio_store.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/audio_store.php index 4f8941ea..f3e0624e 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/audio_store.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_el/audio_store.php @@ -1,17 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # # CHANGES # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads # -$version = '2.2.0-2'; -$build = '90618-0640'; +$version = '2.2.0-3'; +$build = '100401-1037'; $MT[0]=''; @@ -191,8 +192,12 @@ if ($action == "LIST") # curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" if ($action == "AUTOUPLOAD") { - if ($audiofile) + if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -277,6 +282,10 @@ if ($action == "MANUALUPLOAD") { if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,6 +293,14 @@ if ($action == "MANUALUPLOAD") $stmt="UPDATE servers SET sounds_update='Y';"; $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } else { @@ -309,8 +326,18 @@ if ($action == "MANUALUPLOAD")
  Audio Store-     VERSION:     BUILD:    


-
We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) -

-audio file list
+
We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) +

All spaces will be stripped from uploaded audio file names

+audio file list
+ + + +




\n"; + +echo "


Click here to see a log of the uploads to the audio store
\n"; + +?>
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_days_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_days_detail.php index 72660085..54d817e1 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_days_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_days_detail.php @@ -273,12 +273,12 @@ else { echo "LEAD STATS BREAKDOWN:\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| DATE | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| DATE | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } ### BEGIN loop through each user ### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_performance_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_performance_detail.php index 360706b7..c82f4868 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_performance_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_performance_detail.php @@ -364,7 +364,7 @@ while ($i < $rows_to_print) echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | LEADS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_status_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_status_detail.php index 7ab5636e..9ba7fba5 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_status_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_status_detail.php @@ -319,14 +319,14 @@ else if ($file_download < 1) { - echo "LEADS STATS BREAKDOWN:\n"; + echo "CALLS STATS BREAKDOWN:\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_time_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_time_detail.php index 3f3edb50..bc97301f 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_time_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_time_detail.php @@ -421,12 +421,12 @@ else { echo "AGENT TIME BREAKDOWN:\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_timeclock_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_timeclock_detail.php index e8d0b8b8..e3d7b036 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_timeclock_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_agent_timeclock_detail.php @@ -145,6 +145,7 @@ if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { + $TCuser_group_SQL = $user_group_SQL; $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); @@ -636,7 +637,7 @@ else $o=0; while ($user_groups_to_print > $o) { - if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "\n";} + if (eregi("\|$user_groups[$o]\|",$user_group_string)) {echo "\n";} else {echo "\n";} $o++; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_timeonVDADall.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_timeonVDADall.php index 72a4dc4a..ae62c381 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_timeonVDADall.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/AST_timeonVDADall.php @@ -1166,10 +1166,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $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 $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($ALLcloser_campaignsSQL)"; + $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 $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; @@ -1596,7 +1594,7 @@ if ($campaign_allow_inbound > 0) $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $closer_campaignsSQL = "'$closer_campaigns'"; - } + } $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; } else @@ -1722,15 +1720,15 @@ if ($agentonlycount > 0) {$agentonlyheader = 'AGENTONLY';} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORIDAD | $agentonlyheader\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORIDAD | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { $Cstatus = sprintf("%-6s", $CDstatus[$p]); - $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); @@ -1755,7 +1753,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin.php index 3f91495f..632a9129 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin.php @@ -2047,11 +2047,12 @@ else # 100104-1454 - Fixed in-group/campaign copy duplication issue # 100116-0718 - Added presets to script select list # 100319-1708 - Changed user/pass for users to 20 characters in length, highlighted conf file secret in phones +# 100413-2328 - several small fixes, logging, removal of old SIP/IAX monitor/barge links # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.2.0-235'; -$build = '100319-1708'; +$admin_version = '2.2.0-236'; +$build = '100413-2328'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2584,6 +2585,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { + $stmt_grp_values=''; if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} if (isset($_GET["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_GET["WEB_$campaign_id_values[$o]"];} @@ -2598,15 +2600,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$campaign_rank = $SELECT_campaign_rank;} @@ -2769,15 +2774,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$group_rank = $SELECT_group_rank;} @@ -10466,7 +10474,7 @@ if ($ADD=="4A") $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmt_grp_values|"; $SQL_log = ereg_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='USUARIOS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; @@ -22495,7 +22503,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

Haga clic aquí para ver chages a la administración de la configuración del sistema
\n"; + echo "

Haga clic aquí para ver chages a la administración de la configuración del sistema
\n"; } } else @@ -24388,73 +24396,81 @@ if ($ADD==710000000000000) if ($ADD==720000000000000) { - echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - echo "
ADMIN Change Log: Sección de Documentos - $category - $stage\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $logs_printed = ''; - $o=0; - while ($logs_to_print > $o) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIPCIÓNGOTO
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $logs_printed .= "'$row[0]',"; - $o++; + echo "
ADMIN Change Log: Sección de Documentos - $category - $stage\n"; + echo "
\n"; + echo ""; - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIPCIÓNGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


\n"; + echo "\n"; + echo "
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; } - echo "


\n"; - echo "\n"; - echo "
\n"; } @@ -24464,53 +24480,62 @@ if ($ADD==720000000000000) if ($ADD==730000000000000) { - echo ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + + echo "
Información de la llamada: $first_name $last_name - $phone_number

\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - if ($logs_to_print > 0) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); - echo "
ADMIN Change Log: Detalle de registro - $stage

\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - $row[9] = eregi_replace("',","' ,",$row[9]); - echo ""; - echo ""; - echo "\n"; - echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; - echo "\n"; - echo "
\n"; + echo "\n"; } - ##### grab vicidial_log records ##### - $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - $call_log .= ""; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_agent_log records ##### - $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Alogs_to_print = mysql_num_rows($rslt); - - $y=0; - $agent_log = ''; - $Alog_campaign = ''; - while ($Alogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - - $campaign_id = $row[5]; - } - - ##### grab vicidial_closer_log records ##### - $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Clogs_to_print = mysql_num_rows($rslt); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $gmt_offset_now = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; - $address1 = "$row[16]"; - $address2 = "$row[17]"; - $address3 = "$row[18]"; - $city = "$row[19]"; - $state = "$row[20]"; - $province = "$row[21]"; - $postal_code = "$row[22]"; - $country_code = "$row[23]"; - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; - $email = "$row[27]"; - $security = "$row[28]"; - $comments = "$row[29]"; - $called_count = "$row[30]"; - $last_local_call_time = "$row[31]"; - $rank = "$row[32]"; - $owner = "$row[33]"; - - echo "
Información de la llamada: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
ADMIN Change Log: Detalle de registro - $stage

\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + $row[9] = eregi_replace("',","' ,",$row[9]); + $row[9] = preg_replace("/\|/","
",$row[9]); + echo ""; + echo ""; + echo "\n"; + echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; + echo "\n"; + echo "
\n"; + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; } } @@ -24568,8 +24593,8 @@ if ($ADD==999999) Tiempo Real Informes

Inbound and Outbound Calling Informes
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin_modify_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin_modify_lead.php index 2982acf0..d1877fe1 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin_modify_lead.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin_modify_lead.php @@ -8,7 +8,7 @@ # just needs to enter the leadID and then they can view and modify the # information in the record for that lead # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,7 @@ # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads # require("dbconnect.php"); @@ -366,271 +367,6 @@ else $alts_output .= "
$row[4]
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID De la Lista: $list_id
Nombre:   \n"; - echo " Apellidos:
Dirección 1 :
Dirección 2 :
Dirección 3 :
Ciudad :
Estado:   \n"; - echo " Código Postal:
Provincia:
País :
Main Phone :
Alt Phone :
Email :
Seguridad:
Rank :
Owner :
Comentarios :
Disposición: (with $log_campaign statuses)
Modificarvicidial log
Modificaragent log
Modificarcloser log
Add closer log record
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UsuarioID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UsuarioID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } } else { @@ -638,6 +374,272 @@ else # echo "Close this window\n

\n"; } + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $call_log .= "
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID De la Lista: $list_id
Nombre:   \n"; + echo " Apellidos:
Dirección 1 :
Dirección 2 :
Dirección 3 :
Ciudad :
Estado:   \n"; + echo " Código Postal:
Provincia:
País :
Main Phone :
Alt Phone :
Email :
Seguridad:
Rank :
Owner :
Comentarios :
Disposición: (with $log_campaign statuses)
Modificarvicidial log
Modificaragent log
Modificarcloser log
Add closer log record
\n"; + echo "


\n"; + + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); + + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UsuarioID: \n"; + echo "

\n"; + } + else + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UsuarioID: \n"; + echo "

\n"; + } + } + else + { + echo "
No Callback records found
\n"; + } + } echo "

\n"; @@ -692,6 +694,7 @@ else $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} $u=0; while ($logs_to_print > $u) diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin_search_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin_search_lead.php index c96c1982..a8f6875e 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin_search_lead.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/admin_search_lead.php @@ -22,6 +22,7 @@ # 90917-2307 - Added alternate phone number searching option # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability # require("dbconnect.php"); @@ -39,6 +40,10 @@ if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} @@ -146,8 +151,9 @@ echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); echo "
\n"; -if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) { + ### Lead search echo "
\n"; echo "
\n"; echo "\n"; @@ -192,6 +198,27 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "
Apellidos:  
 
Log Search Opcións:
Lead ID:  
 
Número De Teléfono Dialed:  
 
\n"; echo "\n\n"; echo "\n"; @@ -200,6 +227,189 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and else { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no outbound calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
SALIENTE LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#LEAD ID  PHONE  CAMPAIGN  CALL FECHA  ESTADO  USER  ID DE LA LISTA  LENGTH  DIAL
$o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]
\n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no inbound calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
Entrantes LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#LEAD ID  PHONE  INGROUP  CALL FECHA  ESTADO  USER  ID DE LA LISTA  LENGTH  
$o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]
\n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no inbound did calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
Entrantes DID LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#DID  PHONE  DID ID  CALL FECHA  
$o$row[0]$row[1]$row[2]$row[3]
\n"; + } + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n


\nNUEVA BÚSQUEDA"; + + echo "\n\n\n


\nScript runtime: $RUNtime seconds"; + + echo "\n\n\n"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### if ($vendor_id) { $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; @@ -365,6 +575,7 @@ else if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } + ##### END Lead search ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/audio_store.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/audio_store.php index 4f8941ea..f3e0624e 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/audio_store.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_es/audio_store.php @@ -1,17 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # # CHANGES # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads # -$version = '2.2.0-2'; -$build = '90618-0640'; +$version = '2.2.0-3'; +$build = '100401-1037'; $MT[0]=''; @@ -191,8 +192,12 @@ if ($action == "LIST") # curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" if ($action == "AUTOUPLOAD") { - if ($audiofile) + if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -277,6 +282,10 @@ if ($action == "MANUALUPLOAD") { if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,6 +293,14 @@ if ($action == "MANUALUPLOAD") $stmt="UPDATE servers SET sounds_update='Y';"; $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } else { @@ -309,8 +326,18 @@ if ($action == "MANUALUPLOAD")
  Audio Store-     VERSION:     BUILD:    


-
We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) -

-audio file list
+
We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) +

All spaces will be stripped from uploaded audio file names

+audio file list
+ + + +




\n"; + +echo "


Click here to see a log of the uploads to the audio store
\n"; + +?>
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_days_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_days_detail.php index 6453eb2f..127bd223 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_days_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_days_detail.php @@ -273,12 +273,12 @@ else { echo "LEAD STATS BREAKDOWN:\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| DATE | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| DATE | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } ### BEGIN loop through each user ### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_performance_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_performance_detail.php index 5635bb1d..ad519be8 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_performance_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_performance_detail.php @@ -364,7 +364,7 @@ while ($i < $rows_to_print) echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | LEADS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_status_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_status_detail.php index 23cbd084..98ea28ec 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_status_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_status_detail.php @@ -319,14 +319,14 @@ else if ($file_download < 1) { - echo "LEADS STATS BREAKDOWN:\n"; + echo "CALLS STATS BREAKDOWN:\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_time_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_time_detail.php index 3f3edb50..bc97301f 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_time_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_time_detail.php @@ -421,12 +421,12 @@ else { echo "AGENT TIME BREAKDOWN:\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_timeclock_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_timeclock_detail.php index e8d0b8b8..e3d7b036 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_timeclock_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_agent_timeclock_detail.php @@ -145,6 +145,7 @@ if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { + $TCuser_group_SQL = $user_group_SQL; $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); @@ -636,7 +637,7 @@ else $o=0; while ($user_groups_to_print > $o) { - if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "\n";} + if (eregi("\|$user_groups[$o]\|",$user_group_string)) {echo "\n";} else {echo "\n";} $o++; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_timeonVDADall.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_timeonVDADall.php index 5bf977e0..e8c30543 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_timeonVDADall.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/AST_timeonVDADall.php @@ -1166,10 +1166,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $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 $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($ALLcloser_campaignsSQL)"; + $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 $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; @@ -1596,7 +1594,7 @@ if ($campaign_allow_inbound > 0) $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $closer_campaignsSQL = "'$closer_campaigns'"; - } + } $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; } else @@ -1722,15 +1720,15 @@ if ($agentonlycount > 0) {$agentonlyheader = 'AGENTONLY';} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITÉ | $agentonlyheader\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITÉ | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { $Cstatus = sprintf("%-6s", $CDstatus[$p]); - $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); @@ -1755,7 +1753,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin.php index bcd0c095..a327ee00 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin.php @@ -2047,11 +2047,12 @@ else # 100104-1454 - Fixed in-group/campaign copy duplication issue # 100116-0718 - Added presets to script select list # 100319-1708 - Changed user/pass for users to 20 characters in length, highlighted conf file secret in phones +# 100413-2328 - several small fixes, logging, removal of old SIP/IAX monitor/barge links # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.2.0-235'; -$build = '100319-1708'; +$admin_version = '2.2.0-236'; +$build = '100413-2328'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2584,6 +2585,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { + $stmt_grp_values=''; if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} if (isset($_GET["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_GET["WEB_$campaign_id_values[$o]"];} @@ -2598,15 +2600,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$campaign_rank = $SELECT_campaign_rank;} @@ -2769,15 +2774,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$group_rank = $SELECT_group_rank;} @@ -10466,7 +10474,7 @@ if ($ADD=="4A") $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmt_grp_values|"; $SQL_log = ereg_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='UTILISATEURS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; @@ -22495,7 +22503,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

Cliquez ici pour voir Admin chages pour les réglages du système
\n"; + echo "

Cliquez ici pour voir Admin chages pour les réglages du système\n"; } } else @@ -24388,73 +24396,81 @@ if ($ADD==710000000000000) if ($ADD==720000000000000) { - echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - echo "
ADMIN CHANGE LOG: Section Records - $category - $stage\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $logs_printed = ''; - $o=0; - while ($logs_to_print > $o) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIPTIONGOTO
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $logs_printed .= "'$row[0]',"; - $o++; + echo "
ADMIN CHANGE LOG: Section Records - $category - $stage\n"; + echo "
\n"; + echo ""; - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIPTIONGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


\n"; + echo "\n"; + echo "
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; } - echo "


\n"; - echo "\n"; - echo "\n"; } @@ -24464,53 +24480,62 @@ if ($ADD==720000000000000) if ($ADD==730000000000000) { - echo ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + + echo "
Informations sur l'appel: $first_name $last_name - $phone_number

\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - if ($logs_to_print > 0) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); - echo "
ADMIN CHANGE LOG: Record Détail - $stage

\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - $row[9] = eregi_replace("',","' ,",$row[9]); - echo ""; - echo ""; - echo "\n"; - echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; - echo "\n"; - echo "
\n"; + echo "\n"; } - ##### grab vicidial_log records ##### - $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - $call_log .= ""; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_agent_log records ##### - $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Alogs_to_print = mysql_num_rows($rslt); - - $y=0; - $agent_log = ''; - $Alog_campaign = ''; - while ($Alogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - - $campaign_id = $row[5]; - } - - ##### grab vicidial_closer_log records ##### - $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Clogs_to_print = mysql_num_rows($rslt); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $gmt_offset_now = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; - $address1 = "$row[16]"; - $address2 = "$row[17]"; - $address3 = "$row[18]"; - $city = "$row[19]"; - $state = "$row[20]"; - $province = "$row[21]"; - $postal_code = "$row[22]"; - $country_code = "$row[23]"; - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; - $email = "$row[27]"; - $security = "$row[28]"; - $comments = "$row[29]"; - $called_count = "$row[30]"; - $last_local_call_time = "$row[31]"; - $rank = "$row[32]"; - $owner = "$row[33]"; - - echo "
Informations sur l'appel: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
ADMIN CHANGE LOG: Record Détail - $stage

\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + $row[9] = eregi_replace("',","' ,",$row[9]); + $row[9] = preg_replace("/\|/","
",$row[9]); + echo ""; + echo ""; + echo "\n"; + echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; + echo "\n"; + echo "
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; } } @@ -24568,8 +24593,8 @@ if ($ADD==999999) Real-Time Rapports

Inbound and Outbound Calling Rapports
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin_modify_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin_modify_lead.php index 89f23747..26a46755 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin_modify_lead.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin_modify_lead.php @@ -8,7 +8,7 @@ # just needs to enter the leadID and then they can view and modify the # information in the record for that lead # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,7 @@ # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads # require("dbconnect.php"); @@ -366,271 +367,6 @@ else $alts_output .= "
$row[4]
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID de la liste: $list_id
Nom:   \n"; - echo " Prénom:
Adresse1 :
Adresse2 :
Adresse3 :
Ville :
Etat:   \n"; - echo " Code postal:
Province:
Pays :
Main Phone :
Téléphone alternatif :
Email :
Sécurité:
Rank :
Owner :
Commentaires :
Disposition: (with $log_campaign statuses)
Modifiervicidial log
Modifieragent log
Modifiercloser log
Add closer log record
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UtilisateurID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UtilisateurID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } } else { @@ -638,6 +374,272 @@ else # echo "Close this window\n

\n"; } + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $call_log .= "
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID de la liste: $list_id
Nom:   \n"; + echo " Prénom:
Adresse1 :
Adresse2 :
Adresse3 :
Ville :
Etat:   \n"; + echo " Code postal:
Province:
Pays :
Main Phone :
Téléphone alternatif :
Email :
Sécurité:
Rank :
Owner :
Commentaires :
Disposition: (with $log_campaign statuses)
Modifiervicidial log
Modifieragent log
Modifiercloser log
Add closer log record
\n"; + echo "


\n"; + + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); + + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UtilisateurID: \n"; + echo "

\n"; + } + else + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UtilisateurID: \n"; + echo "

\n"; + } + } + else + { + echo "
No Callback records found
\n"; + } + } echo "

\n"; @@ -692,6 +694,7 @@ else $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} $u=0; while ($logs_to_print > $u) diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin_search_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin_search_lead.php index 3e88dfc2..099fc5f6 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin_search_lead.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/admin_search_lead.php @@ -22,6 +22,7 @@ # 90917-2307 - Added alternate phone number searching option # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability # require("dbconnect.php"); @@ -39,6 +40,10 @@ if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} @@ -146,8 +151,9 @@ echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); echo "
\n"; -if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) { + ### Lead search echo "
\n"; echo "
\n"; echo "\n"; @@ -192,6 +198,27 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "
Prénom:  
 
Log Search Options:
Lead ID:  
 
Numéro de téléphone Dialed:  
 
\n"; echo "\n\n"; echo "\n"; @@ -200,6 +227,189 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and else { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no outbound calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
SORTANT LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#LEAD ID  PHONE  CAMPAIGN  CALL DATE  ETAT  USER  ID DE LA LISTE  LENGTH  DIAL
$o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]
\n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no inbound calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
ENTRANT LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#LEAD ID  PHONE  INGROUP  CALL DATE  ETAT  USER  ID DE LA LISTE  LENGTH  
$o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]
\n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no inbound did calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
ENTRANT DID LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#DID  PHONE  DID ID  CALL DATE  
$o$row[0]$row[1]$row[2]$row[3]
\n"; + } + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n


\nNOUVELLE RECHERCHE"; + + echo "\n\n\n


\ntemps d'exécution du script: $RUNtime seconds"; + + echo "\n\n\n"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### if ($vendor_id) { $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; @@ -365,6 +575,7 @@ else if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } + ##### END Lead search ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/audio_store.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/audio_store.php index 4f8941ea..f3e0624e 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/audio_store.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_fr/audio_store.php @@ -1,17 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # # CHANGES # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads # -$version = '2.2.0-2'; -$build = '90618-0640'; +$version = '2.2.0-3'; +$build = '100401-1037'; $MT[0]=''; @@ -191,8 +192,12 @@ if ($action == "LIST") # curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" if ($action == "AUTOUPLOAD") { - if ($audiofile) + if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -277,6 +282,10 @@ if ($action == "MANUALUPLOAD") { if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,6 +293,14 @@ if ($action == "MANUALUPLOAD") $stmt="UPDATE servers SET sounds_update='Y';"; $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } else { @@ -309,8 +326,18 @@ if ($action == "MANUALUPLOAD")
  Audio Store-     VERSION:     BUILD:    


-
We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) -

-audio file list
+
We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) +

All spaces will be stripped from uploaded audio file names

+audio file list
+ + + +




\n"; + +echo "


Click here to see a log of the uploads to the audio store
\n"; + +?>
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_days_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_days_detail.php index cc0da452..12f28144 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_days_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_days_detail.php @@ -273,12 +273,12 @@ else { echo "LEAD STATS BREAKDOWN:\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| DATE | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| DATE | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } ### BEGIN loop through each user ### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_performance_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_performance_detail.php index 8acd9c53..62ad7c80 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_performance_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_performance_detail.php @@ -364,7 +364,7 @@ while ($i < $rows_to_print) echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | LEADS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_status_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_status_detail.php index 930baa93..1c14a0b0 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_status_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_status_detail.php @@ -319,14 +319,14 @@ else if ($file_download < 1) { - echo "LEADS STATS BREAKDOWN:\n"; + echo "CALLS STATS BREAKDOWN:\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_time_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_time_detail.php index 3f3edb50..bc97301f 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_time_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_time_detail.php @@ -421,12 +421,12 @@ else { echo "AGENT TIME BREAKDOWN:\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_timeclock_detail.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_timeclock_detail.php index e8d0b8b8..e3d7b036 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_timeclock_detail.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_agent_timeclock_detail.php @@ -145,6 +145,7 @@ if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { + $TCuser_group_SQL = $user_group_SQL; $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); @@ -636,7 +637,7 @@ else $o=0; while ($user_groups_to_print > $o) { - if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "\n";} + if (eregi("\|$user_groups[$o]\|",$user_group_string)) {echo "\n";} else {echo "\n";} $o++; } diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_timeonVDADall.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_timeonVDADall.php index 9167b749..dcb2272c 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_timeonVDADall.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/AST_timeonVDADall.php @@ -1166,10 +1166,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $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 $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($ALLcloser_campaignsSQL)"; + $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 $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; @@ -1596,7 +1594,7 @@ if ($campaign_allow_inbound > 0) $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $closer_campaignsSQL = "'$closer_campaigns'"; - } + } $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; } else @@ -1722,15 +1720,15 @@ if ($agentonlycount > 0) {$agentonlyheader = 'AGENTONLY';} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITY | $agentonlyheader\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITY | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { $Cstatus = sprintf("%-6s", $CDstatus[$p]); - $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); @@ -1755,7 +1753,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin.php index d9beda6e..c17e1df5 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin.php @@ -2047,11 +2047,12 @@ else # 100104-1454 - Fixed in-group/campaign copy duplication issue # 100116-0718 - Added presets to script select list # 100319-1708 - Changed user/pass for users to 20 characters in length, highlighted conf file secret in phones +# 100413-2328 - several small fixes, logging, removal of old SIP/IAX monitor/barge links # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.2.0-235'; -$build = '100319-1708'; +$admin_version = '2.2.0-236'; +$build = '100413-2328'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2584,6 +2585,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { + $stmt_grp_values=''; if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} if (isset($_GET["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_GET["WEB_$campaign_id_values[$o]"];} @@ -2598,15 +2600,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$campaign_rank = $SELECT_campaign_rank;} @@ -2769,15 +2774,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$group_rank = $SELECT_group_rank;} @@ -10466,7 +10474,7 @@ if ($ADD=="4A") $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmt_grp_values|"; $SQL_log = ereg_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='USERS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; @@ -22495,7 +22503,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

Clicca qui per visualizzare Admin chages per le impostazioni di sistema
\n"; + echo "

Clicca qui per visualizzare Admin chages per le impostazioni di sistema\n"; } } else @@ -24388,73 +24396,81 @@ if ($ADD==710000000000000) if ($ADD==720000000000000) { - echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - echo "
ADMIN Change Log: Sezione Records - $category - $stage\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $logs_printed = ''; - $o=0; - while ($logs_to_print > $o) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); + echo "
IDDATE TIMEUTENTEIPSECTIONTYPERECORD IDDESCRIZIONEGOTO
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $logs_printed .= "'$row[0]',"; - $o++; + echo "
ADMIN Change Log: Sezione Records - $category - $stage\n"; + echo "
\n"; + echo ""; - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} + if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} + if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} + if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} + if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} + if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} + if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} + if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
IDDATE TIMEUTENTEIPSECTIONTYPERECORD IDDESCRIZIONEGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


\n"; + echo "\n"; + echo "
\n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; } - echo "


\n"; - echo "\n"; - echo "\n"; } @@ -24464,53 +24480,62 @@ if ($ADD==720000000000000) if ($ADD==730000000000000) { - echo ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + + echo "
Informazioni Chiamata: $first_name $last_name - $phone_number

\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - if ($logs_to_print > 0) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); - echo "
ADMIN Change Log: Record Dettagliata - $stage

\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - $row[9] = eregi_replace("',","' ,",$row[9]); - echo ""; - echo ""; - echo "\n"; - echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIZIONE: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; - echo "\n"; - echo "
\n"; + echo "\n"; } - ##### grab vicidial_log records ##### - $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - $call_log .= ""; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_agent_log records ##### - $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Alogs_to_print = mysql_num_rows($rslt); - - $y=0; - $agent_log = ''; - $Alog_campaign = ''; - while ($Alogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - - $campaign_id = $row[5]; - } - - ##### grab vicidial_closer_log records ##### - $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Clogs_to_print = mysql_num_rows($rslt); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $gmt_offset_now = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; - $address1 = "$row[16]"; - $address2 = "$row[17]"; - $address3 = "$row[18]"; - $city = "$row[19]"; - $state = "$row[20]"; - $province = "$row[21]"; - $postal_code = "$row[22]"; - $country_code = "$row[23]"; - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; - $email = "$row[27]"; - $security = "$row[28]"; - $comments = "$row[29]"; - $called_count = "$row[30]"; - $last_local_call_time = "$row[31]"; - $rank = "$row[32]"; - $owner = "$row[33]"; - - echo "
Informazioni Chiamata: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
ADMIN Change Log: Record Dettagliata - $stage

\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + $row[9] = eregi_replace("',","' ,",$row[9]); + $row[9] = preg_replace("/\|/","
",$row[9]); + echo ""; + echo ""; + echo "\n"; + echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIZIONE: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; + echo "\n"; + echo "
\n"; + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; } } @@ -24568,8 +24593,8 @@ if ($ADD==999999) Real-Time Rapporti

Inbound and Outbound Calling Rapporti
diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin_modify_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin_modify_lead.php index ddb5baff..dbf5f0a3 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin_modify_lead.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin_modify_lead.php @@ -8,7 +8,7 @@ # just needs to enter the leadID and then they can view and modify the # information in the record for that lead # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,7 @@ # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads # require("dbconnect.php"); @@ -366,271 +367,6 @@ else $alts_output .= "
$row[4]
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID Lista: $list_id
Nome:   \n"; - echo " Cognome:
Indirizzo 1 :
Indirizzo 2 :
Indirizzo 3 :
Citta` :
Estado:   \n"; - echo " CAP:
Provincia :
Stato :
Main Phone :
Numero Alt :
Email :
Seguridad:
Rank :
Owner :
Note :
Esito: (with $log_campaign statuses)
Modificarevicidial log
Modificareagent log
Modificarecloser log
Add closer log record
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UtenteID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UtenteID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } } else { @@ -638,6 +374,272 @@ else # echo "Close this window\n

\n"; } + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $call_log .= "
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID Lista: $list_id
Nome:   \n"; + echo " Cognome:
Indirizzo 1 :
Indirizzo 2 :
Indirizzo 3 :
Citta` :
Estado:   \n"; + echo " CAP:
Provincia :
Stato :
Main Phone :
Numero Alt :
Email :
Seguridad:
Rank :
Owner :
Note :
Esito: (with $log_campaign statuses)
Modificarevicidial log
Modificareagent log
Modificarecloser log
Add closer log record
\n"; + echo "


\n"; + + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); + + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UtenteID: \n"; + echo "

\n"; + } + else + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UtenteID: \n"; + echo "

\n"; + } + } + else + { + echo "
No Callback records found
\n"; + } + } echo "

\n"; @@ -692,6 +694,7 @@ else $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} $u=0; while ($logs_to_print > $u) diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin_search_lead.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin_search_lead.php index 6e3cdc4a..9d91edf5 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin_search_lead.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/admin_search_lead.php @@ -22,6 +22,7 @@ # 90917-2307 - Added alternate phone number searching option # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability # require("dbconnect.php"); @@ -39,6 +40,10 @@ if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} @@ -146,8 +151,9 @@ echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); echo "
\n"; -if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) { + ### Lead search echo "
\n"; echo "
\n"; echo "\n"; @@ -192,6 +198,27 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "
Cognome:  
 
Log Search Opziones:
Lead ID:  
 
Numero di Telefono Dialed:  
 
\n"; echo "\n\n"; echo "\n"; @@ -200,6 +227,189 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and else { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no outbound calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
OUTBOUND LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#LEAD ID  PHONE  CAMPAGNA  CALL DATA  ESITO  UTENTE  ID LISTA  LENGTH  DIAL
$o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]
\n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no inbound calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
INBOUND LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#LEAD ID  PHONE  INGROUP  CALL DATA  ESITO  UTENTE  ID LISTA  LENGTH  
$o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]
\n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

\n"; + echo "There are no inbound did calls matching your search criteria

\n"; + echo "
\n"; + } + else + { + echo "
INBOUND DID LOG RESULTS: $results_to_print
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
#DID  PHONE  DID ID  CALL DATA  
$o$row[0]$row[1]$row[2]$row[3]
\n"; + } + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n


\nNUOVA RICERCA"; + + echo "\n\n\n


\nTempo Esecuzione Script: $RUNtime seconds"; + + echo "\n\n\n"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### if ($vendor_id) { $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; @@ -365,6 +575,7 @@ else if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } + ##### END Lead search ##### diff --git a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/audio_store.php b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/audio_store.php index 4f8941ea..f3e0624e 100644 --- a/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/audio_store.php +++ b/agc_2-X/branches/agc_2.2.0/LANG_www/vicidial_it/audio_store.php @@ -1,17 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # # CHANGES # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads # -$version = '2.2.0-2'; -$build = '90618-0640'; +$version = '2.2.0-3'; +$build = '100401-1037'; $MT[0]=''; @@ -191,8 +192,12 @@ if ($action == "LIST") # curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" if ($action == "AUTOUPLOAD") { - if ($audiofile) + if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -277,6 +282,10 @@ if ($action == "MANUALUPLOAD") { if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,6 +293,14 @@ if ($action == "MANUALUPLOAD") $stmt="UPDATE servers SET sounds_update='Y';"; $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } else { @@ -309,8 +326,18 @@ if ($action == "MANUALUPLOAD")
  Audio Store-     VERSION:     BUILD:    


-
We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) -

-audio file list
+
We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) +

All spaces will be stripped from uploaded audio file names

+audio file list
+ + + +




\n"; + +echo "


Click here to see a log of the uploads to the audio store
\n"; + +?>
diff --git a/agc_2-X/branches/agc_2.2.0/translations/br_language.txt b/agc_2-X/branches/agc_2.2.0/translations/br_language.txt index d47847a9..726ab452 100644 --- a/agc_2-X/branches/agc_2.2.0/translations/br_language.txt +++ b/agc_2-X/branches/agc_2.2.0/translations/br_language.txt @@ -101,12 +101,12 @@ You have now logged out. Thank you|Você fez o logoff. Obrigado| astGUIclient web-client VERSION|Versão do cliente web do astGUIClient| astGUIclient web client|astGUIclient web client| VICIDIAL web client|VICIDIAL web client| -VICIDIAL web-client version|VICIDIAL web-client version| -You can only monitor Zap channels|Você so pode monitorar os canais ZAP| -Stop Record|Pare a Gravação| -you are logged into this phone|Você está logado no telefone | +VICIDIAL web-client version|VICIDIAL web-client versão| +You can only monitor Zap channels|Você só pode monitorar os canais ZAP| +Stop Record|Parar Gravação| +you are logged into this phone|você está logado no ramal | Back to Main Window|Voltar a página principal| -LIVE CALLS ON THIS PHONE|CHAMADAS ATIVAS NESTE TELEFONE| +LIVE CALLS ON THIS PHONE|CHAMADAS ATIVAS NESTE RAMAL| LIVE CALLS IN THIS CONFERENCE|CHAMADAS ATIVAS NESTA CONFERÊNCIA| LIVE CALL TRANSFER|TRANSFERIR CHAMADAS ATIVAS| CLIENT CHANNEL|CANAL DO CLIENTE| @@ -126,11 +126,11 @@ Hangup Local|Desligar Local| Hijack Local|Capturar Local| Listen Local|Ouvir Local| Channel to be transferred|Canal a ser transferido| -Extensions Menu|Extensões do Menu| +Extensions Menu|Menu de Extensões| Send to selected extension|Enviar para a extensão selecionada| Send to selected vmail box|Enviar para a caixa postal selecionada| Send to this number|Envie para este número| -click on a number below to send to a conference|Clique no número abaixo para enviar a conferência| +click on a number below to send to a conference|clique no número abaixo para enviar a conferência| Send my channel too|Enviar meu canal para| Conferences Menu|Menu das conferências| LOCAL Extensions Dial|Discar a extensão local| @@ -140,7 +140,7 @@ Call selected vmail box|Ligar para a caixa postal selecionada| LOCAL DIAL EXTENSIONS|DISCAR A EXTENSÃO LOCAL| OUTBOUND CALLS|CHAMADAS SAINTES| INBOUND CALLS|CHAMADAS ENTRANTES| -Refresh rate|Atualizar a taxa| +Refresh rate|Taxa de Atualização| MANUAL DIAL|DISCAGEM MANUAL| CALL DATE\/TIME|DATA/HORA DA CHAMADA| LOCAL HANGUP|DESLIGAR LOCAL| @@ -148,11 +148,12 @@ PARKED CALLS|CHAMADAS EM ESPERA| PARKED BY|EM ESPERA POR| PARKED TIME|TEMPO EM ESPERA| Registered to|Registrado para| -Enter Conference|Entrar na conferência|Dial From Conf +Enter Conference|Entrar na conferência| +Dial From Conf|Discar da confêrencia| Active Extensions|Extensões Ativas| Outside Lines|Linhas externas| Local Extensions|Extensões Locais| -Data Goes Here|Data vai aqui| +Data Goes Here|Os Dados vão aqui| Trunk Action|Atividade do Tronco| Local Action|Atividade Local| Conferences List|Lista das conferências| @@ -167,7 +168,7 @@ is not valid|não é válido| or protocol|ou protocolo| Conf Extension Check|Verificação da Extensão de Conferência| has been registered to|já foi registrado para| -LIVE INBOUND CALL|CHAMADA ENTRANDO| +LIVE INBOUND CALL|CHAMADA ENTRANTE| Number Dialed|Número Discado| SEND TO MY VOICEMAIL|ENVIAR PARA MINHA CAIXA POSTAL| Live Extension Check|Verificação de extensões ativas| @@ -181,8 +182,8 @@ must be set|Deve ser definido| not sent|não enviado| Cannot find empty conference|Não foi possível achar uma conferência vazia| is not live|não está ativo| -RECORDING WILL LAST UP TO 60 MINUTES|AS GRAVAÇÕES VÃO DURAR 60 MINUTOS| -Parked Calls Display|Mostra as ligações em espera| +RECORDING WILL LAST UP TO 60 MINUTES|AS GRAVAÇÕES VÃO DURAR ATÉ 60 MINUTOS| +Parked Calls Display|Mostrar ligações em espera| Database Query Script|Script de consulta ao banco de dados| Group Choice|Escolha do Grupo| has been registered to user|foi registrado para o usuário| @@ -196,12 +197,12 @@ voicemail box|Caixa Postal| Re-Login|Re-Login| User Password|Senha do Usuário| User Login|Login do Usuário| -Phone Login|Login do Telefone| -Phone Password|Senha do Telefone| +Phone Login|Login do Ramal| +Phone Password|Senha do Ramal| Campaign not active, please try again|A campanha não está ativa, por favor tente novamente| Login incorrect, please try again|Usuário incorreto, por favor tente novamente| Campaign Login|Login da Campanha| -Sorry, your phone login and password are not active in this system, please try again|Desculpe seu login de telefone e senha não estão ativos nesta campanha, por favor tente novamente| +Sorry, your phone login and password are not active in this system, please try again|Desculpe seu login de ramal e senha não estão ativos nesta campanha, por favor tente novamente| leads left to call in hopper|Contatos restantes na lista de discagem| CAMPAIGN CUSTOM PARKING|ESPERA CUSTOMIZADA| CAMPAIGN DEFAULT PARKING|ESPERA PADRÃO| @@ -221,13 +222,13 @@ Sorry, there are no leads in the hopper for this campaign|Desculpe, não existem Dial Next Number|Discar proximo número| LIVE CALLS IN YOUR SESSION|LIGAÇÕES ATIVAS NA SUA SESSÃO| Stop Recording|Parar Gravação| -Start Recording|Inicia Gravação| +Start Recording|Iniciar Gravação| Transfer number must have more than 1 digit|O número a ser transferido deve ter mais de 1 digito| Grab Parked Call|Pegar ligãções em espera| Park Call|Colocar em espera| Waiting for Ring|Aguardando Atender| Called 3rd party|Ligou para o terceiro| -LEAVE 3-WAY CALL|ABANDONAR CHAMADA A TRES| +LEAVE 3-WAY CALL|ABANDONAR CHAMADA A TRÊS| Dial With Customer|Discar com o cliente| Park Customer Dial|Colocar chamada do cliente em espera| Hangup Xfer Line|Desligar linha Xfer| @@ -236,7 +237,7 @@ Hangup Customer|Desligar Cliente| Transfer - Conference|Transferir a conferência| LOCAL CLOSER|CLOSER LOCAL| INTERNAL CLOSER|CLOSER INTERNO| -Dial Blind Transfer|Transferência sem acompanhamento| +Dial Blind Transfer|Transferência sem consulta| Dial timed out, contact your system administrator|Tempo de discagem excedido, favor contactar o administrador| No more leads in the hopper for campaign|Não existem mais registros na fila de discagem dessa campanha| Web Form|Web Form| @@ -248,16 +249,16 @@ Wait 50 seconds for the dial to fail out if it is not answered|Aguarda 50 segund STILL A LIVE CALL! Hang it up then you can log out|VOCÊ ESTÁ EM UMA CHAMADA ATIVA! Desligue a chamada e você poderá sair do sistema| Hide conference call channel information|Ocultar informações de discagem do canal| Show conference call channel information|Mostrar informações de discagem do canal| -Logged in as User|Loggado como usuario| -Noone is in your session|Não existe ninguem na sua sessão| +Logged in as User|Logado como usuário| +Noone is in your session|Não existe ninguém na sua sessão| Customer has hung up|O cliente desligou| -End-of-call Disposition Selection|Fim da seleção de status| +End-of-call Disposition Selection|Seleção do Motivo de Finalização| CLOSER INBOUND GROUP SELECTION|SELECAO DO GRUPO DE ENTRADA DO CLOSER| Closer Inbound Group Selection|Seleção do grupo de entrada do closer| -BLENDED CALLING|LIGACAO MISTURADA| -outbound activated|ligações externas ativadas| +BLENDED CALLING|LIGAÇÃO MESCLADA| +outbound activated|ligações saintes ativadas| Preview the Lead then|Mostrar o contato, então| -Lead was not reverted, there was an error|O contato não pode ser revertido. Houve um erro.| +Lead was not reverted, there was an error|O contato não pode ser lido. Houve um erro.| call was not placed, there was an error|A ligação não foi efetuada. Houve um erro.| Number to call|Número a ser discado| Customer Information|Informações do cliente| @@ -265,15 +266,15 @@ Lead Dispositioned As|Status da ligação definida como| Any changes made to the customer information below at this time will not be comitted, You must change customer information before you Hangup the call|Qualquer alteração feita nesta página não será salva. Você deve mudar as informações do cliente antes de desligar a ligação| When active, simply press the keyboard key for the desired disposition for this call. The call will then be hungup and dispositioned automatically|Quanto ativo apenas pressione a tecla do teclado referente ao status desejado. A ligação será desligada e salva com o status definido automaticamemente| Disposition Hot Keys|Atalhos para os status| -Cust Time|Tempo de cliente| +Cust Time|Horário do cliente| RECORD ID|ID da gravação| -RECORDING FILE|GRAVANDO ARQUIVO| +RECORDING FILE|ARQUIVO DE GRAVAÇÃO| HOT KEYS ACTIVE|ATALHOS DE STATUS ATIVOS| HOT KEYS INACTIVE|ATALHOS DE STATUS INATIVOS| DIAL OVERRIDE|DISCAGEM SOBREPOSTA| -SKIP LEAD|IGNORAR CONTATO| -DIAL LEAD|DISCAR CONTATO| -LEAD PREVIEW|VISUALIZAR CONTATO| +SKIP LEAD|PULAR REGISTRO| +DIAL LEAD|DISCAR REGISTRO| +LEAD PREVIEW|VISUALIZAR REGISTRO| PAUSE AGENT DIALING|PAUSAR DISCAGEM DO AGENTE| DISPOSITION CALL|SELEÇÃO DE STATUS| session ID|ID da sessão| @@ -300,7 +301,7 @@ Note: a dial prefix of|Nota: prefixo de discagem de| Hangup Again|Desligue novamente| Go Back|Voltar| Call Agent Again|Ligar novamente para o agente| -MY CALLBACK ONLY|ESTE AGENDAMENTO SO APARECE PARA MIM| +MY CALLBACK ONLY|SOMENTE MEUS AGENDAMENTOS| ACTIVE CALLBACKS|AGENDAMENTOS ATIVOS| CALLBACKS FOR AGENT|AGENDAMENTOS POR AGENTE| Dial Code:|Codigo de Área:| @@ -311,7 +312,7 @@ CB Comments|Comentarios do CB| Title|Título| STATUS| STATUS| RESET| REINICIAR| -CLEAR FORM|LIMPAR FORMULARIO| +CLEAR FORM|LIMPAR FORMULÁRIO| SUBMIT|ENVIAR| Incoming|Entrante| Calling|Ligando| @@ -330,14 +331,14 @@ BUILD|CONFIGURAÇÃO| Server|Servidor| RECORD |REGISTRO | >HANGUP|>DESLIGAR| ->XFER|>TRANFERENCIA| +>XFER|>TRANFERÊNCIA| PARK|ESPERA| -IN-NUMBER|NUMERO ENTRANTE| -NUMBER|NUMERO| +IN-NUMBER|NÚMERO ENTRANTE| +NUMBER|NÚMERO| CALLERID|CALLERID| CALL| CHAMADA| PICKUP|CAPTURAR| -CONFERENCE|CONFERENCIA| +CONFERENCE|CONFERÊNCIA| Refresh|Atualizar| Send DTMF|Enviar DTMF| BORDER|BORDA| @@ -346,8 +347,8 @@ ORDER|ORDEM| >LOGOUT|>SAIR| Channel| Canal| Extensions|Extensões| -Conferences|Conferencias| -Conference|Conferencia| +Conferences|Conferências| +Conference|Conferência| Recording|Gravando| Record|Gravar| Welcome|Bem vindo| @@ -362,46 +363,46 @@ Initializing|Inicializando| Invalid|Inválido| Username|Usuário| Notes|Notas| -First|Primeiro| -MI: |MI:| -Last|Ultimo| +First|Nome| +MI: |Inicial:| +Last|Sobrenome| Address|Endereço| City|Cidade| State|Estado| PostCode|CEP| Province|Bairro| Vendor ID|Vendedor| -DialCode|Codigo de Area| +DialCode|Codigo de Área| Alt. Phone|Telefone Alternativo| Show|Mostrar| Email|Email| Comments|Comentários| REFRESH|ATUALIZAR| -ALT PHONE DIAL|DISCAR TELEFONE ALT| -MAIN PHONE|TELEFONE PRINCIPAL| -ALT PHONE|TELEFONE ALTERNATIVO| +ALT PHONE DIAL|DISCAR FONE ALT| +MAIN PHONE|FONE PRINC| +ALT PHONE|FONE ALT| ADDRESS3|ENDERECO3| FINISH LEAD|FINALIZAR CONTATO| Dial Alt Phone Number|Discar telefone alternativo| Phone|Telefone| DIAL| DISCAR| -SUBMIT FAVORITES CHANGES - requires logout|PARA ENVIAR MODIFICACOES FAVORITAS E NECESSARIO FAZER O LOGOUT| +SUBMIT FAVORITES CHANGES - requires logout|ENVIAR ALTERAÇÕES FAVORITAS - requer logout| BACK TO MAIN WINDOW - ignore changes made|VOLTAR A TELA PRINCIPAL - as alterações serão ignoradas| -AVAILABLE EXTENSIONS|EXTENSOES DISPONIVEIS| +AVAILABLE EXTENSIONS|EXTENSÕES DISPONÍVEIS| edit|editar| FAVORITES|FAVORITOS| ### END translation phrases through 1.1.11 release ### -Search Existing Leads|Ligações Existentes Da Busca| -This option if checked will attempt to find the phone number in the system before inserting it as a new lead|Esta opção se verificado tentará encontrar o número de telefone no sistema antes de introduzi-lo como uma ligação nova| -Finish Wrapup and Move On|Revestimento Wrapup e movimento sobre| -seconds remaining in wrapup|segundos restantes no wrapup| -Call Wrapup:|Chamada Wrapup:| +Search Existing Leads|Pesquisar Registros Existentes| +This option if checked will attempt to find the phone number in the system before inserting it as a new lead|Esta opção caso esteja marcada irá tentar encontrar o número do fone no sistema antes de inserir um novo registro| +Finish Wrapup and Move On|Finalizar pós-atendimento e seguir| +seconds remaining in wrapup|segundos restantes de pós-atendimento| +Call Wrapup:|Chamada pós-atd:| ### months of the year for CallBack date select screen ### January|Janeiro| Frebruary|Fevereiro| March|Março| April|Abril| -May|Pode| +May|Maio| June|Junho| July|Julho| August|Agosto| @@ -410,64 +411,64 @@ October|Outubro| November|Novembro| December|Dezembro| ### BEGIN translation phrases for 2.0.1 release ### -Previous Callback Information|Informação Precedente Da Rechamada| +Previous Callback Information|Informação de Agendamento Anterior| Last Call: |Última Chamada:| -CallBack: |Rechamada:| +CallBack: |Agendamento:| Agent: |Agente:| Comments: |Comentários:| ### BEGIN translation phrases for 2.0.2 release ### VOLUME|VOLUME| ### BEGIN translation phrases for 2.0.3 release ### -FAST DIAL|SELETOR RÁPIDO| -YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|VOCÊ DEVE DAR ENTRADA A um NÚMERO De TELEFONE E A um CÓDIGO DoSELETOR PARA USAR O SELETOR RÁPIDO| - SELECT A PAUSE CODE :| SELECIONE Um CÓDIGO Da PAUSA :| -ENTER A PAUSE CODE|DÊ ENTRADA A um CÓDIGO Da PAUSA| -YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-DIAL MODE|VOCÊ DEVE SER PAUSADO PARA DAR ENTRADA A um CÓDIGO Da PAUSA NaMODALIDADE De AUTO-DIAL| -Your session has been disabled|Sua sessão foi incapacitada| +FAST DIAL|DISCAGEM RÁPIDA| +YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|VOCÊ DEVE ENTRAR UM NÚMERO E O CÓDIGO DE ÁREA PARA USAR A DISCAGEM RÁPIDA| + SELECT A PAUSE CODE :| SELECIONE UM CÓDIGO DE PAUSA :| +ENTER A PAUSE CODE|DIGITE UM CÓDIGO DE PAUSA| +YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-DIAL MODE|VOCÊ DEVE ESTAR EM PAUSA PARA ENTRAR UM CÓDIGO DE PAUSA NO MODO AUTOMÁTICO| +Your session has been disabled|Sua sessão foi finalizada| ### BEGIN translation phrases for 2.0.5 release ### Gender: |Sexo:| Date of Birth: |Data de Nascimento:| -YOU MUST BE PAUSED TO CHANGE GROUPS|Você deve estar PAUSED PARA ALTERAR GRUPOS| -Calls in Queue:|Solicita, em fila:| - Timeclock|Timeclock| -The user and password you entered are not active in the system|O usuário ea senha que você digitou não são ativos no sistema| +YOU MUST BE PAUSED TO CHANGE GROUPS|VOCÊ DEVE ESTAR EM PAUSA PARA ALTERAR OS GRUPOS| +Calls in Queue:|Chamadas na fila:| + Timeclock| Relogio ponto| +The user and password you entered are not active in the system|O usuário e a senha que você digitou não estão ativos no sistema| Please try again|Por favor, tente novamente| -You cannot log in or out within 30 seconds of your last login or logout|Você não pode efetuar login ou para fora dentro de 30 segundos do seu último login ou logout| -You have now logged-out|Você tem agora autenticado-out| +You cannot log in or out within 30 seconds of your last login or logout|Você não pode entrar ou sair dentro de 30 segundos do seu último login ou logout| +You have now logged-out|Você efetuou logout| You logged out at |Você saiu em| -Amount of time you were logged-in: |Quantidade de tempo que foram registradas em:| -ERROR: timeclock log entry already made: |ERRO: timeclock entrada do log já realizados:| -BACK to Agent Login Screen|BACK TO Agent Login Screen| -BACK to Administration|Retornar para Administração| -BACK to Welcome Screen|ANTERIOR a tela Bem-vindo| -Time since you were last logged-in: |Vez desde que foi registrado em:| -You last logged-out at: |Você última autenticado-out em:| -Click LOGIN below to log-in|LOGIN Clique abaixo para log-in| -Amount of time you have been logged-in: |Quantidade de tempo que tem sido registrado em:| -You logged-in at:|Você autenticado-nos em:| -Click LOGOUT below to log-out|LOGOUT Clique abaixo para log-out| -Undefined|Undefined| -This phone number is not in the campaign lists|Esse número de telefone não está na campanha listas| -Unspecified error|Unspecified error| -Extended Alt Phone Information: |Extensão Alt Telefone Informação:| -ALT DIAL NUMBER:|ALT PROGR.SELEC NÚMERO:| -Phone Code and Number:|Telefone Código e Número:| +Amount of time you were logged-in: |Quantidade de tempo que ficou logado:| +ERROR: timeclock log entry already made: |ERRO: relogio ponto já registrado:| +BACK to Agent Login Screen|VOLTAR para tela de login do Agente| +BACK to Administration|VOLTAR para Administração| +BACK to Welcome Screen|VOLTAR para Tela Inicial| +Time since you were last logged-in: |Tempo desde o último login:| +You last logged-out at: |Você saiu pela última vez em:| +Click LOGIN below to log-in|Clique LOGIN abaixo para entrar| +Amount of time you have been logged-in: |Tempo total desde que entrou no sistema:| +You logged-in at:|Você entrou em:| +Click LOGOUT below to log-out|Clique LOGOUT abaixo para sair| +Undefined|Indefinido| +This phone number is not in the campaign lists|Esse número de telefone não está na lista da campanha| +Unspecified error|Erro não especificado| +Extended Alt Phone Information: |Informações Complementares do Fone Alt.:| +ALT DIAL NUMBER:|NÚMERO DE DISC. ALT.:| +Phone Code and Number:|Código de área e número:| Notes: |Notas:| Active: |Ativa:| -Alt Count: |Alt Count:| -Change this phone number to INACTIVE|Altere este número de telefone para INATIVO| -Change this phone number to ACTIVE|Altere este número de telefone para ACTIVAS| -YOU MUST LOG IN TO THE TIMECLOCK FIRST|É necessário efetuar login AO PRIMEIRO TIMECLOCK| -There is a time synchronization problem with your system, please tell your system administrator|Há um tempo sincronização problema com o seu sistema, por favor informe o seu administrador de sistema| -Preview Call|Preview Call| -SELECT A GROUP ALIAS|Selecionar um grupo ALIÁS| -Group Alias Selection|Grupo Alias Selecção| -Click Here to Choose a Group Alias|Clique aqui para escolher um grupo Alias| -Group Alias|Grupo Alias| -ERROR: There are no Shifts enabled for your user group|ERRO: Não existem Shifts activado para o Grupo de Usuários| -ERROR: You are not allowed to log in outside of your shift|ERRO: Você não tem permissão para iniciar sessão no para fora do seu turno| -MANAGER OVERRIDE|GERENTE Override| -Your Shift is over or has changed, you have been logged out of your session|Seu Shift é mais ou mudou, você foi desconectado da sua sessão| +Alt Count: |Contagem de Alt:| +Change this phone number to INACTIVE|Alterar número de telefone para INATIVO| +Change this phone number to ACTIVE|Alterar número de telefone para ATIVO| +YOU MUST LOG IN TO THE TIMECLOCK FIRST|É necessário efetuar login no Relógio Ponto primeiro| +There is a time synchronization problem with your system, please tell your system administrator|Há um problema de sincronização no seu sistema, por favor informe o seu administrador de sistemas| +Preview Call|Chamada Preview| +SELECT A GROUP ALIAS|SELEC. UM APELIDO DE GRUPO| +Group Alias Selection|Seleção de Apelido de Grupo| +Click Here to Choose a Group Alias|Clique aqui para escolher um apelido de grupo| +Group Alias|Apelido de Grupo| +ERROR: There are no Shifts enabled for your user group|ERRO: Não existem turnos ativos para seu Grupo de Usuários| +ERROR: You are not allowed to log in outside of your shift|ERRO: Você não tem permissão para iniciar sessão fora do seu turno| +MANAGER OVERRIDE|SOBREPOR GERENTE| +Your Shift is over or has changed, you have been logged out of your session|Seu turno acabou ou foi alterado, você foi desconectado da sua sessão| ### START translations for 2.2.0 release ### You are not allowed to dial into other agent sessions|Você não tem permissão para discar para sessões de outro agente| QUICK TRANSFER|RÁPIDA TRANSFERÊNCIA| diff --git a/agc_2-X/branches/agc_2.2.0/translations/br_language_admin.txt b/agc_2-X/branches/agc_2.2.0/translations/br_language_admin.txt new file mode 100644 index 00000000..0eb178f6 --- /dev/null +++ b/agc_2-X/branches/agc_2.2.0/translations/br_language_admin.txt @@ -0,0 +1,2490 @@ +# br_language_admin.txt - this file is for the internationalization of the astGUIclient +# admin web pages. The associated install.pl file will take the language as an +# argument and alter the php scripts to the language typed in the command line: +# example: ./install.pl --language=es +# current languages in the file: +# - English - (en) no alterations +# - Brazilian Portuguese - (br) first column +***LANGUAGES*** +en-English|br-Brazilian| +***FILES*** +vicidial|admin.php|0 +vicidial|dbconnect.php|1 +vicidial|AST_VICIDIAL_hopperlist.php|0 +vicidial|AST_agent_time_sheet.php|0 +vicidial|user_status.php|0 +vicidial|server_stats.php|0 +vicidial|AST_VDADstats.php|0 +vicidial|AST_timeonVDAD.php|0 +vicidial|AST_timeonVDAD_closer.php|0 +vicidial|AST_timeonVDADall.php|0 +vicidial|AST_timeoncall.php|0 +vicidial|AST_timeonpark.php|0 +vicidial|listloader.php|0 +vicidial|listloaderMAIN.php|0 +vicidial|new_listloader_superL.php|0 +vicidial|count.htm|1 +vicidial|help.gif|1 +vicidial|listloader.pl|1 +vicidial|listloader_rowdisplay.pl|1 +vicidial|listloader_super.pl|1 +vicidial|user_stats.php|0 +vicidial|remote_dispo.php|0 +vicidial|group_hourly_stats.php|0 +vicidial|admin_search_lead.php|0 +vicidial|admin_modify_lead.php|0 +vicidial|AST_CLOSERstats.php|0 +vicidial|vdremote.php|0 +vicidial|AST_agent_performance_detail.php|0 +vicidial|AST_agent_performance.php|0 +vicidial|AST_server_performance.php|0 +vicidial|AST_admin_log_display.php|0 +vicidial|AST_timeonVDADallSUMMARY.php|0 +vicidial|inbound_popup.php|0 +vicidial|AST_inboundEXTstats.php|0 +vicidial|welcome.php|0 +vicidial|admin_header.php|0 +vicidial|vicidial_sales_viewer.php|0 +vicidial|user_group_bulk_change.php|0 +vicidial|AST_agent_status_detail.php|0 +vicidial|AST_agent_days_detail.php|0 +vicidial|AST_CLOSER_service_level.php|0 +vicidial|AST_IVRfilter.php|0 +vicidial|AST_IVRstats.php|0 +vicidial|call_report_export.php|0 +vicidial|fcstats.php|0 +vicidial|list_download.php|0 +vicidial|non_agent_api.php|1 +vicidial|timeclock_edit.php|0 +vicidial|timeclock_report.php|0 +vicidial|timeclock_status.php|0 +vicidial|vtiger_search.php|1 +vicidial|vtiger_user.php|1 +vicidial|welcome_demo.php|1 +vicidial|welcome_languages.php|1 +vicidial|vicidial_admin_web_logo.gif|1 +vicidial|vicidial_admin_web_logo_small.gif|1 +vicidial|user_territories.php|1 +vicidial|audio_store.php|1 +vicidial|AST_agent_time_detail.php|1 +vicidial|AST_agent_timeclock_detail.php|1 +vicidial|AST_OUTBOUNDsummary_interval.php|1 +vicidial|call_report_export.php|1 +vicidial|AST_CLOSERsummary_hourly.php|1 +vicidial|functions.php|1 +***TRANSLATIONS***|||| +### special translations that should stay at the top of the file ### +BORDER|Border| +VALUE=SUBMIT|VALUE=SUBMIT| +TYPE=SUBMIT|TYPE=Submit| +\.\/images\/|../agc/images/| +help.gif|help.gif| +### BEGIN translation phrases through 1.1.11 release ### +English|Ingles| +Spanish|Espanol| +French|Frances| +German|Aleman| +Italian|Italiano| +You have now logged out. Thank you|Voce efetuou logout. Obrigado| +Invalid Username\/Password|Nome ou Senha inválidos| +ASTERISK ADMIN: Administration|ASTERISK ADMIN: Administração| +PHONES TABLE|TABELA DE RAMAIS| +Phone extension -<\/B> This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP\/test101 the Phone extension would be test101. Also, for IAX2 phones make sure you use the full phones name: IAX2\/IAXphone1@IAXphone1 would be IAXphone1@IAXphone1. For Zap phones make sure you put the full channel: Zap\/25-1 would be 25-1. Another note, make sure you set the Protocol below correctly for your type of phone.|Número do Ramal - Este campo é onde você coloca o número do ramal conforme aparece no Asterisk sem incluir o protocolo ou a barra no começo. Por exemplo: para o ramal SIP\/test101 o número do ramal seria test101. Também, para os ramais IAX2 tenha certeza de usar o nome completo: IAX2/IAXphone1@IAXphone1 seria IAXphone1@IAXphone1. Para Zap tenha certeza que você usa o canal completo: Zap/25-1 seria 25-1. Outro aviso, tenha certeza que você configura o protocolo abaixo corretamente para seu tipo de telefone.| +Dial Plan Number -<\/B> This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server|Numero do plano de discagem - Este campo é para o número que você disca para tocar o ramal. Esse número é definido no arquivo extensions.conf do seu servidor Asterisk| +Voicemail Box -<\/B> This field is for the voicemail box that the messages go to for the user of this phone. We use this to check for voicemail messages and for the user to be able to use the VOICEMAIL button on astGUIclient app|Caixa Postal - Este campo é para a caixa postal de voz para onde vao as menssagens para o usuário deste ramal. Utilizamos isto para verificar as mensagens e para o usuário utilizar o botão VOICEMAIL no aplicativo astGUIclient| +Outbound CallerID -<\/B> This field is where you would enter the callerID number that you would like to appear on outbound calls placed form the astguiclient web-client. This does not work on RBS, non-PRI, T1\/E1s|Identificador de Saída - Este campo é onde deve ser colocado o número que você quer que saia no identificador para as ligações de saída feitas pelo astguiclient. Isto não funciona em linhas RTB(non-PRI) T1/E1| +Phone IP address -<\/B> This field is for the phone's IP address if it is a VOIP phone. This is an optional field|Endereço IP do ramal - Este campo é para o endereço IP do ramal se for um ramal VOIP. Este campo é opcional| +Computer IP address -<\/B> This field is for the user's computer IP address. This is an optional field|Endereço IP do computador - Este campo é para o endereço IP do computador do usuário. Este campo é opcional| +Server IP -<\/B> This menu is where you select which server the phone is active on|IP do Servidor - Este menu é onde você escolhe em qual servidor está o ramal ativo| +Login -<\/B> The login used for the phone user to get to admin functions|Login - O login usado para o usuário do ramal conseguir permissões de admin| +Password -<\/B> The password used for the phone user to get to admin functions|Senha - A senha usada para o usuário do ramal conseguir permissões de admin| +Status -<\/B> The status of the phone in the system, ACTIVE and ADMIN allow for GUI clients to work. ADMIN allows access to this administrative web site. All other statuses do not allow GUI or Admin web access|Status - O status do ramal no sistema, ATIVO e ADMIN permiten que os clientes GUI trabalhem. ADMIN permite o acceso ao Website de administração. Os outros status não permitem o acceso ao GUI ou ao Website de Admin| +Active Account -<\/B> Whether the phone is active to put it in the list in the GUI client|Conta ativa - Se o ramal está ativado será incluído na lista do cliente GUI| +Phone Type -<\/B> Purely for administrative notes|Tipo de Ramal - Somente para informação administrativa| +Full Name -<\/B> Used by the GUIclient in the list of active phones|Nome Completo - Usado pelo GUIclient na lista de ramais ativos| +Company -<\/B> Purely for administrative notes|Empresa - Somente para informação administrativa| +Picture -<\/B> Not yet Implemented|Foto - Ainda não implementado| +New Messages -<\/B> Number of new voicemail messages for this phone on the Asterisk server|Novas Mensagens - Número de mensagens novas na conta de correio de voz para esse ramal no servidor Asterisk| +Old Messages -<\/B> Number of old voicemail messages for this phone on the Asterisk server|Mensagens Antigas - |Número de mensagens antigas na conta de correio de voz para esse ramal no servidor Asterisk +Client Protocol -<\/B> The protocol that the phone uses to connect to the Asterisk server: SIP, IAX2, Zap . Also, there is EXTERNAL for remote dial numbers or speed dial numbers that you want to list as phones|Protocolo Client - O protocolo que o ramal utiliza para se conectar com o servidor Asterisk: SIP, IAX2, Zap. Também, para os números Externos ou número de discagem rápida que você deseja listar como ramais| +Local GMT -<\/B> The difference from Greenwich Mean time, or ZULU time where the phone is located. DO NOT ADJUST FOR DAYLIGHT SAVINGS TIME. This is used by the VICIDIAL campaign to accurately display the time and customer time|GMT Local - A diferença a partir do horário de Greenwich, ou Horário ZULU para o local onde o ramal está localizado. NÃO AJUSTE PARA O HORÁRIO DE VERÃO. É usado pela campanha do VICIDIAL para demonstrar corretamente o horário local e o horário do cliente.| +Manager Login -<\/B> This is the login that the GUI clients for this phone will use to access the Database where the server data resides|Login de Gerenciamento- Este é o login que o client GUI para esse ramal usará para acessar o Banco de Dados onde os dados do servidor residem | +Manager Secret -<\/B> This is the password that the GUI clients for this phone will use to access the Database where the server data resides|Senha de Gerenciamento - Esta é a senha que o client GUI para esse ramal usará para acessar o Banco de Dados onde os dados do servidor residem| +VICIDIAL Default User -<\/B> This is to place a default value in the VICIDIAL user field whenever this phone user opens the astVICIDIAL client app. Leave blank for no user|Usuário padrão do VICIDIAL - O valor desse campo será colocado no campo de usuário quando esse ramal entrar no aplicativo astVICIDIAL | +VICIDIAL Default Pass -<\/B> This is to place a default value in the VICIDIAL password field whenever this phone user opens the astVICIDIAL client app. Leave blank for no pass|Senha padrão VICIDIAL - Este valor de senha será preenchido no campo da senha do usuário quando esse ramal entrar no aplicativo astVICIDIAL | +VICIDIAL Default Campaign -<\/B> This is to place a default value in the VICIDIAL campaign field whenever this phone user opens the astVICIDIAL client app. Leave blank for no campaign|Campanha padrão do VICIDIAL - Este campo deve ser preenchido com o valor padrão para o campo da campanha quando este ramal abrir o aplicativo astVICIDIAL. Deixe em branco para nenhuma campanha| +Park Exten -<\/B> This is the default Parking extension for the client apps. Verify that a different one works before you change this|Park Exten - Esta é a extensão de estacionamento padrao para o aplicativo client. Verifique se a extensão funciona antes de alterar.| +Conf Exten -<\/B> This is the default Conference park extension for the client apps. Verify that a different one works before you change this|Conf Exten - Esta é a extensão padrao para estacionamento da conferência para o aplicativo client. Verifique se a extensão funciona antes de alterar| +VICIDIAL Park Exten -<\/B> This is the default Parking extension for VICIDIAL client app. Verify that a different one works before you change this|VICIDIAL Park Exten - Esta é a extensão de estacionamento para o aplicativo client VICIDIAL. Verifique se a extensão funciona antes de alterar| +VICIDIAL Park File -<\/B> This is the default VICIDIAL park extension file name for the client apps. Verify that a different one works before you change this. limited to 10 characters|Arquivo do VICIDIAL Park - Este é o nome do arquivo padrao para a extensão de estacionamento do VICIDIAL usado pelo aplicativo cliente. Verifique se um arquivo diferente funciona antes de alterar. Limitado a 10 caracteres| +Monitor Prefix -<\/B> This is the dial plan prefix for monitoring of Zap channels automatically within the astGUIclient app. Only change according to the extensions.conf ZapBarge extensions records|Prefixo do monitor - Este é o prefixo do plano de discagem para monitorar canais automaticamente dentro do aplicativo astGUIclient. Só altere de acordo com os registros de ZapBarge do arquivo extensions.conf| +Recording Exten -<\/B> This is the dial plan extension for the recording extension that is used to drop into meetme conferences to record them. It usually lasts upto one hour if not stopped. verify with extensions.conf file before changing|Exten de Gravação - Esta é a extensão do plano de discagem que irá entrar na sala de conferências e gravar a conversa. Normalmente dura por volta de uma hora se nao for cancelada. Verifique no arquivo extensions.conf antes de alterar| +VMAIL Main Exten -<\/B> This is the dial plan extension going to check your voicemail. verify with extensions.conf file before changing|Exten principal de VMAIL- Esta é a extensão do plano de discagem que acessa o voicemail. Verifique o arquivo extensions.conf antes de alterar| +VMAIL Dump Exten -<\/B> This is the dial plan prefix used to send calls directly to a user's voicemail from a live call in the astGUIclient app. verify with extensions.conf file before changing|Descarga Exten de VMAIL - Esta é a extensão do plano de discagem usada para deixar mensagens no correio de voz| +Exten Context -<\/B> This is the dial plan context that this phone primarily uses. It is assumed that all numbers dialed by the client apps are using this context so it is a good idea to make sure this is the most wide context possible. verify with extensions.conf file before changing|Contexto do Exten - Este é o contexto do plano de discagem usado pelo ramal. Será assumido que todos os numeros discados por esse ramal estão usando esse contexto, portanto é uma boa ideia que esse contexto é o mais amplo possível. Verifique o arquivo extensions.conf antes de alterar| +DTMF send Channel -<\/B> This is the channel string used to send DTMF sounds into meetme conferences from the client apps. Verify the exten and context with the extensions.conf file|Canal de envio de DTMF - Este é canal usado para enviar tons DTMF nas conferencias meetme do aplicativo client. Verifique a exten e o contexto no arquivo extensions.conf| +Outbound Call Group -<\/B> This is the channel group that outbound calls from this phone are placed out of. There are a couple routines in the client apps that use this. For Zap channels you want to use something like Zap\/g2 , for IAX2 trunks you would want to use the full IAX prefix like IAX2\/VICItest1:secret@10.10.10.15:4569. Verify the trunks with the extensions.conf file, it is usually what you have defined as the TRUNK global variable at the top of the file|Grupo de Saída - Este é o grupo de canais em que as chamadas saintes são feitas. Existem algumas rotinas no aplicativo cliente que usam isso. Para canais Zap você deve fazer algo como Zap/g2, para trunks IAX2 voce deve usar o prefixo completo como: IAX2/VICItest1:secret@10.10.10.15:4569. Verifique os trunks no arquivo extensions.conf, normalmente é o que voce definiu na variavel global TRUNK no inicio do arquivo| +Browser Location -<\/B> This is applicable to only UNIX\/LINUX clients, the absolute path to Mozilla or Firefox browser on the machine. verify this by launching it manually|Local do Browser - Isto se aplica apenas a clientes UNIX/LINUX, é o caminho absoluto para os browsers Mozilla ou Firefox na maquina. Verifique isso executando-o manualmente| +Install Directory -<\/B> This is the place where the astGUIclient and astVICIDIAL scripts are located on your machine. For Win32 it should be something like C:\\AST_VICI and for UNIX it should be something like \/usr\/local\/perl_TK. verify this manually|Diretório de Instalação - Este é o local onde os scripts do astGUIclient e astVICIDIAL estão localizados na sua maquina. Para Win32 deve ser algo como: C:\\AST_VICI e para UNIX deve ser algo como /usr/local/perl_TK. Verifique isso manualmente| +CallerID URL -<\/B> This is the web address of the page used to do custom callerID lookups. default testing address is: http:\/\/astguiclient.sf.net\/test_callerid_output.php|URL do Identificador - | Este é o endereço da pagina que é usada para customizar pesquisas do identificador de chamadas. O endereço default para teste é: http://astguiclient.sf.net/test_callerid_output.php| +VICIDIAL Default URL -<\/B> This is the web address of the page used to do custom VICIDIAL Web Form queries. default testing address is: http:\/\/astguiclient.sf.net\/test_VICIDIAL_output.php|URL default do VICIDIAL - Este é o endereço da página usada para customizar pesquisas do VICIDIAL. O endereço padrão de testes é: htpp://astguiclient.sf.net/test_VICIDIAL_output.php| +Call Logging -<\/B> This is set to true if the call_log.agi file is in place in the extensions.conf file for all outbound and hang up 'h' extensions to log all calls. This should always be 1 because it is manditory for many astGUIclient and VICIDIAL features to work properly|Registro de chamada - Esta configuração terá valor true se o arquivo call_log.agi estiver no arquivo extensions.conf para todas as extensões de saida e de desligamento (hangup). Isso deve sempre estar true pois é obrigado para que muitas funcionalidades do astGUIclient e do VICIDIAL funcionem corretamente| +User Switching -<\/B> Set to true to allow user to switch to another user account. NOTE: If user switches they can initiate recording on the new user's phone conversation|Conmutación del usuario - fije para verdad para permitir que el usuario cambie a otra cuenta del usuario. NOTA: Si los interruptores del usuario ellos pueden iniciar la grabación en la conversación de teléfono del nuevo usuario| +Conferencing -<\/B> Set to true to allow user to start conference calls with upto six external lines|Conferencias - Configurado como true, permite o usuário iniciar conferências de até seis telefones externos| +Admin Hang Up -<\/B> Set to true to allow user to be able to hang up any line at will through astGUIclient. Good idea only to enable this for Admin users|Hangup do Admin - Configurado como true permite que o usuário desligue qualquer linha através do astGUIclient. Uma boa ideia é somente permitir isso para usuários Admin| +Admin Hijack -<\/B> Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers|Sequestro do Admin - Configure como true para permitir que o usuário consiga pegar qualquer linha e transferir para seu ramal através do astGUIclient. Uma boa ideia é permitir somente para o usuário Admin. Mas é muito útil para gerentes| +Admin Monitor -<\/B> Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers and as a training tool|Monitoramento Admin - Configure como true para permitir que o usuário consiga pegar qualquer linha e transferir para seu ramal através do astGUIclient. Uma boa ideia é permitir somente para o usuário Admin. Mas é muito útil para gerentes| +Call Park -<\/B> Set to true to allow user to be able to park calls on astGUIclient hold to be picked up by any other astGUIclient user on the system. Calls stay on hold for upto a half hour then hang up. Usually enabled for all|Estacionamento de chamadas - Se configurado como true permite o usuário estacionar as chamadas pelo astGUIclient para que sejam capturadas por outros usuários do sistema. Chamadas ficam estacionadas por até meia hora e depois são desligadas. Normalmente é habilitado para todos| +Updater Check -<\/B> Set to true to display a popup warning that the updater time has not changed in 20 seconds. Useful for Admin users|Verif. de Updater - Se configurado como true, mostra um aviso em popup que o tempo do atualizador nao mudou em 20 segundos. Útil para usuários Admin| +AF Logging -<\/B> Set to true to log many actions of astGUIclient usage to a text file on the user's computer|Registro AF - Se configurado como true, grava várias ações do uso do astGUIclient para um arquivo texto no computador do usuário| +Queue Enabled -<\/B> Set to true to have client apps use the Asterisk Central Queue system. Required for VICIDIAL and recommended for all users|Habilitar Fila - Configure como true para que os aplicativos cliente usem o controle central de Filas do Asterisk. Requerido e recomendado para todos os usuários| +CallerID Popup -<\/B> Set to true to allow for numbers defined in the extensions.conf file to send CallerID popup screens to astGUIclient users|CallerID Popup - Configurado como true permite que números configurados no arquivo extensions.conf enviem telas popup de Identificação (CallerID) para os usuários| +VMail Button -<\/B> Set to true to display the VOICEMAIL button and the messages count display on astGUIclient|Botão do VMail - Configurado como true irá mostrar o botao do VOICEMAIL (correio de voz) e o contador de mensagens no astGUIclient| +Fast Refresh -<\/B> Set to true to enable a new rate of refresh of call information for the astGUIclient. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number|Atualização Rápida - Configure como true para habilitar uma nova velocidade de atualização das informações sobre a chamada no astGUIclient. A velocidade padrão quando desabilitado é de 1000ms ou 1 segundo. Pode aumentar a carga no sistema se esse tempo for reduzido| +Fast Refresh Rate -<\/B> in milliseconds. Only used if Fast Refresh is enabled. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number|Tempo de Atualização Rápida - em milisegundos. Só é usado se a opção "Atualização Rápida" estiver habilitada. O valor padrão desabilitado é 1000ms, 1 segundo. Pode aumentar a carga do sistema se esse valor for reduzido| +Persistant MySQL -<\/B> If enabled the astGUIclient connection will remain connected instead of connecting every second. Useful if you have a fast refresh rate set. It will increase the number of connections on your MySQL machine|MySQL Permanente- Se estiver habilitada, a conexão do astGUIclient permanecerá ativa ao invés de conectar a cada segundo. Útil se você tiver um tempo de atualização curto. Pode aumentar a quantidade de conexões no servidor MySQL| +Auto Dial Next Number -<\/B> If enabled the VICIDIAL client will dial the next number on the list automatically upon disposition of a call unless they selected to "Stop Dialing" on the disposition screen|Discar próximo número automaticamente- Se habilitado o aplicativo client do VICIDIAL irá discar o próximo número automaticamente no desligamento de uma chamada, a não ser que o usuário selecione "Parar Discagem" na tela de finalização da chamada| +Stop Rec after each call -<\/B> If enabled the VICIDIAL client will stop whatever recording is going on after each call has been dispositioned. Useful if you are doing a lot of recording or you are using a web form to trigger recording|Parar gravação após cada chamada- Se habilitado o client do VICIDIAL irá parar de gravar após o final de cada chamada. Útil se você está fazendo muitas gravações ou se está usando o formulário web para acionar a gravação| +DBX Server -<\/B> The MySQL database server that this user should be connecting to|Servidor DBX - O servidor de banco de dados que este usuário deve se conectar| +DBX Database -<\/B> The MySQL database that this user should be connecting to. Default is asterisk|Base de dados DBX - A base de dados MySQL que o usuário deve se conectar. Padrão é asterisk| +DBX User -<\/B> The MySQL user login that this user should be using when connecting. Default is cron|Usuário do DBX - O login de usuário do MySQL que esse usuário deve usar para conectar. Default é cron| +DBX Pass -<\/B> The MySQL user password that this user should be using when connecting. Default is 1234|Senha do DBX - Senha do usuário de conexão do MySQL. Padrão é 1234| +DBX Port -<\/B> The MySQL TCP port that this user should be using when connecting. Default is 3306|Porta DBX - A porta TCP de conexão com o MySQL que o usuário deve usar para conectar. Padrão é 3306| +DBY Server -<\/B> The MySQL database server that this user should be connecting to|Servidor DBY - O servidor de banco de dados que este usuário deve se conectar| +DBY Database -<\/B> The MySQL database that this user should be connecting to. Default is asterisk|Base de dados DBY - A base de dados MySQL que o usuário deve se conectar. Padrão é asterisk| +DBY User -<\/B> The MySQL user login that this user should be using when connecting. Default is cron|Usuário do DBY - O login de usuário do MySQL que esse usuário deve usar para conectar. Default é cron| +DBY Pass -<\/B> The MySQL user password that this user should be using when connecting. Default is 1234|Senha do DBY - Senha do usuário de conexão do MySQL. Padrao é 1234| +DBY Port -<\/B> The MySQL TCP port that this user should be using when connecting. Default is 3306|Porta DBY - A porta TCP de conexão com o MySQL que o usuário deve usar para conectar. Padrao é 3306| +Redirect command sent for channel|Comando de redirecionar enviado ao canal| +Look up this customer in Customer Service System|Procurar esse cliente no sistema de Serviço ao Consumidor| +Redirect command FAILED for channel|Redirecionar o comando FALHA para o canal| +PLEASE SELECT A NUMBER AND DATE ABOVE AND CLICK SUBMIT|POR FAVOR SELECIONE UM NÚMERO E UMA DATA ACIMA E CLIQUE EM ENVIAR| +Total Calls That came into this number|Total de chamadas que entraram por esse número| +Average Call Length(seconds) for all Calls|Tempo médio das chamadas(segundos) para todas as chamadas| +Total DROP Calls: (less than 10 seconds)|Total de chamadas derrubadas: (em menos de 10 segundos)| +Average Call Length(seconds) for DROP Calls|Tempo médio das chamadas derrubadas(segundos)| +GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS|GRÁFICO TOTAL DE CHAMADAS A CADA 15 MINUTOS| +Click on the channel below that you would like to have directed to your phone|Clique no canal abaixo que gostaría de direcionar para seu ramal| +LAST 1000 CALLS FOR DATE RANGE|ULTIMAS 1000 CHAMADAS NO PERÍODO| +Click here to see what leads are in the hopper right now|Clique aqui para ver quais registros estão no hopper agora| +CUSTOM STATUSES WITHIN THIS CAMPAIGN|STATUS CUSTOMIZADOS PARA ESSA CAMPANHA| +PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT|POR FAVOR SELECIONE UMA CAMPANHA ACIMA E CLIQUE EM ENVIAR| +PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT|POR FAVOR SELECIONE UMA CAMPANHA E UMA DATA ACIMA E CLIQUE EM ENVIAR| +GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN|GRÁFICO DO TOTAL DE CHAMADAS FEITAS POR ESSA CAMPANHA A CADA 15 MINUTOS| +ERROR: The file does not have the required number of fields to process it|ERRO: O arquivo não possui a quantidade de campos requerida para continuar| +ERROR: File exceeds the 8MB limit|ERRO: O arquivo excede o limite máximo de 8MB| +Please enter the group you want to get hourly stats for|Por favor entre com o grupo que deseja visualizar estatísticas horárias| +The search variables you entered are not active in the system|As variáveis de pesquisa digitadas não estão ativas no sistema| +Please go back and double check the information you entered and submit again|Por favor volte e verifique as informações digitadas, então envie novamente| +Click here to see the Lead Details|Clique aqui para ver detalhes do registro| +SERVERS TABLE|TABELA DOS SERVIDORES| +Server ID -<\/B> This field is where you put the Asterisk servers name, doesnt have to be an official domain sub, just a nickname to identify the server to Admin users|ID do Servidor - Este campo é onde você configura o nome dos servidores Asterisk, nao precisa ser o domínio oficial, apenas um apelido para identificar o servidor para usuários Admin| +Server Description -<\/B> The field where you use a small phrase to describe the Asterisk server|Descrição do Servidor - O campo onde você usa uma pequena descrição para o servidor Asterisk| +Server IP Address -<\/B> The field where you put the Network IP address of the Asterisk server|Endereço IP do Servidor - O campo onde você configura o endereço IP do servidor Asterisk| +Active -<\/B> Set whether the Asterisk server is active or inactive|Ativo - Configure se o servidor está ativo ou não| +Asterisk Version -<\/B> Set the version of Asterisk that you have installed on this server. Examples: '1.2', '1.0.8', '1.0.7', 'CVS_HEAD', 'REALLY OLD', etc... This is used because versions 1.0.8 and 1.0.9 have a different method of dealing with Local\/ channels, a bug that has been fixed in CVS v1.0, and need to be treated differently when handling their Local\/ channels. Also, current CVS_HEAD and the 1.2 release tree uses different manager and command output so it must be treated differently as well|Versão do Asterisk - Configure a versão do Asterisk que está instalada no servidor. Exemplos: '1.2', '1.0.8', '1.0.7', 'CVS_HEAD', 'REALLY OLD', etc... Isto é necessário pois as versões 1.0.8 e 1.0.9 tem metodos diferentes de controlar canais Local, um erro foi arrumado na CVS v1.0, e precisa ser tratado de forma diferente quando usamos os canais "Local". Também, a versão atual CVS_HEAD e a 1.2 usam managers diferentes e os resultados dos comandos devem ser tratados de forma diferente| +Max VICIDIAL Trunks -<\/B> This field will determine the maximum number of lines that the VICIDIAL auto-dialer will attempt to call on this server. If you want to dedicate two full PRI T1s to VICIDIALing on a server then you would set this to 46. Default is 96|Qtd máxima de trunks VICIDIAL - Este campo determina o número máximo de linhas que o discador automático do VICIDIAL irá usar para chamar esse servidor. Se você quer dedicar dois canais E1 para discagem automática do VICIDIAL nesse servidor, entao você deve configurar como 60. O valor padrão é 96| +Telnet Host -<\/B> This is the address or name of the Asterisk server and is how the manager applications connect to it from where they are running. If they are running on the Asterisk server, then the default of 'localhost' is fine|Host Telnet - Este é o endereço ou nome do servidor Asterisk e é como os aplicativos de gerenciamento se conectam a ele. Se os aplicativos de gerenciamento estiverem sendo executados no próprio servidor Asterisk, então 'localhost' está correto| +Telnet Port -<\/B> This is the port of the Asterisk server Manager connection and is how the manager applications connect to it from where they are running. The default of '5038' is fine for a standard install|Porta Telnet - Esta é a porta para conexão com o Manager do servidor Asterisk e é como os aplicativos de gerenciamento se conectam a ele. A porta padrão é '5038' e funciona normalmente com a instalação padrão| +Manager User -<\/B> The username or login used to connect genericly to the Asterisk server manager. Default is 'cron'|Usuário do Manager - O nome do usuário (login) usado para conectar genericamente ao serviço do Manager do Asterisk. O padrão é 'cron'| +Manager Secret -<\/B> The secret or password used to connect genericly to the Asterisk server manager. Default is '1234'|Senha do Manager - A senha usada para a conexão com o serviço do Manager do Asterisk. O padrão é '1234'| +Manager Update User -<\/B> The username or login used to connect to the Asterisk server manager optimized for the Update scripts. Default is 'updatecron' and assumes the same secret as the generic user|Usuário de atualização do Manager -O nome do usuário (login) otimizado para atualizações, para se conectar ao serviço do Manager do Asterisk. O padrão é 'updatecron' e asume que a senha é a mesma do usuário genérico| +Manager Listen User -<\/B> The username or login used to connect to the Asterisk server manager optimized for scripts that only listen for output. Default is 'listencron' and assumes the same secret as the generic user|Usuário de Escuta do Manager - O nome de usuário (login) otimizado para escutar eventos de saída, usado para conectar ao serviço de Manager do Asterisk. Padrão é 'listencron' e assume que a senha é a mesma do usuário genérico| +Manager Send User -<\/B> The username or login used to connect to the Asterisk server manager optimized for scripts that only send Actions to the manager. Default is 'sendcron' and assumes the same secret as the generic user|Usuário de envio do Manager - O nome de usuário (login) otimizado para enviar Ações para o manager, para se conectar ao serviço do Manager do Asterisk. O Valor padrão é 'sendcron' e assume que a senha é a mesma do usuário genérico| +Server GMT offset -<\/B> The difference in hours from GMT time not adjusted for Daylight-Savings-Time of the server. Default is '-5'|Diferença GMT do Servidor- A diferença em horas a partir do horário GMT de onde se encontra o servidor, nao ajustada para o horário de verão. O padrão é '-5'| +VMail Dump Exten -<\/B> The extension prefix used on this server to send calls directly through agc to a specific voicemail box. Default is '85026666666666'|Exten de descarga de Voicemail - É o prefixo de exten usado neste servidor para enviar chamadas diretamente pelo agc para uma caixa postal específica. O padrão é '85026666666666'| +VICIDIAL AD extension -<\/B> The default extension if none is present in the campaign to send calls to for VICIDIAL auto dialing. Default is '8365'|Exten DA do Vicidial - A extensão padrão caso não haja nenhuma na campanha para enviar chamadas do Discador Automático VICIDIAL. Valor Padrão é '8365'| +Default Context -<\/B> The default dial plan context used for scripts that operate for this server. Default is 'default'|Contexto Padrão - O contexto padrão usado para scripts que operam nesse servidor. O valor padrão é 'default'| +User ID -<\/B> This field is where you put the VICIDIAL users ID number, can be up to 8 digits in length, Must be at least 2 characters in length|ID de Usuário - Este campo é onde deve ser colocado o ID de usuário do VICIDIAL, pode ter até 8 caracteres de comprimento, Deve ter pelo menos 2 caracteres de comprimento| +Password -<\/B> This field is where you put the VICIDIAL users password. Must be at least 2 characters in length|Senha - Este campo é onde deve ser configurada a senha do usuário do VICIDIAL. Deve ter pelo menos 2 caracteres de comprimento| +Full Name -<\/B> This field is where you put the VICIDIAL users full name. Must be at least 2 characters in length|Nome completo - Neste campo é configurado o Nome completo do usuário do VICIDIAL. Deve ter no mínimo 2 caracteres de comprimento| +User Level -<\/B> This menu is where you select the VICIDIAL users user level. Must be a level of 1 to log into VICIDIAL, Must be level greater than 2 to log in as a closer, Must be user level 8 or greater to get into admin web section|Nível de usuário - Neste menu deve ser selecionado o nível do usuário do VICIDIAL. Deve ser pelo menos 1 para acessar o VICIDIAL, deve ser maior que 2 para acessar como finalizador, deve ser nível 8 ou maior para acessar a tela de admin| +User Group -<\/B> This menu is where you select the VICIDIAL users group that this user will belong to. This does not have any restrictions at this time, this is just to subdivide users and allow for future features based upon it|Grupo de usuário - Este menu é onde você seleciona o grupo de usuários do VICIDIAL ao qual esse usuário pertence. Isto ainda não faz restrições, é usado somente para subdividir usuários e permitir futuras funcionalidades baseadas nele| +Phone Login -<\/B> Here is where you can set a default phone login value for when the user logs into vicidial.php. This value will populate the phone_login automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen|Login do Ramal - Aqui é onde você pode configurar um valor padrão para o login do ramal, usado quando o usuário loga no vicidial.php. Este valor será colocado no campo de login do ramal automaticamente quando o usuário loga na campanha no vicidial pela tela do vicidial.php| +Phone Pass -<\/B> Here is where you can set a default phone pass value for when the user logs into vicidial.php. This value will populate the phone_pass automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen|Senha do Ramal- Aqui é onde fica configurada a senha padrão para o ramal quando o usuário loga no vicidial.php. Este valor será colocado automaticamente no campo da senha, quando o usuário faz logon na campanha pela tela vicidial.php| +Delete Users -<\/B> This option if set to 1 allows the user to delete other users of equal or lesser user level from the system|Apagar Usuários - Esta opção quando habilitada permite que o usuário apaga outros usuários de igual ou menor nível do sistema| +Delete User Groups -<\/B> This option if set to 1 allows the user to delete user groups from the system|Apagar Grupos de Usuários - Esta opção, quando habilitada, permite que este usuário apague grupos de usuário do sistema| +Delete Lists -<\/B> This option if set to 1 allows the user to delete vicidial lists from the system|Apagar Listas - Esta opção, quando habilitada, permite ao usuário apagar listas do vicidial| +Delete Campaigns -<\/B> This option if set to 1 allows the user to delete vicidial campaigns from the system|Apagar Campanhas - Esta opção, quando habilitada, permite ao usuário apagar campanhas do vicidial| +Delete In-Groups -<\/B> This option if set to 1 allows the user to delete vicidial In-Groups from the system|Apagar Grupos de Entrada- Esta opção, quando habilitada, permite ao usuário apagar Grupos de entrada do sistema| +Delete Remote Agents -<\/B> This option if set to 1 allows the user to delete vicidial remote agents from the system|Apagar Agentes Remotos - Esta opção quando comfigurada como 1, permite ao usuário apagar agentes remotos do sistema| +Load Leads -<\/B> This option if set to 1 allows the user to load vicidial leads into the vicidial_list table by way of the web based lead loader|Carregar Registros - Esta opção, quando configurada como 1, permite ao usuário carregar novos registros de clientes na tabela vicidial_list atravéz do carregador de arquivos no client web| +Campaign Detail -<\/B> This option if set to 1 allows the user to view and modify the campaign detail screen elements|Detalhes da Campanha- Esta opção, quando configurada como 1, permite ao usuário ver e modificar os detalhes da campanha | +AGC Admin Access -<\/B> This option if set to 1 allows the user to login to the astGUIclient admin pages|Acesso AGC Admin- Esta opção, quando configurada como 1, permite o usuário efetuar logon nas páginas de admin do astGUIclient| +AGC Delete Phones -<\/B> This option if set to 1 allows the user to delete phone entries in the astGUIclient admin pages|Apagar Fones no AGC- Esta opção, quando configurada como 1, permite ao usuário apagar registros de fone nas paginas de admin do astGUIclient| +Delete Scripts -<\/B> This option if set to 1 allows the user to delete Campaign scripts in the script modification screen|Apagar Scripts - Esta opção, quando configurada como 1, permite o usuário apagar scripts de campanha na tela de configuração do script| +Script ID -<\/B> This is the short name of a Vicidial Script. This needs to be a unique identifier. Try not to use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters|ID do Script - Este é o nome curto do script Vicidial. É necessário que seja uma identificação única. Tente não usar espaços ou caracteres especias para este campo. Máximo de 10 caracteres, mínimo de 2 caracteres| +Script Name -<\/B> This is the title of a Vicidial Script. This is a short summary of the script. max 50 characters, minimum of 2 characters. There should be no spaces or punctuation of any kind in theis field|Nome do Script - Este é o título do script Vicidial. Este é um resumo curto do script. Máximo de 50 caracteres, mínimo de 2 caracteres. Não devem ser usados espaços ou caracteres especiais de qualquer forma neste campo| +Script Comments -<\/B> This is where you can place comments for a Vicidial Script such as -changed to free upgrade on Sept 23-. max 255 characters, minimum of 2 characters|Comentários do Script - Aqui é onde você pode colocar comentários para um Script Vicidial como: -alterado em 23 de Set.-. Máximo 255 caracteres, mínimo de 2 caracteres| +Script Text -<\/B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using --A--field--B-- where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?|Texto do Script - Aqui é onde deve ser colocado o conteúdo do Script Vicidial. Mínimo de 2 caracteres. Você pode ter as informações do cliente populadas neste script usando "--A--campo--B--" onde o "campo" é um dos seguintes nomes de campo: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments. Por exemplo, este texto vai imprimir o nome da pessoa nele ----

Olá, posso falar com --A--first_name--B-- --A--last_name--B-- por favor? Olá --A--title--B-- --A--last_name--B-- como vai?

Isto vai aparecer como ----

Olá, posso falar com João da Silva por favor? Olá Sr. da Silva como vai?| +Active -<\/B> This determines whether this script can be selected to be used by a campaign|Ativo - Isto determina se o script pode ser selecionado para ser usado na campanha| +Campaign ID -<\/B> This is the short name of the campaign, it is not editable after initial submission, cannot contain spaces and must be between 2 and 8 characters in lengt|ID da Campanha - Este é o nome curto para a campanha, não é editável após cadastrado, não pode conter espaços e deve ter entre 2 e 8 caracteres de comprimento| +Campaign Name -<\/B> This is the description of the campaign, it must be between 6 and 40 characters in length|Nome da Campanha- Esta é a descrição da campanha, deve ter entre 6 e 40 caracteres de comprimento| +Active -<\/B> This is where you set the campaign to Active or Inactive. If Inactive, noone can log into it|Ativo - Aqui é onde você configura a campanha coma Ativa ou Inativa. Se Inativa, ninguem pode entrar nela| +Park Extension -<\/B> This is where you can customize the on-hold music for VICIDIAL. Make sure the extension is in place in the extensions.conf and that it points to the filename below|Exten do Estacionamento - Aqui é onde você pode customizar a musica em espera para o VICIDIAL. Tenha certeza que a extensão existe no extensions.conf e que aponta para o nome de arquivo abaixo| +Park File Name -<\/B> This is where you can customize the on-hold music for VICIDIAL. Make sure the filename is 10 characters in length or less and that the file is in place in the /var/lib/asterisk/sounds directory|Nome do arquivo de Estacionamento - Aqui é onde você pode customizar a musica em espera para o VICIDIAL. Tenha certeza que o nome do arquivo tem 10 ou menos caracteres de comprimento e que o arquivo está na pasta /var/lib/asterisk/sounds | +Web Form -<\/B> This is where you can set the custom web page that will be opened when the user clicks on the WEB FORM button|Formulário Web - Aqui é onde você configura a página web customizada que é aberta quando o usuário clica no botão WEB FORM| +Allow Closers -<\/B> This is where you can set whether the users of this campaign will have the option to send the call to a closer|Permitir Finalizadores - Aqui é onde você pode configurar se os usuários dessa campanha poderão ter a opção de enviar a chamada para um finalizador| +Dial Status -<\/B> This is where you set the statuses that you are wanting to dial on within the lists that are active for the campaign below|Status da Discagem - Aqui é onde você configura os status que você deseja discar nas listas ativas para a campanha abaixo| +List Order - This menu is where you select how the leads that match the statuses selected above will be put in the lead hopper|Ordem da Lista - Este menu é onde você seleciona como os registros nos status selecionados acima serão colocados no hopper| +select the first leads loaded into the vicidial_list table|selecione o primeiro registro carregado na tabela vicidial_list| +select the last leads loaded into the vicidial_list table|selecione o último registro carregado na tabela vicidial_list| +select the highest phone number and works its way down|seleciona o número de telefone mais alto e desce até o fim| +select the lowest phone number and works its way up|seleciona o telefone mais baixo e sube até o topo| +starts with last names starting with Z and works its way down|inicia com sobrenomes iniciando em Z e desce até o fim| +starts with last names starting with A and works its way up|inicia com sobrenomes iniciando em A e sobe até o inicio| +starts with most called leads and works its way down|inicia com registros mais chamados e vai até o fim| +starts with least called leads and works its way up inserting a NEW lead in every other lead - Must NOT have NEW selected in the dial statuses|inicia com registros menos chamados e vai até o começo inserindo registros NOVOS intercalados - Não deve ter selecionado NOVOS nos status de discagem| +starts with least called leads and works its way up inserting a NEW lead in every third lead - Must NOT have NEW selected in the dial statuses|inicia com registros menos chamados e vai até o começo inserindo um registro NOVO a cada três registros - Não deve ter NOVOS selecionado nos status de discagem| +starts with least called leads and works its way up inserting a NEW lead in every forth lead - Must NOT have NEW selected in the dial statuses|inicia com registros menos chamados e vai até o começo inserindo um registro novo a cada quatro registros - Não deve ter NOVOS selecionado nos status de discagem| +starts with least called leads and works its way up|inicia com registros menos chamados e vai até o começo| +Hopper Level -<\/B> This is how many leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute|Nível de Hopper - Aqui é onde fica configurado quantos registros o VDhopper mantém na tabela vicidial_hopper para esta campanha. Se estiver rodando VDhopper a cada minuto, tenha a garantia que é acima do número de registros discados por minuto| +Force Reset of Hopper -<\/B> This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs|Força Limpeza do Hopper - Isto permite que você limpe o conteúdo do hopper a partir do comando enviar da página. O hopper deve ser preenchido assim que o script do VDhopper for executado| +Auto Dial Level -<\/B> This is where you set how many lines VICIDIAL should use per active agent. zero 0 means auto dialing is off and the agents will click to dial each number. Otherwise VICIDIAL will keep dialing lines equal to active agents multiplied by the dial level to arrive at how many lines this campaign on each server should allow|Nível de Discagem Automática - Aqui deve ser configurado quantas linhas o VICIDIAL deve usar por agente ativo. Zero(0) significa que o discador automático está desligado e os agentes devem clicar para discar cada número. Caso contrário o VICIDIAL irá manter discando na quantidade de linhas igual ao número de agentes livres multiplicado pelo valor deste campo| +Next Agent Call -<\/B> This determines which agent receives the next call that is available|Próximo Agente - Isto determina qual agente recebe a próxima chamada disponível| +orders by the random update value in the vicidial_live_agents table|ordena por um número randômico de atualizações na tabela vicidial_live_agents | +orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall|ordena pela última vez que um agente recebeu uma chamada. Resulta nos agentes recebendo uma média igual de chamadas| +orders by the last time an agent finished a call. AKA agent waiting longest receives first call|ordena pela última vez que um agente finalizou uma chamada. Também conhecido como agente que está mais tempo esperando cliente, recebe a primeira chamada| +Local Call Time -<\/B> This is where you set during which hours you would like to dial, as determined by the local time in the are in which you are calling. This is controlled by area code and is adjusted for Daylight Savings time if applicable. General Guidelines in the USA for Business to Business is 9am to 5pm and Business to Consumer calls is 9am to 9pm|Horário de chamada local - Aqui é onde se configura o horário que se deseja discar, conforme determinação do horário no local para o qual está se discando. Isto é controlado por código de área e é ajustado para o horário de verão caso esteja em vigor. A recomendação para os EUA é de empresa para empresa, das 9:00 as 17:00 e da empresa para consumidor, das 9:00 as 21:00| +Voicemail -<\/B> If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message|Correio de Voz - Se configurado, as chamadas que normalmente seriam derrubadas por falta de agente, serão transferidas para esse Correio de Voz, irão ouvir uma mensagem e poderão gravar um recado| +Dial Timeout -<\/B> If defined, calls that would normally hang up after the timeout defined in extensions.conf would instead timeout at this amount of seconds if it is less than the extensions.conf timeout. This allows for quickly changing dial timeouts from server to server and limiting the effects to a single campaign. If you are having a lot of Answering Machine or Voicemail calls you may want to try changing this value to between 21-26 and see if results improve|Tempo excedido de discagem - Se configurado, as chamadas que normalmente seriam desligadas após o tempo definido no extensions.conf serão desligadas no tempo configurado aqui, caso este valor seja menor do que o do extensions.conf. Isso permite que rapidamente sejam alterados os timeouts por campanha e que a configuração seja igual para todos os servidores. Se você está recebendo muitas chamadas de secretária eletrônica ou correio de voz, pode tentar mudar esse valor para valores entre 21 e 26 e verifique se melhora| +Dial Prefix -<\/B> This field allows for more easily changing a path of dialing to go out through a different method without doing a reload in Asterisk. Default is 9 based upon a 91NXXNXXXXXX in the dial plan - extensions.conf|Prefixo de Discagem - Este campo permite que facilmente configuremos o caminho de discagem sem precisar alteração de configurações de servidor e sem precisar recarregar o Asterisk. O padrão é 9 baseado em 91NXXNXXXXXX no plano de discagem - extensions.conf| +Campaign CallerID -<\/B> This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service -RBS- circuits. This will also work through most VOIP -SIP or IAX trunks- providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID|CallerID da Campanha- Este campo permite que seja enviado um número customizado de CallerID nas chamadas saintes. Este número irá ser mostrado no Identificador da pessoa que você está chamando. O padrão é UNKNOWN. Se você está usando T1 ou E1 para discar esta opção está disponível apenas se estiver usando PRIs - ISDN T1 ou E1 - que tenham o recurso de customizar o callerID habilitados, isso nao irá funcionar em circuitos RBS (Robbed-bit Service). Isto também funciona na maioria dos provedores SIP ou IAX que permitem customizar callerID. O callerID customizado se aplica apenas a chamadas feitas por campanhas VICIDIAL diretamente, qualquer chamadas de terceiros ou transferências nao receberá o callerID customizado. ATENÇÃO: algumas vezes colocando-se UNKNOWN ou PRIVATE neste campo pode causar que seja enviado o callerID da sua operadora. Você pode testar isso colocando 00000000000 no campo callerid se você nao quer enviar seu CallerID | +Campaign VDAD extension -<\/B> This field allows for a custom VDAD transfer extension. This allows you to use different VDADtransfer...agi scripts depending upon your campaign. The default transfer AGI - exten 8365 agi-VDADtransfer.agi - just immediately sends the calls on to agents as soon as they are picked up. An additional sample political survey AGI is also now included - 8366 agi-VDADtransferSURVEY.agi - that plays a message to the called person and allows them to make a choice by pressing buttons - effectively pre-screening the lead - . Please note that except for surveys, political calls and charities this form of calling is illegal in the United States|Extensão da campanha VDAD - Este campo permite uma customização na extensão de transferencia. Isso permite que você configure scripts VDADtransfer...agi diferentes dependendo da campanha. A extensão padrão de transferência AGI - 8365 - apenas envia imediatamente as chamadas para os agentes assim que elas são atendidas. Um exemplo adicional de pesquisa política agora também incluída - 8366 agi-VDADtransferSURVEY.agi - que toca uma mensagem para a pessoa chamada e permite que ele faça uma escolha pressionando botões - fazendo uma pre-filtragem no registro -. Atenção: com exceção de pesquisas, propaganda política e de caridade, este tipo de chamada é ilegal nos EUA. Verifique a legalidade no seu país| +Campaign Rec extension -<\/B> This field allows for a custom recording extension to be used with VICIDIAL. This allows you to use different extensions depending upon how long you want to allow a maximum recording and what type of codec you want to record in. The default exten is 8309 which if you follow the SCRATCH_INSTALL examples will record in the WAV format for upto one hour. Another option included in the examples is 8310 which will record in GSM format for upto one hour|Extensão de Gravação - Este campo permite que se use uma extensão de gravação customizada com o VICIDIAL. Isto permite que sejas usadas extensões diferentes dependendo de quanto tempo máximo você quer permitir uma gravação e que tipo de codec você quer usar. A extensão padrão é 8309 a qual, se você seguiu os exemplos do SCRATCH_INSTALL irá gravar as chamadas no formato WAV até uma hora. Outra opção incluida nos exemplos é 8310 que irá gravar no formato GSM até uma hora| +Campaign Recording -<\/B> This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent|Gravação da Campanha - Este menu permite selecionar qual o nível de gravação é permitido nesta campanha. NEVER irá desabilitar a gravação pele client. ONDEMAND é o padrão e permite que o agente inicie e pare a gravação conforme for preciso. ALLCALLS inicia a gravação pelo client quando uma chamada é enviada para o agente| +Campaign Rec Filename -<\/B> This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212|Nome do Arquivo de Gravação - Este campo permite que seja customizado o nome do arquivo de gravação quando a configuração de gravação da campanha esteja em ONDEMAND ou ALLCALLS. As variáveis permitidas sao CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. O padrão é FULLDATE_AGENT e se parece assim: 20051020-103108-6666. Outro exemplo é CAMPAIGN_TINYDATE_CUSTPHONE que se parece assim: TESTCAMP_51020103108_312551212| +Campaign Script -<\/B> This menu allows you to choose the script that will appear on the agents screen for this campaign. Select NONE to show no script for this campaign|Script da Campanha - Este menu permite que seja escolhido um script que irá aparecer na tela do agente para essa campanha. Selecione NONE para não mostrar scripts para esta campanha| +Get Call Launch -<\/B> This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign|Abrir com Chamada - Este menu permite que seja escolhido se você deseja abrir automaticamente a pagina web em uma janela separada, abrir a aba SCRIPT ou nao fazer nada quando uma chamada é enviada ao agente para esta campanha| +Answering Machine Message -<\/B> This field is for entering in an extension to blind transfer calls to when the agent gets an answering machine and clicks on the Answering Machine Message button in the transfer conference frame. You must set this exten up in the dial plan - extensions.conf - and make sure it plays an audio file then hangs up|Mensagem da Secretária Eletrônica - Este campo é para ser digitado uma extensão para onde deverão ser transferidas as chamadas que caem em secretárias eletrônicas e que o Agente clica no botão Answering Machine Message no frame de transferência/Conferência. Você deve configurar esta extensão no plano de discagem - extensions.conf - e ter certeza que ele toca um arquivo de audio e então desliga| +List ID -<\/B> This is the numerical name of the list, it is not editable after initial submission, must contain only numbers and must be between 2 and 8 characters in length|ID da Lista - Este é o nome numérico da lista, não é editável após a confirmação do cadastro, deve conter somente numeros e deve ter entre 2 e 8 caracteres de comprimento| +List Name -<\/B> This is the description of the list, it must be between 2 and 20 characters in length|Nome da Lista - Esta é a descrição da lista, deve ter entre 2 e 20 caracteres de comprimento| +Campaign -<\/B> This is the campaign that this list belongs to. A list can only be dialed on a single campaign at one time|Campanha - Este é a campanha que esta lista pertence. Uma lista só pode ser discada por uma campanha de cada vez| +Active -<\/B> This defines whether the list is to be dialed on or not|Ativo - Indica se a lista é para ser discada ou não| +Reset Lead-Called-Status for this list -<\/B> This resets all leads in this list to N for \"not called since last reset\" and means that any lead can now be called if it is the right status as defined in the campaign screen|Zerar Status de chamada dos registros desta lista - Zera todos os registros desta lista colocando N para \"not called since last reset"\ e significa que qualquer registro pode ser discado agora se for do status conforme configurado na tela da campanha| +Group ID -<\/B> This is the short name of the inbound group, it is not editable after initial submission, must not contain any spaces and must be between 2 and 20 characters in length|ID do Grupo - Nome curto do grupo de entrada, não é editável após confirmação, não deve conter qualquer espaços e deve ter entre 2 e 20 caracteres de comprimento| +Group Name -<\/B> This is the description of the group, it must be between 2 and 30 characters in length. Cannot include dashes, plusses or spaces|Nome do Grupo - Descrição do grupo, deve ter entre 2 e 30 caracteres de comprimento. Não pode incluir os caracteres - + ou espaço| +Group Color -<\/B> This is the color that displays in the VICIDIAL client app when a call comes in on this group. It must be between 2 and 7 characters long. If this is a hex color definition you must remember to put a # at the beginning of the string or VICIDIAL will not work properly|Cor do Grupo - Cor mostrada no aplicativo client do VICIDIAL quando uma chamada entra para este grupo. Deve ser entre 2 e 7 caracteres de comprimento. Se for uma definição de cor em hexadecimal, você deve lembrar de colocar o # no começo ou o VICIDIAL não vai funcionar corretamente| +Active -<\/B> This determines whether this group show up in the selection box when a VICIDIAL agent logs in|Ativo - Indica se o grupo será mostrado na caixa de seleção quando o agente do VICIDIAL efetua logon | +Web Form -<\/B> This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this group|Formulário Web - Endereço customizado para o qual o botão WEB FORM no VICIDIAL leva quando clicado, nas chamadas que entram para este grupo| +Voicemail -<\/B> If defined, this is the Voicemail box that calls will go to instead of being dropped if no agents are available after the hold time is up|Correio de Voz - Se definido, este é o endereço do Correio de Voz para o qual as chamadas são direcionadas ao invés de serem derrubadas quando não existem agentes livres após o tempo de espera| +Fronter Display -<\/B> This field determines whether the inbound VICIDIAL agent would have the fronter name - if there is one - displayed in the Status field when the call comes to the agent|Exibição do Primário - Este campo determina se uma chamada entrante para o agente VICIDIAL deve ter o nome do agente primário, se existir, exibido no campo status da tela quando uma chamada é transferida para o agente| +User ID Start -<\/B> This is the starting User ID that is used when the remote agent entries are inserted into the system. If the Number of Lines is set higher than 1, this number is incremented by one until each line has an entry. Make sure you create a new VICIDIAL user account with a user level of 4 or great if you want them to be able to use the vdremote.php page for remote web access of this account|Início do ID do usuário - Esta é a ID inicial que será usada quando um agente remoto for cadastrado no sistema. Se o número de linhas estiver configurado maior que 1, este número é incrementado por um até cada linha ter sua entrada. Tenha certeza que você criou uma nova conta de usuário VICIDIAL com nível 4 ou superior se você quer que eles sejam capazes de usar a página vdremote.php para acesso remoto a esta conta| +Number of Lines -<\/B> This defines how many remote agent entries the system creates, and determines how many lines it thinks it can safely send to the number below|Número de Linhas - Define quantas entradas de usuários remotos o sistema deve criar, e determina quantas linhas podem ser enviadas com segurança para o número abaixo| +Server IP -<\/B> A remote agent entry is only good for one specific server, here is where you select which server you want|IP do Servidor - Um cadastro de agente remoto só funciona em um servidor, aqui é onde você seleciona qual servidor| +External Extension -<\/B> This is the number that you want the calls forwarded to. Make sure that it is a full dial plan number and that if you need a 9 at the beginning you put it in here. Test by dialing this number from a phone on the system|Extensão Externa - Este é o número para o qual você quer que as chamadas sejam direcionadas. Tenha certeza que é um número completo do plano de discagem e que se você precisa de um 9 no começo, você o coloca aqui. Teste discando o número de um fone no sistema| +Status -<\/B> Here is where you turn the remote agent on and off. As soon as the agent is Active the system assumes that it can send calls to it. It may take up to 30 seconds once you change the status to Inactive to stop receiving calls|Status - Aqui é onde você desliga ou liga o agente remoto. Assim que o agente está ativo, o sistema entende que ele pode receber chamadas. Pode demorar até 30 segundos após a mudança do status para Inactive para parar de receber chamadas| +Campaign -<\/B> Here is where you select the campaign that these remote agents will be logged into. Inbound needs to use the CLOSER campaign and select the inbound campaigns below that you want to receive calls from|Campanha - Aqui é onde você escolhe a campanha que este agente remoto deve ser logado. Chamadas entrantes precisam usar uma campanha CLOSER e selecionar uma campanha entrante abaixo para que você receba chamadas| +Inbound Groups -<\/B> Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign|Grupos de entrada - Aqui é selecionado o grupo de entrada do qual você quer receber chamadas se você selecionou uma campanha CLOSER(finalização)| +The lists within this campaign are listed here, whether they are active is denoted by the Y or N and you can go to the list screen by clicking on the list ID in the first column|As listas dentro desta campanha são listadas aqui, estando ativas ou desativadas será demonstrado por Y ou N e você pode ir para a tela de cadastro de listas clicando no Id na primeira coluna| +Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition|Através do uso de status de campanha customizados, você pode ter status que somente existem para uma campanha específica. Os Status devem ter entre 1 e 8 caracteres de comprimento, a descrição deve ter entre 2-30 caracteres de comprimento e "Selectable" determina se será mostrado no VICIDIAL como um resultado| +Through the use of custom campaign hot keys, agents that use the vicidial web-client can hang up and disposition calls just by pressing a single key on their keyboard|Através do uso de atalhos de teclado customizados por campanha, agentes que usam o web-client do vicidial podem desligar e classificar uma chamada pressionando uma tecla do teclado| +User Group -<\/B> This is the short name of a Vicidial User group, try not to use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters|Grupo de usuário - É o nome curto do grupo de usuários do Vicidial, tente não usar espaços ou caracteres especias neste campo. Máximo de 20 caracteres e mínimo de 2| +Group Name -<\/B> This is the description of the vicidial user group max of 40 characters|Nome do Grupo - Esta é a descrição do grupo de usuários do vicidial, máximo de 40 caracteres| +Xfer-Conf DTMF -<\/B> These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed|Xfer-Conf DTMF - Estes quatro campos permitem que se tenha dois conjuntos de Transferência/Conferência e DTMF pré gravados. Quando uma chamada ou campanha é carregada, o vicidial.php irá mostrar dois botoes de transferência-conferência e preencher os campos number-to-dial e send-dtmf quando pressionados| +AMD send to vm exten -<\/B> This menu allows you to define whether a message is left on an answering machine when it is detected. the call will be immediately forwarded to the Answering-Machine-Message extension if AMD is active and it is determined that the call is an answering machine|AMD envia para exten correio de voz- Este menu permite definir se uma mensagem deve ser deixada na secretária eletrônica quando é detectada. A chamada irá imediatamente ser direcionada para a extensão se o AMD estiver ativo e determinar que é uma secretária eletrônica| +Modify Leads -<\/B> This option if set to 1 allows the user to modify leads in the admin section lead search results page|Modificar Registros - Esta opção quando configurada permite ao usuário modificar registros na página de pesquisa do site admin| +Hot Keys Active -<\/B> This option if set to 1 allows the user to use the Hot Keys quick-dispositioning function in|Atalhos Ativos - Esta opção quando configurada, permite ao usuário usar atalhos de teclado para classificação da chamada| +Change Agent Campaign -<\/B> This option if set to 1 allows the user to alter the campaign that an agent is logged into while they are logged into it|Trocar Campanha do Agente - Esta opção quando configurada, permite ao usuário trocar a campanha em que um agente está logado no sistema sem que haja necessidade de sair do sistema| +Agent Choose Ingroups -<\/B> This option if set to 1 allows the user to choose the ingroups that they will receive calls from when they login to a CLOSER or INBOUND campaign. Otherwise the Manager will need to set this in their user detail screen of the admin page|Agente Escolhe Grupos de Entrada - Esta opção com valor 1, permite ao usuário escolher os grupos de entrada que quer receber chamadas quando fazem sogon em uma campanha CLOSER ou INBOUND. Caso contrário, o Gerente vai precisar configurar isto na tela de detalhes do cadastro de usuários no site admin| +Lead Filter -<\/B> This is a method of filtering your leads using a fragment of a SQL query. Use this feature with caution, it is easy to stop dialing accidentally with the slightest alteration to the SQL statement. Default is NONE|Filtro de Registros - Este é um método de filtrar os registros usando um fragmento de uma query SQL. Use este recurso com cuidado, é fácil parar de discar acidentalmente com uma pequena alteração no comando SQL. O padrão é NONE| +Filter ID -<\/B> This is the short name of a Vicidial Lead Filter. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters|ID do filtro - É o nome curto para o filtro de registros. Precisa ser um identificador único. Não use espaços ou caracteres especiais para este campo. Máximo de 10 caracteres e mínimo de 2 caracteres| +Filter Name -<\/B> This is a more descriptive name of the Filter. This is a short summary of the filter. max 30 characters, minimum of 2 characters|Nome do Filtro - É um nome mais descritivo para o filtro. É um resumo da função do filtro. Máximo de 30 caracteres, mínimo de 2 caracteres| +Filter Comments -<\/B> This is where you can place comments for a Vicidial Filter such as -calls all California leads-. max 255 characters, minimum of 2 characters|Comentários do Filtro - Aqui é onde são colocados comentários para um Filtro Vicidial como por exemplo -liga para todos os registros da California-. Máximo de 255 caracteres, mínimo de 2 caracteres| +Filter SQL -<\/B> This is where you place the SQL query fragment that you want to filter by. do not begin or end with an AND, that will be added by the hopper cron script automatically. an example SQL query that would work here is- called_count \> 4 and called_count \< 8 -|Filtro SQL - É onde colocamos o fragmento da consulta SQL que você deseja usar para filtrar. Não inicie nem termine com AND, isso será adicionado pelo script do hopper automaticamente. Um exemplo de consulta SQL que funcionaría é: called_count \> 4 and called_count \<8 | +Agent Alt Num Dialing -<\/B> This option allows an agent to manually dial the alternate phone number or address3 field after the main number has been called|Discagem para Número Alt. - Permite que um agente manualmente disque para o telefone alternativo ou campo address3 após o número principal tenha sido discado| +Scheduled Callbacks -<\/B> This option allows an agent to disposition a call as CALLBK and choose the data and time at which the lead will be re-activated|Chamadas Agendadas - Permite um agente classificar uma chamada como CALLBK e escolher uma data e hora na qual deseja que o registro seja discado| +Agent-Only Callbacks -<\/B> This option allows an agent to set a callback so that they are the only Agent that can call the customer back. This also allows the agent to see their callback listings and call them back any time they want to|Chamada Agendada por Agente - Permite que um agente configure uma chamada agendada com fidelização, assim ela retorna somente para ele. Isso também permite ao agente ver a sua lista de agendamentos e os chamar qualquer hora que desejem| +Agent Call Manual -<\/B> This option allows an agent to manually enter a new lead into the system and call them. This also allows the calling of any phone number from their vicidial screen and puts that call into their session. Use this option with caution|Agente com Chamada Manual- Permite que um agente manualmente adicione um novo registro ao sistema e comande a discagem. Isso também permite que seja comandado a discagem de qualquer número na tela do vicidial e a coloque na sua sessão. Use esta opção com cautela| +Vicidial Recording -<\/B> This option can prevent an agent from doing any recordings after they log in to vicidial. This option must be on for vicidial to follow the campaign recording session|Gravação do Vicidial - Esta opção previne um agente de fazer qualquer gravação após ter entrado no vicidial. Esta opção deve estar ligada para que o vicidial grave as chamadas da campanha | +Vicidial Transfers -<\/B> This option can prevent an agent from opening the transfer - conference session of vicidial. If this is disabled, the agent cannot third party call or blind transfer any calls|Transferências Vicidial - Esta opção pode previnir que um agente abra a sessão de transferência/conferência do vicidial. Se estiver desabilitada, o agente não poderá transferir ou incluir um terceiro na chamada| +Delete Filters -<\/B> This option allows the user to be able to delete vicidial lead filters from the system|Apagar Filtros - Esta opção permite que o usuário possa apagar filtros de registro no sistema vicidial| +Alter Agent Interface Options -<\/B> This option if set to 1 allows the administrative user to modify the Agents interface options in admin.php|Alterar Opções da Interface do Agente - Esta opção quando configurada como 1 permite ao usuário administrativo modificar a interface do agente no admin.php| +Closer Default Blended -<\/B> This option simply defaults the Blended checkbox on a CLOSER login screen|Padrão Mesclado para Finalizador - Esta opção simplesmente marca ou nao o checkbox de Mesclado(blended) no login da campanha Finalizador (closer)| +FILTER NOT ADDED - there is already a filter entry with this ID|FILTRO NÃO ADICIONADO - já existe um filtro com esse ID| +Filter ID, name and SQL must be at least 2 characters in length|ID do Filtro, nome e SQL devem ter pelo menos 2 caracteres de comprimento| +Filter ID must be at least 2 characters in length|ID do filtro deve ter pelo menos 2 caracteres de comprimento| +Please go back and look at the data you entered|Por favor, volte e verifique os dados digitados| +CLICK HERE TO GO TO THE SUPER LEAD LOADER|CLIQUE AQUI PARA IR PARA O SUPER CARREGADOR DE REGISTROS| +BACK TO ADMIN|VOLTAR PARA ADMIN| +File layout to use|Layout do arquivo a usar| +Standard VICIDIAL|Padrão VICIDIAL| +Custom layout|Layout Customizado| +CLICK HERE TO GO TO THE BASIC LEAD LOADER|CLIQUE AQUI PARA IR PARA O CARREGADOR BÁSICO DE REGISTROS| +SUPER LIST LOADER|SUPER CARREGADOR DE LISTA| +OK TO PROCESS|OK PARA PROCESSAR| +File data|Dados do arquivo| +short description of the filter|descrição simples do filtro| +Alter Agent Interface Options: |Alterar opções da Interface do Agente:| +Click here to delete filter |Clique aqui para apagar o filtro| +FILTER DELETION COMPLETED:|REMOÇÃO DO FILTRO COMPLETADA| +ADMIN INTERFACE OPTIONS:|OPÇÕES DA INTERFACE ADMIN:| +AGENT INTERFACE OPTIONS:|OPÇÕES DA INTERFACE DO AGENTE:| +Closer Default Blended:|Finalizador Padrão como Mesclado:| +Agent Alt Num Dialing:|Discagem do Número Alternativo pelo Agente:| +Scheduled Callbacks:|Agendamento de Chamadas:| +Agent-Only Callbacks:|Agendamento de Chamadas com Fidelização:| +New Filter Addition|Novo Filtro| +LEAD FILTER LISTINGS:|Listagem de Filtros de Registro:| +FILTER NOT MODIFIED|FILTRO NÃO ALTERADO| +FILTER NOT DELETED|FILTRO NÃO REMOVIDO| +DELETE THIS FILTER|APAGAR ESTE FILTRO| +FILTER NOT ADDED|FILTRO NAO ADICIONADO| +Filter Comments: |Comentários do filtro: | +FILTER MODIFIED|FILTRO ALTERADO| +MODIFY A FILTER|ALTERAR FILTRO| +ADD NEW FILTER|INCLUIR NOVO FILTRO| +Add New Filter|Incluir Novo Filtro| +Modify Filter|Alterar Filtro| +Delete Filter|Apagar Filtro| +Filter Name: |Nome do Filtro:| +FILTER ADDED:|FILTRO CRIADO:| +VIEW FILTERS|LISTAR FILTROS| +Lead Filter:|Filtrar Registros:| +Filter SQL:|Filtro SQL:| +Users List|Lista de Usuários| +Filter ID: |ID do Filtro:| +Filters|Filtros| +Agent Call Manual|Agente Manual| +Vicidial Recording|Gravação do Vicidial| +Vicidial Transfers|Transferências do Vicidial| +Click here for user time sheet|Clique aqui para a planilha de tempo do usuário| +Click here for user status|Clique aqui para o status do usuário| +Click here for user CallBack Holds|Clique aqui para os registros de Chamada Agendada do usuário| +Lead Filter|Filtro de registros| +Click here to see all CallBack Holds in this campaign|Clique aqui para visualizar todos os registros de Chamada Agendada para esta campanha| +STATUS NAME|NOME DO STATUS| +Script ID|ID do Script| +Script Name|Nome do Script| +Script Comments|Comentários do Script| +Script Text|Texto do Script| +ADD FILTER|INCLUIR FILTRO| +overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls|overall_user_level: ordena pelo nível do usuário do agente conforme definido na tabela vicidial_users, um valor mais alto irá receber mais chamadas| +VICIDIAL LIST LOADER FUNCTIONALITY|FUNCIONALIDADE DE CARREGADOR DE LISTA DO VICIDIAL| +The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. There is also a new beta version super lead loader that allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation or check for duplicates in itself or other lists, so that is something you need to do before you load the leads. Also, make sure that you have created the list that these leads are to be under so that you can use them. There is also the matter of time-zone-coding these leads. You may want to increase the frequency that the ADMIN_adjust_GMTnow_on_leads.pl is being run in the cron on your Asterisk server so that any loaded leads can be coded faster. Here is a list of the fields in their proper order for the lead files|O carregador de registros baseado em web do VICIDIAL foi projetado simplesmente para carregar um arquivo, de até 8MB, delimitado por tab ou pipe e carregar na tabela vicidial_list. Existe tambéma uma nova versão beta do super carregador de registros que permite escolher campos e os formatos TXT - Texto simples, CSV - Valores Separados por Vírgula, e XLS - Excel. O carregador de registros não valida dados e não verifica duplicidades no próprio arquivo ou em outras listas, isso é algo que deve ser feito antes de carregar os registros. Também tenha certeza que você criou a lista na qual esses registros vão ser carregados para que possa usá-los. Existe também um fator de fuso horário dos registros. Você pode ajustar a frequencia em que o script ADMIN_adjust_GMTnow_on_leads.ps é executado no cron do seu servidor Asterisk para que os registros possam ser codificados com o fuso horário mais rapidamente. Aqui está a lista de campos e sua ordem para os campos do arquivo de registro| +NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /home/cron/AST_SERVER_conf.pl file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file|AVISO: A funcionalidade de carregar arquivos Excel é habilitada por uma série de scripts perl e precisa ser configurada de forma correta no arquivo /home/cron/AST_SERVER_conf.pl do servidor. Também, alguns módulos perl devem ser carregados para que funcione corretamente, OLE-Storage_Lite e Spreadsheet-ParseExcel. Você pode verificar erros de execução deles no arquivo de log de erros do apache | +Vendor Lead Code - shows up in the Vendor ID field of the GUI|Código do Vendedor no Registro - é mostrado no campo Vendor ID na tela do agente| +Source Code - internal use only for admins and DBAs|Código Fonte - uso interno, somente para admins e DBAs| +List ID - the list number that these leads will show up under|ID da Lista - número da lista em que esses registros vão ser carregados| +Phone Code - the prefix for the phone number - 1 for US, 01144 for UK, 01161 for AUS, etc|Código do Telefone - prefixo do número do telefone - 1 para EUA, 01144 para Reino Unido, 01161 para Australia, 55 para Brasil, etc| +Phone Number - must be at least 8 digits long|Número do telefone - deve ter pelo menos 8 digitos| +Title - title of the customer - Mr. Ms. Mrs, etc...|Título - título do cliente(Sr. Sra. Srta., etc...)| +NOTE: It can take up to 30 seconds for changes submitted on this screen to go live|AVISO: Pode demorar até 30 segundos para que as alterações enviadas por essa tela se tornem ativas| +USER NOT ADDED - there is already a user in the system with this user number|USUÁRIO NÃO ADICIONADO - já existe um usuário no sistema com esse número| +USER NOT ADDED - Please go back and look at the data you entered|USUÁRIO NÃO ADICIONADO - Por favor volte e verifique os dados digitados| +user id must be between 2 and 8 characters long|A ID do usuário deve ter entre 2 e 8 caracteres de comprimento| +full name and password must be at least 2 characters long|nome completo e senha devem ter pelo menos 2 caracteres de comprimento| +CAMPAIGN NOT ADDED - there is already a campaign in the system with this ID|CAMPANHA NÃO ADICIONADA - já existe uma campanha com esse ID no sistema| +CAMPAIGN NOT ADDED - Please go back and look at the data you entered|CAMPANHA NÃO ADICIONADA - Por favor volte e verifique os dados digitados| +campaign ID must be between 2 and 8 characters in length|ID da campanha deve ter entre 2 e 8 caracteres de comprimento| +campaign name must be between 6 and 40 characters in length|o nome da campanha deve ter entre 6 e 40 caracteres de comprimento| +CAMPAIGN STATUS NOT ADDED - there is already a campaign-status in the system with this name|STATUS DE CAMPANHA NAO ADICIONADO - já existe um status/campanha no sistema com esse nome| +CAMPAIGN STATUS NOT ADDED - there is already a global-status in the system with this name|STATUS DE CAMPANHA NÃO ADICIONADO - já existe um status global do sistema com esse nome| +CAMPAIGN STATUS NOT ADDED - Please go back and look at the data you entered|STATUS DE CAMPANHA NÃO ADICIONADO- Por favor volte e verifique os dados digitados| +status must be between 1 and 8 characters in length|status deve ter entre 1 e 8 caracteres de comprimento| +status name must be between 2 and 30 characters in length|nome do status deve ter entre 2 e 30 caracteres de comprimento| +CAMPAIGN HOT KEY NOT ADDED - there is already a campaign hot key in the system with this hot key|TECLA DE ATALHO DA CAMPANHA NÃO ADICIONADA - já existe uma tecla de atalho no sistema com a mesma tecla| +CAMPAIGN HOT KEY NOT ADDED - Please go back and look at the data you entered|TECLA DE ATALHO DA CAMPANHA NÃO ADICIONADA - Por favor volte e verifique os dados digitados| +hot key must be a single character between 1 and 9|a tecla de atalho deve ser um caracter entre 1 e 9| +LIST NOT ADDED - there is already a list in the system with this ID|LISTA NÃO ADICIONADA - já existe uma lista no sistema com essa ID| +LIST NOT ADDED - Please go back and look at the data you entered|LISTA NÃO ADICIONADA - por favor volte e verifique os dados digitados| +List ID must be between 2 and 8 characters in length|A ID da lista deve ter entre 2 e 8 caracteres de comprimento| +List name must be at least 2 characters in length|O Nome da Lista deve ter até 2 caracteres de comprimento| +GROUP NOT ADDED - there is already a group in the system with this ID|GRUPO NÃO ADICIONADO - já existe um grupo com essa ID no sistema| +GROUP NOT ADDED - Please go back and look at the data you entered|GRUPO NÃO ADICIONADO - por favor volte e verifique os dados digitados| +Group ID must be between 2 and 20 characters in length and contain no|A ID do grupo deve ter entre 2 e 20 caracteres de comprimento| +Group name and group color must be at least 2 characters in length|O nome e a cor do grupo devem ter pelo menos 2 caracteres de comprimento| +REMOTE AGENTS NOT ADDED - there is already a remote agents entry starting with this userID|AGENTES REMOTOS NÃO ADICIONADOS - já existe um usuário remoto com esse ID no sistema| +REMOTE AGENTS NOT ADDED - Please go back and look at the data you entered|AGENTES REMOTOS NÃO ADICIONADOS - Por favor volte e verifique os dados digitados| +User ID start and external extension must be at least 2 characters in length|Início da ID e extensão externa devem ter no mínimo 2 caracteres de comprimento| +USER GROUP NOT ADDED - there is already a user group entry with this name|GRUPO DE USUÁRIO NÃO ADICIONADO - já existe um grupo de usuários com este nome| +USER GROUP NOT ADDED - Please go back and look at the data you entered|GRUPO DE USUÁRIOS NÃO ADICIONADO - Por favor volte e verifique os dados digitados| +Group name and description must be at least 2 characters in length|Nome e descrição do grupo devem ter pelo menos 2 caracteres de comprimento| +USER NOT MODIFIED - Please go back and look at the data you entered|USUÁRIO NÃO ALTERADO - Por favor volte e verifique os dados digitados| +Password and Full Name each need ot be at least 2 characters in length|Senha e Nome Completo devem ter no mínimo 2 caracteres de comprimento| +RESETTING CAMPAIGN LEAD HOPPER|REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA| +CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered|CAMPANHA NÃO ALTERADA - Por favor volte e verifique os dados digitados| +the campaign name needs to be at least 6 characters in length|o nome da campanha precisa ter no mínimo 6 caracteres de comprimento| +Wait 1 minute before dialing next number|Aguarde 1 minuto antes de discar o próximo número| +CAMPAIGN STATUS NOT MODIFIED - Please go back and look at the data you entered|STATUS DA CAMPANHA NÃO ALTERADO - Por favor retorne e verifique os dados digitados| +the campaign id needs to be at least 2 characters in length|o id da campanha precisa ter no mínimo 2 caracteres de comprimento| +the campaign status needs to be at least 1 characters in length|o status da campanha precisa ter no mínimo 1 caracter de comprimento| +CUSTOM CAMPAIGN STATUS DELETED|STATUS CUSTOMIZADO DA CAMPANHA REMOVIDO| +CAMPAIGN HOT KEY NOT MODIFIED - Please go back and look at the data you entered|ATALHO DE TECLADO DA CAMPANHA NÃO ALTERADO - Por favor volte e verifique os dados digitados| +the campaign hot key needs to be at least 1 characters in length|o atalho de teclado da campanha precisa ter no mínimo 1 caracter de comprimento| +CUSTOM CAMPAIGN HOT KEY DELETED|ATALHO DE TECLADO DA CAMPANHA REMOVIDO| +CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered|CAMPANHA NÃO ALTERADA - Por favor volte e verifique os dados digitados| +the campaign name needs to be at least 6 characters in length|o nome da campanha precisa ter no mínimo 6 caracteres de comprimento| +LIST NOT MODIFIED - Please go back and look at the data you entered|LISTA NÃO ALTERADA - Por favor volte e verifique os dados digitados| +list name must be at least 2 characters in length|o nome da lista precisa ter no mínimo 2 caracteres de comprimento| +REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER|REMOVENDO REGISTROS HOPPERS DO HOPPER DA CAMPANHA ANTIGA| +GROUP NOT MODIFIED - Please go back and look at the data you entered|GRUPO NÃO ALTERADO - Por favor volte e verifique os dados digitados| +group name and group color must be at least 2 characters in length|a cor e o nome do grupo deve ter pelo menos 2 carcteres| +REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered|AGENTES REMOTOS NÃO ALTERADOS - Por favor volte e verifique os dados digitados| +User ID Start and External Extension must be at least 2 characters in length|O início do ID e a Extensão Externa deve ter pelo menos 2 caracteres de comprimento| +REMOTE AGENTS MODIFIED|AGENTES REMOTOS ALTERADOS| +USER GROUP NOT MODIFIED - Please go back and look at the data you entered|GRUPO DE USUÁRIOS NÃO MODIFICADO - Por favor volte e verifique os dados digitados| +Group name and description must be at least 2 characters in length|O nome e a descrição do grupo devem ter pelo menos 2 caracteres de comprimento| +MODIFY A USERS RECORD|ALTERAR REGISTRO DE USUÁRIO| +Click here for user stats|Clique aqui para ver o status do usuário| +MODIFY A CAMPAIGNS RECORD|MODIFICAR REGISTRO DE CAMPANHA| +CONFERENCES TABLE|TABELA DE CONFERÊNCIAS| +Conference Number -<\/B> This field is where you put the meetme conference dialpna number. It is also recommended that the meetme number in meetme.conf matches this number for each entry. This is for the conferences in astGUIclient and is used for leave-3way-call functionality in VICIDIAL|Número da Conferência - Este é o campo onde deve ser colocado o número do plano de discagem da conferência. Também é recomendado que o número da conferência esteja também no arquivo meetme.conf. É usado para as conferências do astGUIclient e para funcionalidade de chamada a três no VICIDIAL| +Server IP -<\/B> The menu where you select the Asterisk server that this conference will be on|IP do Servidor - Deve ser selecionado qual servidor Asterisk esta conferência está configurada| +PHONE NOT ADDED - there is already a Phone in the system with this extension\/server|RAMAL NÃO ADICIONADO - já existe um Ramal no sistema com essa extensão\/servidor| +PHONE NOT ADDED - Please go back and look at the data you entered|RAMAL NÃO ADICIONADO - Por favor volte e verifique os dados digitados| +PHONE ADDED|RAMAL ADICIONADO| +SERVER NOT ADDED - there is already a server in the system with this ID|SERVIDOR NÃO ADICIONADO - já existe um servidor no sistema com essa ID| +SERVER NOT ADDED - Please go back and look at the data you entered|SERVIDOR NÃO ADICIONADO - por favor volte e verifique os dados digitados| +SERVER ADDED|SERVIDOR ADICIONADO| +CONFERENCE NOT ADDED - there is already a conference in the system with this ID and server|CONFERÊNCIA NÃO ADICIONADA - já existe no sistema uma conferência com este ID e servidor| +CONFERENCE NOT ADDED - Please go back and look at the data you entered|CONFERÊNCIA NÃO ADICIONADA - Por favor volte e verifique os dados digitados| +CONFERENCE ADDED|CONFERÊNCIA ADICIONADA| +PHONE NOT MODIFIED - there is already a Phone in the system with this extension\/server|RAMAL NÃO MODIFICADO - já existe no sistema um ramal com esta extensão e servidor| +PHONE NOT MODIFIED - Please go back and look at the data you entered|RAMAL NÃO MODIFICADO - Por favor volte e verifique os dados digitados| +PHONE MODIFIED|RAMAL ALTERADO| +SERVER NOT MODIFIED - there is already a server in the system with this server_ip|SERVIDOR NÃO ALTERADO - já existe no sistema um servidor com este IP| +SERVER NOT MODIFIED - Please go back and look at the data you entered|SERVIDOR NÃO ALTERADO - Por favor volte e verifique os dados digitados| +SERVER MODIFIED|SERVIDOR MODIFICADO| +CONFERENCE NOT MODIFIED - there is already a Conference in the system with this extension-server|CONFERÊNCIA NÃO ALTERADA - já existe no sistema uma conferência com esta extensão e servidor| +CONFERENCE NOT MODIFIED - Please go back and look at the data you entered|CONFERÊNCIA NÃO ALTERADA - Por favor volte e verifique os dados digitados| +You do not have permissions to modify this user|Você não tem permissão de alterar este usuário| +Click here to delete user|Clique aqui para apagar o usuário| +Please go back and look at the data you entered|Por favor volte e verifique os dados digitados| +Click here to delete campaign|Clique aqui para apagar a campanha| +Click here to delete list and all of its leads|Clique aqui para apagar a lista e todos os seus registros| +REMOVING LIST LEADS FROM VICIDIAL_LIST TABLE|REMOVENDO REGISTROS DA LISTA DA TABELA VICIDIAL_LIST| +Click here to delete in-group|Clique aqui para apagar este grupo de entrada| +Click here to delete remote agent|Clique aqui para apagar este usuário remoto| +Click here to delete user group|Clique aqui para apagar este grupo de usuários| +Click here to delete phone|Clique aqui para apagar este ramal| +there is already a script entry with this name|já existe um script com este nome no sistema| +Script name, description and text must be at least 2 characters in length|Nome do script, descrição e texto devem ter no mínimo 2 caracteres de comprimento| +Click here to delete script|Clique aqui para apagar o script| +Phone Login|Login do Ramal| +Phone Pass|Senha do Ramal| +Delete Users|Apagar Usuários| +Delete User Groups|Apagar Grupos de Usuários| +Delete Lists|Apagar Listas| +Delete Campaigns|Apagar Campanhas| +Delete In-Groups|Apagar Grupos de Entrada| +Delete Remote Agents|Apagar Usuários Remotos| +Delete Script|Apagar Scripts| +Load Leads|Carregar Registros| +Campaign Detail|Detalhes da Campanha| +AGC Admin Access|Acesso Admin ao AGC| +AGC Delete Phones|Apagar Ramais do AGC| +SCRIPT NOT ADDED|SCRIPT NÃO ADICIONADO| +SCRIPT ADDED|SCRIPT ADICIONADO| +SCRIPT NOT MODIFIED|SCRIPT NÃO ALTERADO| +SCRIPT MODIFIED|SCRIPT ALTERADO| +DELETE THIS USER|APAGAR ESTE USUÁRIO| +DELETE THIS CAMPAIGN|APAGAR ESTA CAMPANHA| +DELETE THIS LIST|APAGAR ESTA LISTA| +DELETE THIS IN-GROUP|APAGAR ESTE GRUPO DE ENTRADA| +DELETE THIS REMOTE AGENT|APAGAR ESTE USUÁRIO REMOTO| +DELETE THIS USER GROUP|APAGAR ESTE GRUPO DE USUÁRIOS| +DELETE THIS PHONE|APAGAR ESTE RAMAL| +DELETE THIS SCRIPT|APAGAR ESTE SCRIPT| +USER NOT DELETED|USUÁRIO NÃO APAGADO| +CAMPAIGN NOT DELETED|CAMPANHA NÃO APAGADA| +LIST NOT DELETED|LISTA NÃO APAGADA| +IN-GROUP NOT DELETED|GRUPO DE ENTRADA NÃO APAGADO| +REMOTE AGENT NOT DELETED|AGENTE REMOTO NÃO APAGADO| +USER GROUP NOT DELETED|GRUPO DE USUÁRIOS NÃO APAGADO| +PHONE NOT DELETED|RAMAL NÃO APAGADO| +SCRIPT NOT DELETED|SCRIPT NÃO APAGADO| +USER DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DO USUÁRIO| +USER DELETION COMPLETED|REMOÇÃO DO USUÁRIO CONCLUÍDA| +CAMPAIGN DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DA CAMPANHA| +CAMPAIGN DELETION COMPLETED|REMOÇÃO DA CAMPANHA CONCLUÍDA| +Logout Agents|Efetuar Saída dos Agentes| +AGENTS NOT LOGGED OUT OF CAMPAIGN|AGENTES NÃO DESLIGADOS DA CAMPANHA| +AGENT LOGOUT CONFIRMATION|CONFIRMAÇÃO DE SAÍDA FORÇADA DOS AGENTES| +Click here to log all agents out of|Clique aqui para desconectar todos os agentes| +AGENT LOGOUT COMPLETED|DESCONEXÃO DE AGENTES CONCLUÍDA| +LOG ALL AGENTS OUT OF THIS CAMPAIGN|DESCONECTAR TODOS OS AGENTES DESTA CAMPANHA| +LIST DELETION CONFIRMATION|COMFIRMAÇÃO DE REMOÇÃO DA LISTA| +LIST DELETION COMPLETED|REMOÇÃO DA LISTA CONCLUÍDA| +IN-GROUP DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE GRUPO DE ENTRADA| +IN-GROUP DELETION COMPLETED|REMOÇÃO DE GRUPO DE ENTRADA CONCLUÍDA| +REMOTE AGENT DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE AGENTE REMOTO| +REMOTE AGENT DELETION COMPLETED|REMOÇÃO DE AGENTE REMOTO CONCLUÍDA| +USER GROUP DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE GRUPO DE USUÁRIO| +USER GROUP DELETION COMPLETED|REMOÇÃO DE GRUPO DE USUÁRIOS CONCLUÍDA| +PHONE DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE RAMAL| +PHONE DELETION COMPLETED|REMOÇÃO DE RAMAL CONCLUÍDA| +SCRIPT DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE SCRIPT| +SCRIPT DELETION COMPLETED|REMOÇÃO DE SCRIPT CONCLUÍDA| +Preview Script|Pré-Visualizar Script| +MODIFY A SCRIPT|ALTERAR SCRIPT| +title of the script|título do script| +CONFERENCE MODIFIED|CONFERÊNCIA ALTERADA| +MODIFY A PHONE RECORD|ALTERAR UM REGISTRO DE RAMAL| +THE END|FIM| +LIST ALL PHONES|LISTAR TODOS RAMAIS| +ADD A NEW PHONE|INCLUIR RAMAL| +SEARCH FOR A PHONE|PROCURAR RAMAL| +ADD A SERVER|INCLUIR SERVIDOR| +LIST ALL SERVERS|LISTAR TODOS SERVIDORES| +SHOW ALL CONFERENCES|MOSTRAR TODAS CONFERÊNCIAS| +ADD A NEW CONFERENCE|INCLUIR CONFERÊNCIA| +AMD Send to VM exten|Extensão para enviar AMD| +Transfer-Conf DTMF|Transfer-Conf DTMF| +Transfer-Conf Number|Número Transfer-Conf| +Hot Keys Active|Atalhos Ativos| +Modify Leads|Alterar Registros| +Change Agent Campaign|Alterar a Campanha do Agente| +Agent Choose Ingroups|Agente pode escolher Grupos de Entrada| +CallBacks Within Campaign|Chamadas Agendadas nesta Campanha| +CallBacks Within List|Chamadas Agendadas nesta Lista| +CallBacks Within Agent|Chamadas Agendadas deste Agente| +Phone extension|Extensão do Ramal| +Dial Plan Number|Número no Plano de Discagem| +digits only|somente dígitos| +Voicemail Box|Correio de Voz| +Outbound CallerID|CallerID de Saída| +Phone IP address|Endereço IP do Ramal| +Computer IP address|Endereço IP do Computador| +Server IP Address|Endereço IP do Servidor| +Server IP|IP do Servidor| +Login: |Login: | +Password: |Senha: | +Status: |Status: | +Active Account|Conta Ativa| +Phone Type|Tipo de Ramal| +Full Name|Nome Completo| +Company: |Empresa: | +Picture: |Foto: | +Client Protocol|Protocolo do Cliente| +Local GMT|GMT Local| +Do NOT Adjust for DST|NÃO ajuste para o horário de verão| +VALUE=SUBMIT|VALUE=ENVIAR| +ADD A NEW SERVER|INCLUIR SERVIDOR| +Server ID|ID do Servidor| +Server Description|Descrição do Servidor| +Active: |Ativo: | +Asterisk Version|Versão do Asterisk| +Conference Number|Número da Conferência| +New Messages|Mensagens Novas| +Old Messages|Mensagens Antigas| +Manager Login|Login do Gerente| +Manager Secret|Senha do Gerente| +VICIDIAL Default User|Usuário padrão do VICIDIAL| +VICIDIAL Default Pass|Senha padrão do VICIDIAL| +VICIDIAL Default Campaign|Campanha padrão do VICIDIAL| +Park Extension|Extensão de Estacionamento| +Park Exten|Exten de Estacionamento| +Conf Extension|Extensão de Conferência| +Conf Exten|Exten de Conferência| +VICIDIAL Park Exten|Extensão de estacionamento do VICIDIAL| +VICIDIAL Park File|Arquivo de estacionamento do VICIDIAL| +Monitor Prefix|Prefixo de Monitoramento| +Recording Exten|Exten de Gravação| +VMailMain Exten|Exten de Correio de Voz Principal| +VMailDump Exten|Exten de Correio de Voz| +Exten Context|Contexto do Exten| +DTMFSend Channel|Canal de envio do DTMF| +Outbound Call Group|Grupo de Saída de Chamadas| +Browser Location|Localização do Navegador| +Install Directory|Caminho de Instalação| +CallerID URL|URL do CallerID| +VICIDIAL Default URL|URL Padrão do VICIDIAL| +Call Logging|Call Logging| +User Switching|Troca de Usuário| +Conferencing|Conferências| +Admin Hang Up|Hang Up do Admin| +Admin Hijack|Captura do Admin| +Admin Monitor|Monitoramento do Admin| +Call Park|Estacionamento de Chamada| +Updater Check|Verificar Atualizador| +AF Logging|AF Logging| +Queue Enabled|Permitir Filas| +CallerID Popup|Popup do CallerID| +VMail Button|Botão CxPostal | +Fast Refresh|Atualizar Rápido| +Fast Refresh Rate|Taxa da Atualização Rápida| +Persistant MySQL|Persistant MySQL| +Auto Dial Next Number|Auto Discar próximo número| +Stop Rec after each call|Parar de gravar após cada chamada| +Primary |Primário | +Secondary |Secundário | +DBX Server|Servidor do DBX| +DBX Database|Base de dados do DBX| +DBX User|Usuário do DBX| +DBX Pass|Senha do DBX| +DBX Port|Porta do DBX| +DBY Server|Servidor do DBY| +DBY Database|Base de dados do DBY| +DBY User|Usuário do DBY| +DBY Pass|Senha do DBY| +DBY Port|Porta do DBY| +MODIFY A SERVER RECORD|ALTERAR O REGISTRO DO SERVIDOR| +Max VICIDIAL Trunks|Máx. Trunks no VICIDIAL| +Telnet Host|Host Telnet| +Telnet Port|Porta Telnet| +Manager User|Usuário do Manager (AMI)| +Manager Update User|Usuário do Atualizador do Manager| +Manager Listen User|Usuário de Listen do Manager| +Manager Send User|Usuário de Send do Manager| +VMail Dump Exten|Extensão para descarregar Voicemail | +VICIDIAL AD extension|Extensão do AD do VICIDIAL| +Default Context|Contexto Padrão| +PHONES WITHIN THIS SERVER|RAMAIS DESTE SERVIDOR| +>EXTENSION<|>EXTENSÃO<| +>NAME<|>NOME<| +>ACTIVE<|>ATIVO<| +>MODIFY<|>ALTERAR<| +This server has|Este servidor tem| +active phones and|ramais ativos e| +inactive phones|ramais inativos| +MODIFY A CONFERENCE RECORD|ALTERAR O REGISTRO DA CONFERÊNCIA| +Conference: |Conferência: | +Current Extension|Extensão Atual| +extension: |Extensão: | +SEARCH RESULTS|RESULTADOS DA PESQUISA| +PHONE LISTINGS|LISTA DE RAMAIS| +SERVER LISTINGS|LISTA DE SERVIDORES| +CONFERENCE LISTINGS|LISTA DE CONFERÊNCIAS| +script runtime|Script runtime| +ADD NEW PHONE|NOVO RAMAL| +ADD NEW SERVER|NOVO SERVIDOR| +ADD NEW CONFERENCE|NOVA CONFERÊNCIA| +ADD SCRIPT|INCLUIR SCRIPT| +VIEW SCRIPTS|VISUALIZAR SCRIPTS| +SCRIPTS LISTINGS|LISTA DE SCRIPTS| +ADDING NEW PHONE|INCLUINDO RAMAL| +ADDING NEW SERVER|ADICIONANDO SERVIDOR| +ADDING NEW CONFERENCE|ADICIONANDO CONFERÊNCIA| +MODIFY PHONE|ALTERAR RAMAL| +MODIFY SERVER|ALTERAR SERVIDOR| +MODIFY CONFERENCE|ALTERAR CONFERÊNCIA| +MODIFYING PHONE|ALTERANDO RAMAL| +MODIFYING SERVER|ALTERANDO SERVIDOR| +MODIFYING CONFERENCE|ALTERANDO CONFERÊNCIA| +SEARCH PHONES|PESQUISAR RAMAIS| +SEARCH PHONES RESULTS|RESULTADO DA PESQUISA DE RAMAIS| +PHONE LIST|LISTA DE RAMAIS| +SERVER LIST|LISTA DE SERVIDORES| +CONFERENCE LIST|LISTA DE CONFERÊNCIAS| +HELP|AJUDA| +Click here for phone stats|Clique aqui para statísticas do ramal| +REMOTE INBOUND: Main|ENTRANTES REMOTOS: Principal| +REMOTE INBOUND: Popup|ENTRANTES REMOTOS: Popup| +CALLS SENT TO|CHAMADAS ENVIADAS PARA| +Phone Stats|Estatísticas do ramal| +CALL TIME AND CHANNELS|HORÁRIO E CANAL DA CHAMADA| +CHANNEL GROUP|GRUPO DE CANAIS| +HOURS:MINUTES|HORAS:MINUTOS| +TOTAL CALLS|TOTAL DE CHAMADAS| +>NUMBER|>NÚMERO| + DATE<| DATA<| +Close this window|Fechar esta janéla| +Inbound Calls Stats|Estatística das chamadas entrantes| +Add New User|Incluir Usuário| +Add New Campaign|Incluir Campanha| +Add New List|Incluir Lista| +Add New In-Group|Incluir Grupo de Entrada| +Add New Remote Agents|Incluir Usuário Remoto| +Add New Users Group|Incluir Grupo de Usuários| +Add New Script|Incluir Script| +New User Addition|Novo usuário| +New Campaign Addition|Nova Campanha| +New Campaign Status Addition|Novo Status de Campanha| +New Campaign Hot Key Addition|Novo Atalho da Campanha| +New List Addition|Nova Lista| +New In-Group Addition|Novo Grupo de Entrada| +New Remote Agents Addition|Novo Agente Remoto| +New Users Group Addition|Novo Grupo de Usuários| +New Script Addition|Novo Script| +Modify User|Alterar Usuário| +Modify Campaign - Basic View|Alterar Campanha - Visão Básica| +Modify Campaign|Alterar Campanha| +Modify List|Alterar Lista| +Modify In-Group|Alterar Groupo de Entrada| +Modify Remote Agents|Alterar Agentes Remotos| +Modify Users Groups|Alterar Grupos de Usuários| +Modify Script|Alterar Script| +Welcome|Bem vindo| +Campaigns|Campanhas| +Lists|Listas| +In-Groups|Groupos de Entrada| +Remote Agents|Agentes Remotos| +User Groups|Grupos de Usuário| +Search Form|Formulário de Pesquisa| +Search Results|RESULTADOS DA PESQUISA| +VICIDIAL ADMIN|VICIDIAL ADMIN| + TABLE| TABELA| +First Name|Nome| +Middle Initial|Inicial do Meio| +Last Name|Sobrenome| +Address Line 1|Endereço, linha 1| +Address Line 2|Endereço, linha 2| +Address Line 3|Endereço, linha 3| +City|Cidade| +State - limited to 2 characters|Estado - limitado a 2 caracteres| +Province|Província| +Postal Code|CEP| +Country|País| +Gender|Sexo| +Date of Birth|Data de Nascimento| +Alternate Phone Number|Número Alternativo| +Email Address|Endereço de Email| +Security Phrase|Frase de Segurança| +Comments|Comentários| +THE END|FIM| +Logout|Sair| +LIST USERS|LISTAR USUÁRIOS| +ADD A NEW USER|INCLUIR USUÁRIO| +SEARCH FOR A USER|PESQUISAR USUÁRIO| +ADD USER GROUP|NOVO GRUPO DE USUÁRIO| +LIST USER GROUPS|LISTAR GRUPOS DE USUÁRIO| +ADD CAMPAIGN|NOVA CAMPANHA| +LIST CAMPAIGNS|LISTAR CAMPANHAS| +SHOW LISTS|MOSTRAR LISTAS| +ADD NEW LIST|NOVA LISTA| +LOAD NEW LEADS|CARREGAR REGISTROS| +SHOW IN-GROUPS|LISTAR GRUPOS DE ENTRADA| +ADD NEW IN-GROUP|NOVO GRUPO DE ENTRADA| +SHOW REMOTE AGENTS|LISTAR AGENTES REMOTOS| +ADD NEW REMOTE AGENTS|NOVO AGENTE REMOTO| +SERVER STATS|ESTATÍSTICAS DO SERVIDOR| +PARK REPORT|RELATÓRIO DE ESTACIONAMENTO| +VDAD REPORT|RELATÓRIO VDAD| +CLOSER REPORT|RELATÓRIO DE FINALIZADOR(CLOSER)| +SEARCH FOR A LEAD|PESQUISAR UM REGISTRO| +GROUP HOURLY|AGRUPAR POR HORA| +User Number|Número do usuário| +Full Name|Nome Completo| +User Level|Nível do Usuário| +User Group|Grupo do Usuário| +ADD A NEW CAMPAIGN|NOVA CAMPANHA| +ADD A NEW INBOUND GROUP|NOVO GRUPO DE ENTRADA| +ADD NEW USERS GROUP|NOVO GRUPO DE USUÁRIOS| +Campaign ID|ID da Campanha| +Campaign Name|Nome da Campanha| +Park Extension|Extensão de Estacionamento| +Park Filename|Nome do arquivo de Estacionamento| +Web Form|Formulário Web| +Allow Closers|Permitir Finalizadores (Closers)| +Hopper Level|Nível do Hopper| +Auto Dial Level|Nível de Discagem Automática| +Next Agent Call|Próximo Agente a chamar| +Local Call Time|Horário Local da Chamada| +Voicemail|Correio de Voz| +SUBMIT|ENVIAR| +List ID|ID da Lista| +List Name|Nome da Lista| +Campaign|Campanha| +Group ID|ID do Grupo| +Group Name|Nome do Grupo| +Group Color|Cor do Grupo| +Fronter Display|Mostrar Fronter| +User ID Start|Início do ID do Usuário| +Number of Lines|Número de linhas| +External Extension|Extensão Externa| +Inbound Groups|Grupos de Entrada| +Group: |Grupo: | +Description: |Descrição: | +USER ADDED|USUÁRIO ADICIONADO| +CAMPAIGN ADDED|CAMPANHA ADICIONADA| +CAMPAIGN STATUS ADDED|STATUS DE CAMPANHA ADICIONADO| +CAMPAIGN HOT KEY ADDED|ATALHO DA CAMPANHA ADICIONADO| +LIST ADDED|LISTA ADICIONADA| +GROUP ADDED|GRUPO ADICIONADO| +REMOTE AGENTS ADDED|AGENTES REMOTOS ADICIONADOS| +USER GROUP ADDED|GRUPO DE USUÁRIOS ADICIONADOS| +USER MODIFIED|USUÁRIO ALTERADO| +CAMPAIGN MODIFIED|CAMPANHA ALTERADA| +GROUP MODIFIED|GRUPO ALTERADO| +CAMPAIGN MODIFIED|CAMPANHA ALTERADA| +LIST MODIFIED|LISTA ALTERADA| +USER GROUP MODIFIED|GRUPO DE USUÁRIOS ALTERADO| +RESETTING LIST-CALLED-STATUS|ZERANDO O STATUS DE CHAMADA DA LISTA| +Dial status |Status de Discagem| +List Order|Ordem da Lista| +Hopper Level|Nível do Hopper| +Force Reset of Hopper|Forçar Reset do Hopper| +Dial Timeout|Tempo de Espera da Discagem| +Dial Prefix|Prefixo de Discagem| +Campaign CallerID|CallerID da Campanha| +Campaign VDAD exten|Extensão VDAD da Campanha| +Campaign Rec exten|Extensão de Gravação da Campanha| +Campaign Recording|Gravação da Campanha| +Campaign Rec Filename|Nome do Arquivo de Gravação da Campanha| +LISTS WITHIN THIS CAMPAIGN|LISTAS DESTA CAMPANHA| +LIST ID|ID DA LISTA| +LIST NAME|NOME DA LISTA| +>ACTIVE<|>ATIVO<| +This campaign has |Esta campanha tem| +active lists and |listas ativas e| +inactive lists|listas inativas| +leads to be dialed in those lists|registros para serem discados nessas listas| +leads in the dial hopper|registros no hopper| +>STATUS<|>STATUS<| +>DESCRIPTION<|>DESCRIÇÃO<| +>SELECTABLE<|>SELECIONÁVEL<| +>DELETE<|>APAGAR<| +ADD NEW CUSTOM CAMPAIGN STATUS|INCLUIR NOVO STATUS DE CAMPANHA| +Selectable: |Selecionável: | +value=ADD|value=ADD| +CUSTOM HOT KEYS WITHIN THIS CAMPAIGN|ATALHOS DE TECLADO DESTA CAMPANHA| +>HOT KEY<|>ATALHO<| +ADD NEW CUSTOM CAMPAIGN HOT KEY|INCLUIR NOVO ATALHO DE TECLADO DA CAMPANHA| +Hot key: |Atalho:| +Basic View|Visão Básica| +Detail View|Visão Detalhada| +MODIFY A LISTS RECORD|ALTERAR REGISTRO DA LISTA| +Reset Lead-Called-Status for this list|Reiniciar Status dos registros de chamada para esta Lista| +STATUSES WITHIN THIS LIST|STATUS DESTA LISTA| +>CALLED<|>CHAMADO<| +>NOT CALLED<|>NÃO CHAMADO<| +>SUBTOTALS<|>SUBTOTAIS<| +>SUBTOTAL<|>SUBTOTAL<| +TIME ZONES WITHIN THIS LIST|FUSOS HORÁRIOS DESTA CAMPANHA| +GMT OFFSET NOW|DIFERENÇA PARA GMT AGORA| +local time|horário local| +>TOTAL<|>TOTAL<| +CALLED COUNTS WITHIN THIS LIST|CHAMADAS EFETUADAS DESTA LISTA| +MODIFY A GROUPS RECORD|ALTERAR REGISTRO DE GRUPOS| +MODIFY A REMOTE AGENTS ENTRY|ALTERAR AGENTES REMOTOS| +numbers only|somente números| +dial plan number dialed to reach agents|número do plano de discagem para ligar para agentes| +MODIFY A USERS GROUP ENTRY|ALTERAR O REGISTRO DE GRUPO DE USUÁRIOS| +no spaces or punctuation|sem espaços ou pontos| +description of group|descrição do grupo| +SEARCH FOR A USER|PESQUISAR UM USUÁRIO| +SEARCH RESULTS|RESULTADO DA PESQUISA| +>STATS<|>ESTATÍSTICAS<| +USER LISTINGS|LISTA DE USUÁRIOS| +CAMPAIGN LISTINGS|LISTA DE CAMPANHAS| +LIST LISTINGS|LISTAS| +INBOUND GROUP LISTINGS|LISTA DE GRUPOS DE ENTRADA| +REMOTE AGENTS LISTINGS|LISTA DE AGENTES REMOTOS| +USER GROUPS LISTINGS|GRUPOS DE USUÁRIOS| +script runtime|Script runtime| +Hopper List|Lista De Hopper| +Live Current Hopper List|Lista Online do Hopper| +Total leads in hopper right now|Total de registros no hopper agora| +Server Stats|Estatísticas do Servidor| +Total Calls placed from this Campaign: |Total de chamadas desta campanha: | +Average Call Length for all Calls in seconds:|Tempo médio das chamadas (seg): | +Total DROP Calls: |Total de chamadas derrubadas: | +Average Length for DROP Calls in seconds: |Tempo médio das chamadas derrubadas: | +Total NA calls -Busy,Disconnect,BTvoicemail: |Total de chamadas sem contato(ocupadas, disconectadas, correio de voz)| +Average Call Length for NA Calls in seconds: |Tempo médio das chamadas sem contato: | +---------- DROPS|---------- DERRUBADAS| + AUTO-DIAL NO ANSWERS| AUTO-DIAL SEM RESPOSTA| +---------- USER STATS|---------- ESTATÍSTICAS DE USUÁRIO| +---------- TIME STATS|---------- ESTATÍSTICAS DE TEMPO| +USER |USUÁRIO | +Agents Time On Calls |Tempo dos Agentes nas Chamadas| +agents logged in on server|agentes conectados ao servidor| +Paused agents|Agentes em pausa| +5 minutes or more on call|Acima de 5 minutos em chamada| +Over 10 minutes on call|Acima de 10 minutos em chamada| + NO AGENTS ON CALLS |AGENTES SEM CHAMADAS| +calls being placed on server|chamadas sendo efetuadas| +LIVE CALL WAITING|CHAMADAS EM ESPERA| + NO LIVE CALLS WAITING |SEM CHAMADAS EM ESPERA| +START OVER|REINICIAR| +Lead Loader Module|Módulo de Carregar Registros| +Current file status|Status do arquivo atual| +Load leads from this file|Carregar registros do arquivo| +Answering Machine Message|Mensagem na Secretária Eletrônica| +Processing |Procesando| +TALK TIME AND STATUS|TEMPO E STATUS DA CHAMADA| +>COUNT<|>QUANTIDADE<| +>HOURS:MINUTES<|>HORAS:MINUTOS<| +TOTAL CALLS |TOTAL DE CHAMADAS | +LOGIN/LOGOUT TIME|HORÁRIO DE LOGIN/LOGOUT| +>EVENT <|>EVENTO<| +> CAMPAIGN<|> CAMPANHA<| +CAMPAIGN: |CAMPANHA: | +LAST 50 CALLS|ÚLTIMAS 50 CHAMADAS| +VICIDIAL REMOTE: Call Disposition|VICIDIAL REMOTO: Finaliz. de chamada| +Call has been dispositioned|Chamada finalizada| +Close This Window|Fechar a Janela| +Call information|Informações da Chamada| +lead lookup FAILED for lead_id|procura de registro FALHOU para este lead_id| +DISPO CALL|FINAL. CHAM.| +>Address |>Endereço | +>City |>Cidade | +>State:|>Estado:| + Postal Code:| CEP:| +>Province |>Província| +>Country |>País | +>Alt Phone |>Tel. Alt. | +>Email |>Email | +>Security |>Segurança| +>Comments |>Comentários | +>Disposition:|>Finalização:| +Group Hourly Stats|Estatísticas Horárias do Grupo| +TSR HOUR COUNTS|CONTAGEM DE HORAS TSR| +Lead Search|Pesquisar Registro| +Lead Lookup|Pesquisa de Registro| +Please enter a:|Por favor, digite um:| +a Home Phone Number:|um Número Residencial:| +vendor lead code|código do fornecedor| +a lead ID:|ID do Registro:| +>NEW SEARCH<|>NOVA PESQUISA<| +Lead record modification|Registro Alterado| +information modified|Informação Alterada| +CALLS TO THIS LEAD|CHAMADAS PARA ESSE REGISTRO| +VDAD Closer Stats|Estatísticas para Finalizador VDAD| +Auto-dial Closer Stats|Estatísticas para Finalizador Auto-dial| +VICIDIAL REMOTE AGENTS|AGENTES REMOTOS VICIDIAL| +INBOUND STATS|ESTATÍSTICAS DE ENTRADA| +REMOTE AGENTS ERROR - Please go back and look at the data you entered|ERRO DE AGENTES REMOTOS – Por favor volte e verifique os dados digitados | + - WAITING - |- AGUARDANDO -| +Remote Agent inbound stats |Estatísticas de entrada para Agentes Remotos| +Total calls taken |Chamadas totais atendidas | +Total talk time on |Tempo total de conversação | +Call list for |Lista de chamadas para | + NO CALLS ON THIS DAY |NENHUMA CHAMADA HOJE| +Scripts|Scripts| +Script:|Script:| +Get Call Launch|Pegar lançamento da chamada| +not used currently|não utilizado atualmente| +VERSION|VERSÃO| +BUILD|BUILD| +REPORTS|RELATÓRIOS| +USERS|USUÁRIOS| + CAMPAIGNS| CAMPANHAS| +LISTS|LISTAS| +SCRIPTS|SCRIPTS| +FILTERS|FILTROS| +IN-GROUPS|GRUPOS DE ENTR.| +USER GROUPS|GRUPOS DE USUÁRIOS| +REMOTE AGENTS|AGENTES REMOTOS| +Column|Coluna| + PERFORMANCE| PERFORMANCE| +AGENT |AGENTE | +SERVER |SERVIDOR | +### END translation phrases through 1.1.11 release ### +Drop Call Seconds -<\/B> The number of seconds from the time the customer line is picked up until the call is considered a DROP, only applies to outbound calls|Segundos para derrubar chamada - Número de segundos entre o atendimento pelo cliente até a chamada ser considerada um DROP (derrubada), só se aplica a chamadas saintes| +Safe Harbor Message -<\/B> If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y|Mensagem do Porto Seguro - Se configurado como Y irá tocar uma mensagem para o cliente após os segundos de drop terem se passado e a chamada não foi transferida para um agente. Esta configuração vai sobrepor a de enviar mensagem para secretária eletrônica quando configurada como Y| +Safe Harbor Exten -<\/B> This is the dial plan extension that the desired Safe Harbor audio file is located at on your server|Exten do Porto Seguro - Esta é a extensão do plano de discagem designada para o porto seguro, deve tocar o arquivo de mensagem localizado no seu servidor| +Drop Message -<\/B> If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y|Mensagem de DROP - Se configurado como Y irá tocar uma mensagem para o cliente após o tempo em segundos de DROP ter expirado sem que a chamada tenha sido transferida para um agente. esta configuração irá sobrepor a de enviar mensagem para secretária eletrônica| +Drop Exten -<\/B> This is the dial plan extension that the desired Dropped call audio file is located at on your server|Exten de Drop - É o extensão a ser discada na qual existe o comando para tocar o arquivo de audio localizado no seu servidor| +Call Time ID -<\/B> This is the short name of a Vicidial Call Time Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters|ID de Horário de Chamada - Este é o nome curto para a definição do tempo de discagem do Vicidial. Precisa ser um identificador único. Não use espaços ou pontos para este campo. Máximo de 10 caracteres e mínimo de 2 caracteres| +Call Time Name -<\/B> This is a more descriptive name of the Call Time Definition. This is a short summary of the Call Time definition. max 30 characters, minimum of 2 characters|Nome do Horário de Chamada - Nome mais descritivo da definição de Horário de Chamada. É um resumo do Horário de Chamada. Máximo de 30 caracteres e mínimo de 2 caracteres| +Call Time Comments -<\/B> This is where you can place comments for a Vicidial Call Time Definition such as -10am to 4pm with extra call state restrictions-. max 255 characters|Comentários do Horário de Chamada - Aqui devem ser colocados os comentários para a definição de Horários de chamada, por ex: "10:00 as 16:00 com chamadas restritas". Máximo de 255 caracteres | +Default Start and Stop Times -<\/B> This is the default time that calling will be allowed to be started or stopped within this call time definition if the day-of-the-week start time is not defined. 0 is midnight. To prevent calling completely set this field to 2400 and set the Default Stop time to 2400. To allow calling 24 hours a day set the start time to 0 and the stop time to 2400|Horário de Início e Fim Padrão - Este é o padrão de horário no qual chamadas são permitidas se o dia de início na semana não estiver definido. 0 é meia noite. Para evitar chamadas a qualquer horário, coloque 2400 no início e 2400 no fim. Para permitir chamadas nas 24 horas do dia, coloque 0 e 2400 nestes campos| +Weekday Start and Stop Times -<\/B> These are the custom times per day that can be set for the call time definition. same rules apply as with the Default start and stop times|Horários de Início e Fim em dias Úteis - Estes são os horários por dia que podem ser configurados para chamada. As mesmas regras se aplicam conforme os horários de início e fim| +State Call Time Definitions -<\/B> This is the list of State specific call time definitions that are followed in this Call Time Definition|Definição de Horários por Estado - Esta é a lista de horários específica por Estado que deve ser seguida por esta definição de horário| +State Call Time State -<\/B> This is the two letter code for the state that this calling time definition is for. For this to be in effect the local call time that is set in the campaign must have this state call time record in it as well as all of the leads having two letter state codes in them|Estado da definição de horário - Código de duas letras para o estado ao qual esta definição foi configurada. Para que funcione corretamente o horário local da campanha deve ter selecionado o horário local deste estado e os registros de clientes devem ter as mesmas letras de estado| +Delete Call Times -<\/B> This option allows the user to be able to delete vicidial call times records and vicidial state call times records from the system|Remover Horários de Chamada - Esta opção permite ao usuário apagar registros de horários de chamada e chamadas por estado do sistema| +Modify Call Times -<\/B> This option allows the user to view and modify the call times and state call times records. A user doesn't need this option enabled if they only need to change the call times option on the campaigns screen|Alterar Horários de Chamada - Esta opção permite ao usuário visualizar e alterar os registros de horários e estados de ligação. O usuário não precisa desta opção habilitada se for somente alterar as opções de horário na tela de configuração de campanha| +Wrap Up Seconds -<\/B> The number of seconds to force an agent to wait before allowing them to receive or dial another call. The timer begins as soon as an agent hangs up on their customer - or in the case of alternate number dialing when the agent finishes the lead - Default is 0 seconds. If the timer runs out before the agent has dispositioned the call, the agent still will NOT move on to the next call until they select a disposition|Segundos de Pós Atendimento - Quantidade de segundos para forçar o agente esperar antes de permitir que ele receba ou faça outra chamada. O timer inicia assim que o agente desliga a chamada com o cliente, ou em caso de chamada a número alternativo, quando termina o trabalho com um registro. Valor padrão é 0 segundos. Se o timer acabar antes que o agente tenha finalizado a chamada, o agente não receberá novo registro até que finalize o atual| +Wrap Up Message -<\/B> This is a campaign-specific message to be displayed on the wrap up screen if wrap up seconds is set|Mensagem de Pós Atendimento - É uma mensagem específica da campanha a ser mostrada na tela de pós atendimento se o tempo de pós atendimento for configurado| +You are not authorized to view this page. Please go back|Você não esta autorizado a visualizar esta página. Por favor retorne| +Day and time options will appear once you have created the Call Time Definition|Opções de dia e hora irão aparecer assim que você crie definições de Horário de Chamada| +State Call Time ID, name and state must be at least 2 characters in length|ID da configuração de chamada por estado, nome e estado devem ter no mínimo 2 caracteres de comprimento| +Call Time ID and name must be at least 2 characters in length|ID e nome do Horário de Chamada deve ter pelo menos 2 caracteres de comprimento| +Active State Call Time Definitions for this Record|Configuração de Horário de Chamada por estado para este Registro| +there is already a call time entry with this ID|já existe uma entrada de Horário para este ID| +CALL TIMES USING THIS STATE CALL TIME|TEMPOS DE CHAMADA USANDO HORÁRIOS DE CHAMADA POR ESTADO| +STATE CALL TIME DEFINITION NOT ADDED|CONFIGURAÇÃO DO HORÁRIO DE CHAMADA POR ESTADO NAO ADICIONADA| +DELETE THIS STATE CALL TIME DEFINITION|APAGAR ESTE HORÁRIO DE CHAMADA POR ESTADO| +Modify Call Time State Definitions List|Alterar as configurações de horário de chamada por estado| +CALL TIME DEFINITION NOT ADDED|CONFIGURAÇÃO DE HORÁRIO DE CHAMADA NAO INCLUÍDO| +DELETE THIS CALL TIME DEFINITION|APAGAR ESTA CONFIGURAÇÃO DE HORÁRIO DE CHAMADA| +short description of the call time|descrição curta do horário de chamada| +CAMPAIGNS USING THIS CALL TIME|CAMPANHAS QUE USAM ESTE HORÁRIO DE CHAMADA| +STATE CALL TIME NOT MODIFIED|HORÁRIO DE CHAMADA POR ESTADO NÃO ALTERADO| +CALL TIME NOT MODIFIED|HORÁRIO DE CHAMADA NÃO ALTERADO| +STATE CALL TIME MODIFIED|HORÁRIO DE CHAMADA POR ESTADO ALTERADO| +CALL TIME MODIFIED|HORÁRIO DE CHAMADA ALTERADO| +Default Start:|Padrão de Início:| +Default Stop:|Padrão de Fim:| +Sunday Start:|Início no Domingo:| +Sunday Stop:|Fim no Domingo:| +Monday Start:|Início na Segunda:| +Monday Stop:|Fim na Segunda:| +Tuesday Start:|Início na Terça:| +Tuesday Stop:|Fim na Terça:| +Wednesday Start:|Início na Quarta:| +Wednesday Stop:|Fim na Quarta:| +Thursday Start:|Início na Quinta:| +Thursday Stop:|Fim na Quinta:| +Friday Start:|Início na Sexta:| +Friday Stop:|Fim na Sexta:| +Saturday Start:|Início no Sábado:| +Saturday Stop:|Fim no Sábado:| +State Rule Added|Regra de Estado Adicionada| +State Rule Removed|Regra de Estado Removida| +STATE CALL TIME LISTINGS|LISTAGEM DE HORÁRIOS DE CHAMADA POR ESTADO| +CALL TIME LISTINGS|LISTAGEM DE HORÁRIOS DE CHAMADA| +STATE CALL TIME ADDED|HORÁRIO DE CHAMADA POR ESTADO ADICIONADA| +CALL TIME ADDED|HORÁRIO DE CHAMADA ADICIONADA| +Drop Call Seconds|Tempo até derrubar(DROP)| +Use Safe Harbor Message|Usar Mensagem de Porto Seguro| +Safe Harbor Exten|Extensão do Porto Seguro| +Use Drop Message|Usar mensagem ao derrubar (drop)| +Drop Exten|Exten de Drop| +SIP Listen Version|Versão de escuta SIP| +Add New Call Time|Novo Horário de Cham.| +Add New State Call Time|Novo Horário de Cham. por Estado| +New Call Time Addition|Nova Inclusão de Horário de Cham.| +New State Call Time Addition|Nova Inclusão de Hor. de Cham. por Estado| +Modify Call Time|Alterar um Hor. de Cham.| +MODIFY A CALL TIME|ALTERAR UM HOR. DE CHAM.| +Modify State Call Time|Alterar um horário de chamada por estado| +MODIFY A STATE CALL TIME| ALTERAR HOR. CHAM. P/ ESTADO| +Delete State Call Time|Apagar Hor. de Cham. por Estado| +State Call Times|Horários de Chamada por Estado| +State Call Time ID|ID do horário de chamada por estado| +State Call Time Name|Nome do horário de chamada por estado| +State Call Time Comments|Comentários do horário de chamada por estado| +STATE CALL TIME NOT DELETED|HORÁRIO DE CHAM. POR ESTADO NÃO REMOVIDO| +CALL TIME DELETION COMPLETED|HORÁRIO DE CHAM. REMOVIDO| +STATE CALL TIME DELETION COMPLETED|REMOÇÃO DO HORÁRIO DE CHAM. POR ESTADO FINALIZADA| +CALL TIME NOT DELETED|HORÁRIO DE CHAMADA NÃO REMOVIDO| +Call Time ID must be at least 2 characters in length|ID do horário de cham. deve ter pelo menos 2 caracteres| +STATE CALL TIME DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DO HORÁRIO DE CHAM. POR ESTADO| +CALL TIME DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DO HORÁRIO DE CHAMADAS| +Call Times|Horários de Cham.| +CALL TIMES|HORÁRIOS DE CHAMADA| +SHOW CALL TIMES|MOSTRAR HORÁRIOS DE CHAMADA| +ADD NEW CALL TIME|NOVO HORÁRIO DE CHAM.| +SHOW STATE CALL TIMES|MOSTRAR HORÁRIOS DE CHAM. POR ESTADO| +ADD NEW STATE CALL TIME|NOVO HORÁRIO DE CHAM. POR ESTADO| +Call Time ID|ID do Horário de Cham.| +Call Time Name|Nome do Horário de Cham.| +Call Time Comments|Comentários do Horário de cham.| +short description of the call time|descrição curta do horário de chamadas| +HIDE|ESCONDER| +SHOW|MOSTRAR| +Show Dialable Leads Count|Mostrar Quantidade de Registros Discáveis| +Dialable Lead Count|Total de Registros Discáveis| +TEST ON CAMPAIGN|TESTAR A CAMPANHA| +Wrap Up Seconds:|Tempo de pós atendimento:| +Wrap Up Message:|Mensagem de pós atendimento:| +Alt Number Dialing|Discagem para número alternativo| +no active lists selected for this campaign|nenhuma lista ativa para esta campanha| +Real-Time Screen|Tela de Tempo Real| +Allowable Inbound Groups -<\/B> For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound-outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups|Grupos de Entrada Permitidos - Apenas para campanhas tipo CLOSER. Aqui é onde selecionamos os grupos de entrada que você quer que os agentes dessa campanha sejam capazes de ligar. É importante para campanhas de entrada/saida (BLENDED) somente selecionar grupos de entrada que serão usados por agentes desta campanha. As chamadas que entram nos grupos de entrada selecionados aqui, serão contadas como chamadas ativas para a campanha blended mesmo que os agentes dessa campanha não estejam logados como receptivo em qualquer grupo de entrada selecionado| +Allowed Inbound Groups|Grupos De entrada Permitidos| +ADD NUMBER TO DNC|INCLUIR NÚMERO AO BLOQUEIO| +ADD A NUMBER TO THE DNC LIST|INCLUIR UM NÚMERO A LISTA DE BLOQUEIO| +Add New DNC|Novo Bloqueio| +Phone Number|Número do Telefone| +VICIDIAL DNC List -<\/B> This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add a number to this list so that it will not be called by campaigns that use the internal DNC list|Lista de Bloqueio - Esta lista de bloqueio contém cada registro que foi configurado com status de DNC (não chamar) no sistema. Através da opção LISTAS - ADICIONAR BLOQUEIO você pode manualmente incluir um número para esta lista e dessa forma este número não será chamado por campanhas que usam essa lista| +DNC NOT ADDED - This phone number is already in the Do Not Call List|Bloqueio não Cadastrado - Este número já existe na lista de bloqueio| +DNC ADDED|Bloqueio Adicionado| +Use Internal DNC List -<\/B> This defines whether this campaign is to filter leads against the Internal DNC list. If it is set to Y, the hopper will look for each phone number in the DNC list before placing it in the hopper. If it is in the DNC list then it will change that lead status to DNCL so it cannot be dialed. Default is N|Usar Lista de Bloqueio Interna - Define se esta campanha deve filtrar registros levando em conta a lista de bloqueio interna. Se estiver configurada como Y, o hopper irá procurar cada número na lista de bloqueio antes de carregar. Se o número estiver na lista de bloqueio, o registro de chamada será alterado para o status DNCL assim não será chamado. Padrão é N| +Use Internal DNC List|Usar lista de bloqueio interna| +Campaign CallerID -<\/B> This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service(RBS) circuits. This will also work through most VOIP(SIP or IAX trunks) providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID|CallerID da Campanha- Este campo permite enviar um callerID customizado nas chamadas de saída. Este é o número que aparece no callerID da pessoa que você está chamando. O padrão é UNKNOWN. Se você está usando T1 ou E1 para discagem esta opção está apenas disponível quando é usado PRI, ISDN em T1 ou E1, que tenham habilitada a função de callerID customizado, isso não funciona em serviços de circuito Robbed-bit (RBS). Isso também é permitido na maioria dos provedores VOIP (SIP ou IAX) que permitem callerID dinâmico de saída. O CallerID customizado só se aplica a chamadas feitas diretamente por uma campanha VICIDIAL, qualquer chamada de terceiros ou transferências não irão mandar callerID customizado. ATENÇÃO: algumas vezes colocando UNKNOWN ou PRIVATE no campo irá causar o envio do número da sua operadora nas chamadas. Você pode querer testar e colocar 0000000000 no campo callerID ao invés do número se você não quer enviar CallerID| +Login -<\/B> The login used for the phone user to login to the client applications|Login - O login usado pelo usuário do ramal para logar no aplicativo client| +Password -<\/B> The password used for the phone user to login to the client applications|Senha - A senha usada pelo usuário do ramal para entrar no aplicativo client| +New Campaign Lead Recycle Addition|Nova Reciclagem de registros| +Modify Campaign Lead Recycle|Alterar Reciclagem de registros| +Through the use of lead recycling, you can call specific statuses of leads again at a specified interval without resetting the entire list. Lead recycling is campaign-specific and does not have to be a selected dialable status in your campaign. The attempt delay field is the number of seconds until the lead can be placed back in the hopper, this number must be at least 120 seconds. The attempt maximum field is the maximum number of times that a lead of this status can be attempted before the list needs to be reset, this number can be from 1 to 10. You can activate and deactivate a lead recycle entry with the provided links. This feature only works in auto-dial mode, where dial level is greater than 0|Com o uso de reciclagem de registros, você pode chamar status de registros específicos novamente em intervalos específicos sem resetar a lista toda. Reciclagem de Registros é específico de uma campanha e não precisa ser um status selecionável da sua campanha. O tempo de tentativa é o número em segundos até que o registro seja novamente colocado no hopper, este número deve ter pelo menos 120 segundos. O campo de tentativas máximas é a quantidade de vezes que um registro com esse status pode ser tentado antes que a lista precise ser resetada, este número pode ser entre 1 e 10. Você pode ativar ou desativar uma reciclagem de registros com os links. Este recurso só funciona no modo auto-dial, onde o nível de discagem é maior que 0| +CAMPAIGN LEAD RECYCLE NOT ADDED - there is already a lead-recycle for this campaign with this status|RECICLAGEM DE REGISTROS DA CAMPANHA NÃO ADICIONADO - já existe um registro de reciclagem nessa campanha para esse status| +status must be between 1 and 6 characters in length|status deve ter entre 1 e 6 caracteres| +attempt delay must be at least 120 seconds|tempo de tentativa deve ter pelo menos 120 segundos| +maximum attempts must be from 1 to 10|quantidade máxima de tentativas deve ser entre 1 e 10| +CAMPAIGN LEAD RECYCLE ADDED|RECICLAGEM DE REGISTROS DA CAMPANHA ADICIONADO| +CAMPAIGN LEAD RECYCLE NOT DELETED|RECICLAGEM DE REGISTROS DA CAMPANHA NÃO REMOVIDO| +CAMPAIGN LEAD RECYCLE DELETED|RECICLAGEM DE REGISTROS DA CAMPANHA REMOVIDO| +Delete Lead Recycle|Remover Reciclagem de Registros| +LEAD RECYCLING WITHIN THIS CAMPAIGN|RECICLAGEM DE REGISTROS DESTA CAMPANHA| +ATTEMPT DELAY|TEMPO DE TENTATIVA| +ATTEMPT MAXIMUM|QUANTIDADE MÁXIMA DE TENTATIVAS| +ADD NEW CAMPAIGN LEAD RECYCLE|INCLUIR RECICLAGEM DE REGISTROS DA CAMPANHA| +Attempt Delay|Tempo de Tentativa| +Attempt Maximum|Quantidade Máxima de Tentativas| +If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dial string will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field|Se você quer permitir Transferências de Consulta, de um Atendente Primário para um Finalizador, você pode colocar CXFER como um dos números para discar predefinidos e um comando será enviado para fazer uma Transferência de Consulta, então o agente pode sair da conferência e seguir para próxima chamada. Se você que permitir transferências sem consulta para um script AGI de log ou para uma URA, entao coloque AXFER no número para discar. Você também pode especificar uma extensão customizada após AXFER ou CXFER, por exemplo se você quer fazer transferências internas de consulta ao invés de Local você colocaria CXFER90009 no campo número a discar| +System Performance -<\/B> Setting this option to Y will enable logging of system performance stats for the server machine including system load, system processes and Asterisk channels in use. Default is N|Performance do Sistema - Configurar esta opção como Y irá habilitar a gravação de log de estatísticas de performance do sistema para o servidor, processos do sistema e canais em uso no Asterisk. O padrão é N| +Server Logs -<\/B> Setting this option to Y will enable logging of all VICIDIAL related scripts to their text log files. Setting this to N will stop writing logs to files for these processes, also the screen logging of asterisk will be disabled if this is set to N when Asterisk is started. Default is Y|Logs do Servidor - Configurando esta opção como Y irá habilitar a gravação de log de todos os scripts do VICIDIAL em arquivos texto. Configurando como N irá parar de escrever logs para os arquivos desses processos, também a gravação de log do Asterisk estará desabilitada se estiver configurada como N quando o Asterisk iniciar. O padrão é Y | +AGI Output -<\/B> Setting this option to NONE will disable output from all VICIDIAL related AGI scripts. Setting this to STDERR will send the AGI output to the Asterisk CLI. Setting this to FILE will send the output to a file in the logs directory. Setting this to BOTH will send output to both the Asterisk CLI and a log file. Default is FILE|Saída AGI - Configurando esta opção como NONE irá desabilitar a saída de todos os scripts AGI do VICIDIAL. Configurando como STDERR irá enviar a saída do AGI para a CLI do Asterisk. Configurando como FILE irá enviar a saída para um arquivo no diretório de log. Configurando como BOTH irá enviar a saída para ambos CLI e o arquivo de log. O padrão é FILE| +Recording Delay -<\/B> For ALLCALLS and ALLFORCE recording only. This setting will delay the starting of the recording on all calls for the number of seconds specified in this field. Default is 0|Atraso de Gravação - Somente para gravações ALLCALLS e ALLFORCE. Esta configuração irá atrasar a gravação da chamada o tempo em segundos especificado no campo. O padrão é 0| +Omit Phone Code -<\/B> This field allows you to leave out the phone_code field while dialing within VICIDIAL. For instance if you are dialing in the UK from the UK you would have 44 in as your phone_code field for all leads, but you just want to dial 10 digits in your dial plan extensions.conf to place calls instead of 44 then 10 digits. Default is N|Omitir o Código do Telefone - Este campo permite que você deixe o campo código do telefone de fora quando discando pelo VICIDIAL. Por exemplo se você estiver discando dentro do Reino Unido você teria 44 como seu código do telefone nos registros, mas você só quer discar 10 digitos no seu plano de discagem para fazer a chamada, ao invés de 44 mais 10 digitos. Padrão é N| +Campaign Recording -<\/B> This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load|Gravação da Campanha - Este menu permite que você escolha o nível de gravação permitido para esta campanha. NEVER irá desabilitar a gravação no client. ONDEMAND é o padrão e permite ao agente iniciar e parar a gravação conforme necessário. ALLCALLS irá iniciar a gravação assim que uma chamada for enviada para o client. ALLFORCE irá iniciar gravação no client assim que uma chamada for enviada ao agente e não dando opção ao agente de parar a gravação. Para ALLCALLS e ALLFORCE existe uma opção para usar o atraso de gravação para evitar gravações curtas e reduzir carga no servidor| +Dial Method -<\/B> This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Dial Method is changed. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift -as defined by call_time selected for campaign- and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. You cannot change the Auto Dial Level if you are in any of the ADAPT dial methods. Only the Dialer can change the dial level when in predictive dialing mode|Método de discagem - Esta é a definição de como a discagem deve ser feita. Se MANUAL então o níver de discagem automática ficará travado em 0 a não ser que o método seja alterado. Se RATIO então a discagem será feita baseada na quantidade de agentes livres. ADAPT_HARD_LIMIT irá discar preditivamente até o nível de chamadas derrubadas e não discará agressivamente após o nível ter sido alcançado até que abaixe novamente. ADAPT_TAPERED permite se passar do nível de derrubadas na primeira metade do turno, conforme definido no horário de campanha, e fica menos agressivo conforme o turno avança. ADAPT_AVERAGE tenta manter uma média no percentual de derrubadas não impondo limites e não sendo tão agressivo como os outros dois métodos. Você não pode mudar o nível de discagem automática se você usar alguns dos métodos ADAPT. Somente o Discador pode mudar o nível no modo preditivo| +Available Only Tally -<\/B> This field if set to Y will leave out INCALL and QUEUE status agents when calculating the number of calls to dial when not in MANUAL dial mode. Default is N|Somente Lista Autom. - Este campo quando configurado como Y não considera a quantidade de chamadas entrantes nem em fila de espera para calcular a quantidade de chamadas para discagem automática. O padrão é N| +Drop Percentage Limit -<\/B> This field is where you set the limit of the percentage of dropped calls you would like while using an adaptive-predictive dial method, not MANUAL or RATIO|Percentual Limite de Derrubadas (drop) - Este campo é onde você configura o limite em percentual das chamadas derrubadas quando usamos um dos métodos preditivos(ADAPT), não válido para métodos MANUAL ou RATIO| +Maximum Adapt Dial Level -<\/B> This field is where you set the limit of the limit to the numbr of lines you would like dialed per agent while using an adaptive-predictive dial method, not MANUAL or RATIO. This number can be higher than the Auto Dial Level if your hardware will support it. Value must be a positive number greater than one and can have decimal places Default 3.0|Nível Máximo de Adapt - Este campo é onde você configura o limite máximo da quantidade de linhas a usar por usuário quando usando um método preditivo (ADAPT), não válido para MANUAL ou RATIO. Este número pode ser maior que o nível de discagem automática se o seu hardware permitir. O valor deve ser um número positivo maior que 1 e pode ter casas decimáis. O padrão é 3.0| +Latest Server Time -<\/B> This field is only used by the ADAPT_TAPERED dial method. You should enter in the hour and minute that you will stop calling on this campaign, 2100 would mean that you will stop dialing this campaign at 9PM server time. This allows the Tapered algorithm to decide how aggressively to dial by how long you have until you will be finished calling|Horário Final do Servidor - Este campo só é usado pelo método ADAPT_TAPERED. Você deve entrar com a hora e o minuto em que vai parar de fazer chamadas para esta campanha, 2100 significa que você vai parar de discar esta campanha as 21 horas. Isto permite ao algoritmo do método Tapered decidir quanto agressivo deve ser e quanto tempo tem até o horário de parar| +Adapt Intensity Modifier -<\/B> This field is used to adjust the predictive intensity either higher or lower. The higher a positive number you select, the greater the dialer will increase the call pacing when it goes up and the slower the dialer will decrease the call pacing when it goes down. The lower the negative number you select here, the slower the dialer will increase the call pacing and the faster the dialer will lower the call pacing when it goes down. Default is 0. This field is not used by the MANUAL or RATIO dial methods|Modificador de Intensidade - Este campo é usado para ajustar a intensidade preditiva para cima ou para baixo. Quanto mais alto(positivo) o valor selecionado, mais o discador vai aumentar o ritmo de chamadas quando aumentar a velocidade e mais lento será para o discador diminuir a velocidade. Quanto mais negativo for o número que você selecionou, mais devagar o discador irá aumentar o ritmo quando precisar, e mais rápido diminuirá a velocidade quando precisar diminuir o ritmo. O padrão é 0. Este campo não é usado pelos métodos MANUAL ou RATIO. | +Dial Level Difference Target -<\/B> This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or RATIO dial methods|Alvo da Diferença de Nível - Este campo é usado para definir se você quer alcançar um número específico de agentes esperando chamadas ou chamadas esperando agentes. Por exemplo: se você gostaria de sempre ter em média um agente livre para receber chamadas imediatamente, você configura como -1, se você gostaria que sempre houvesse uma chamada esperando por agente, você configura como 1. O padrão é 0. Este campo não é usado pelos métodos MANUAL e RATIO| +System Performance|Performance do Sistema| +Server Logs|Logs do Servidor| +AGI Output|Saída do AGI| +Recording Delay|Atraso de Gravação| +Omit Phone Code|Omitir Código de Telefone| +Campaign Recording|Gravação da Campanha| +Dial Method|Método de Discagem| +Available Only Tally|Somente Lista Autom.| +Drop Percentage Limit|Limite de Derrubadas (drop)| +Maximum Adapt Dial Level|Nível Máximo de Discagem| +Latest Server Time|Horário Final do Servidor| +Adapt Intensity Modifier|Modificador de Intensidade | +Dial Level Difference Target|Alvo de Diferença de Nível| +### START translations for 2.0.2 release ### +VICIDIAL Server Trunks allows you to restrict the outgoing lines that are used on this server for campaign dialing on a per-campaign basis. You have the option to reserve a specific number of lines to be used by only one campaign as well as allowing that campaign to run over its reserved lines into whatever lines remain open, as long at the total lines used by vicidial on this server is less than the Max VICIDIAL Trunks setting. Not having any of these records will allow the campaign that dials the line first to have as many lines as it can get under the Max VICIDIAL Trunks setting|Trunks do Servidor VICIDIAL permitem que você limite as linhas que são usadas para saída neste servidor para discagem de campanhas ou por cada campanha. Você tem a opção de reservar um número específico de linhas a serem usadas por apenas uma campanha assim como permitir que esta campanha rode nas linhas garantidas a ela e usar linhas que estão abertas, somente se a quantidade total de linhas usadas for menor que a configuração de máximo. Não havendo nenhuma dessas configurações irá permitir que a campanha que discar primeiro, ter quantas linhas ela puder pegar até a quantidade máxima configurada| +VICIDIAL Balance Dialing -<\/B> Setting this field to Y will allow the server to place balance calls for campaigns in VICIDIAL so that the defined dial level can be met even if there are no agents logged into that campaign on this server. Default is N|Discagem Balanceada - Se configurado como Y irá permitir que o servidor faça chamadas balanceadas para as campanhas do VICIDIAL de forma que o nível de chamadas do servidor possa ser alcançado mesmo que nao haja agentes logados nas campanhas deste servidor. Padrão é N| +VICIDIAL Balance Offlimits -<\/B> This setting defines the number of trunks to not allow VICIDIAL balance dialing to use. For example if you have 40 max vicidial trunks and balance offlimits is set to 10 you will only be able to use 30 trunk lines for VICIDIAL balance dialing. Default is 0|Limites de Balanceamento do VICIDIAL - Esta configuração define o número de trunks não disponíveis ao uso balanceado do VICIDIAL. Por exemplo, se você tem 40 trunks máximos e o limite de balanceamento for 10, você só poderá usar 30 linhas do trunk para balanceamento VICIDIAL. Padrão é 0| +Allowed Campaigns -<\/B> This is a selectable list of Campaigns to which members of this user group can log in to. The ALL-CAMPAIGNS option allows the users in this group to see and log in to any campaign on the system|Campanhas Permitidas - Esta é uma lista selecionável de campanhas nas quais os membros deste grupo podem se logar. A opção ALL-CAMPAIGNS permite aos usuários neste grupo ver e logar em qualquer campanha no sistema| +VICIDIAL SERVER TRUNK RECORD NOT ADDED|REGISTRO DE TRUNK VICIDIAL NÃO ADICIONADO| +there is already a server-trunk record for this campaign|já existe um registro de trunk para esta campanha| +the number of vicidial trunks is too high|o número de trunk vicidial é muito alto| +VICIDIAL SERVER TRUNK RECORD ADDED|REGISTRO DE TRUNK VICIDIAL INCLUÍDO| +VICIDIAL SERVER TRUNK RECORD NOT MODIFIED|REGISTRO DE TRUNK VICIDIAL NÃO INCLUÍDO| +VICIDIAL SERVER TRUNK RECORD MODIFIED|REGISTRO DE TRUNK VICIDIAL ALTERADO| +VICIDIAL SERVER TRUNK RECORD NOT DELETED|REGISTRO DE TRUNK VICIDIAL NAO REMOVIDO| +VICIDIAL SERVER TRUNK RECORD DELETED|REGISTRO DE TRUNK VICIDIAL REMOVIDO| +campaign must be between 3 and 8 characters in length|campanha deve ter entre 3 e 8 caracteres de comprimento| +server_ip delay must be at least 7 characters|delay do IP do servidor deve ser pelo menos 7 caracteres| +trunks must be a digit from 0 to 9999|trunks devem ter um digito entre 0 e 9999| +VICIDIAL Balance Dialing|Discagem Balanceada do VICIDIAL| +VICIDIAL Balance Offlimits|Limite de Balanceamento do VICIDIAL| +ADDING NEW SERVER VICIDIAL TRUNK RECORD|ADICIONANDO TRUNK DO SERVIDOR VICIDIAL| +ADD NEW SERVER VICIDIAL TRUNK RECORD|INCLUIR TRUNK DO SERVIDOR VICIDIAL| +MODIFY SERVER VICIDIAL TRUNK RECORD|ALTERAR TRUNK DO SERVIDOR VICIDIAL| +DELETE SERVER VICIDIAL TRUNK RECORD|REMOVER TRUNK DO SERVIDOR VICIDIAL| +VICIDIAL TRUNKS FOR THIS SERVER|TRUNKS DO VICIDIAL PARA ESTE SERVIDOR| + RESTRICTION | RESTRIÇÃO | + TRUNKS | TRUNKS | +Emergency VDAC Jam Clear|Limpador de emergência para VDAC| +VDAC NOT CLEARED FOR CAMPAIGN|VDAC NÃO LIMPO PARA CAMPANHA| +LAST VDAC RECORD CLEARED FOR CAMPAIGN|ÚLTIMO REGISTRO VDAC LIMPO PARA CAMPANHA| +VDAC CLEAR CONFIRMATION|CONFIRMAR LIMPEZA DO VDAC| +Click here to delete the oldest LIVE record in VDAC for|Clique aqui para apagar o registro mais velho do VDAC para| +Allowed Campaigns|Campanhas Permitidas| +USERS CAN VIEW ANY CAMPAIGN|USUÁRIOS PODEM VER QUALQUER CAMPANHA| +Campaign Not Allowed|Campanha não permitida| +### START translations for 2.0.3 release ### +ADAPT OVERRIDE|SOBREPOR ADAPT| +The ADAPT OVERRIDE checkbox allows you to force a new dial level even though the dial method is in an ADAPT mode. This is useful if there is a dramatic shift in the quality of leads and you want to drastically change the dial_level manually.|O checkbox SOBREPOR APAPT permite que você force um nível de discagem mesmo que o método seja um dos ADAPT. Isto é útil quando existe uma mudança grande na qualidade dos registros e você quer mudar manualmente o nível.| +There are two special HotKey options that you can use in conjunction with Alternate Phone number dialing, ALTPH2 - Alternate Phone Hot Dial and ADDR3-----Address3 Hot Dial allow an agent to use a hotkey to hang up their call, stay on the same lead, and dial another contact number from that lead|Existem duas opções de atalhos especiais que você pode usar em conjunto com discagem a Telefones Alternativos, ALTPH2 - Discar para o Tel. Alt. e ADDR3----Discagem rápida do endereço 3, permitem ao agente usar o atalho para desligar a chamada, permanecer no mesmo registro e discar outro telefone do mesmo registro| +Concurrent Transfers|Transferências Simultâneas| +Concurrent Transfers -<\/B> This setting is used to define the number of calls that can be sent to agents at the same time. It is recommended that this setting is left at AUTO. This field is not used by the MANUAL dial method|Transferências Simultâneas - Esta configuração é usada para definir o número de chamadas que podem ser enviadas para agentes ao mesmo tempo. É recomendado que esta configuração seja deixada em AUTO. Este campo não é usado pelo método MANUAL de discagem| +Auto Alt-Number Dialing -<\/B> This setting is used to automatically dial alternate number fields while dialing in the RATIO and ADAPT dial methods when there is no contact at the main phone number for a lead, the NA, B, DC and N statuses. This setting is not used by the MANUAL dial method|Auto Discar Alternativo - Esta configuração é usada para automaticamente discar números alternativos enquanto os métodos RATIO e ADAPT são usados e não há contato no telefone principal para um registro com status NA, B, DC e N. Esta configuração não é usada pelo método MANUAL de discagem| +Auto Alt-Number Dialing|Auto Discar Alternativo| +View Reports -<\/B> This option allows the user to view the VICIDIAL reports.|Visualizar Relatórios - Esta opção permite ao usuário visualizar os relatórios VICIDIAL.| +Modify Sections -<\/B> These options allow the user to view and modify each sections records. If set to 0, the user will be able to see the section list, but not the detail or modification screen of a record in that section|Alterar Sessões - Estas opções permitem ao usuário visualizar e alterar registros de cada sessão. Se configurado como 0, o usuário será capaz de ver a lista de sessões, mas não poderá ver os detalhes nem alterar os registros da sessão| +VICIDIAL AUTO ALT DIAL STATUSES|STATUS DE DISCAGEM ALT.| +If the Auto Alt-Number Dialing field is set, then the leads that are dispositioned under these auto alt dial statuses will have their alt_phone and-or address3 fields dialed after any of these no-answer statuses are set|Se o campo Auto Discar Alternativo estiver marcado, os registros que são finalizados sob estes status terão os números alternativos discados após qualquer um desses status de não atendidos| +AUTO ALT NUMBER DIALING FOR THIS CAMPAIGN|DISCAR NÚMERO ALT. NESTA CAMPANHA| +ADD NEW AUTO ALT NUMBER DIALING STATUS|INCLUIR NOVO STATUS PARA DISCAGEM DE NÚM. ALT.| +AUTO ALT DIAL STATUS NOT ADDED|STATUS DE DISCAGEM DE NÚM. ALT. NÃO INCLUÍDO| +there is already an entry for this campaign with this status|já existe uma entrada para esta campanha com este status| +AUTO ALT DIAL STATUS ADDED|STATUS DE DISCAGEM PARA NÚM. ALT. INCLUÍDO| +AUTO ALT DIAL STATUS NOT DELETED|STATUS DE DISCAGEM PARA NÚM. ALT. NÃO REMOVIDO| +AUTO ALT DIAL STATUS DELETED|STATUS DE DISC. PARA NÚMERO ALT. REMOVIDO| +this auto alt dial status is not in this campaign|este status de discagem do número alt. não está na campanha| +New Auto Alt Dial Status|Novo Status de Disc. Alt.| +Delete Auto Alt Dial Status|Remover Status de Disc. Alt.| + Users | Usuários | + Campaigns | Campanhas | + Lists | Listas | + Scripts | Scripts | + Filters | Filtros | + In-Groups | Grupos Entr. | + User Groups | Grupos de Usuário | + Remote Agents | Agentes Remotos | + Admin | Admin | + Reports | Relatórios | + Show Users | Mostrar Usuários | + Add A New User | Incluir Usuário | + Search For A User | Pesquisa de Usuário | + Show Campaigns | Mostrar Campanhas | + Add A New Campaign | Incluir Campanha | + Real-Time Campaigns Summary | Resumo de Campanhas Tempos-real | + Show Lists | Mostrar Listas | + Add A New List | Incluir Lista | + Search For A Lead | Pesquisar Registro | + Add Number To DNC | Incluir Bloqueio | + Load New Leads | Carregar Registros | + Show Scripts | Mostrar Scripts | + Add A New Script | Incluir Script | + Show Filters | Mostrar Filtros | + Add A New Filter | Incluir Filtro | + Show In-Groups | Mostrar Grupos Entr. | + Add A New In-Group | Incluir Grupo Entr. | + Show User Groups | Mostrar Grp. de Usuário | + Add A New User Group | Incluir Grp. de Usuário | + Group Hourly Report | Relat. de Grps por Hora | + Show Remote Agents | Mostrar Ag. Remotos | + Add New Remote Agents | Incluir Ag. Remoto | + Call Times | Horários de Cham. | + Phones | Ramais | + Conferences | Conferências | + Servers | Servidores | + Show Call Times | Mostrar Horários de Cham. | + Add A New Call Time | Incluir Horário de Cham. | + Show State Call Times | Mostrar Hor. de Cham. por Estado | + Add A New State Call Time | Incluir Hor. de Cham. por Estado | + Show Phones | Mostrar Ramais | + Add A New Phone | Incluir Ramal | + Show Conferences | Mostrar Conferências | + Add A New Conference | Incluir Conferência | + Show VICIDIAL Conferences | Mostrar Conferências VICIDIAL | + Add A New VICIDIAL Conference | Incluir Conferência VICIDIAL | + Show Servers | Mostrar Servidores | + Add A New Server | Incluir Servidor | +CallBacks Within User Group|Agendamentos do Grupo de Usuários| +USERS WITHIN THIS USER GROUP|USUÁRIOS DESTE GRUPO| +Modify Users: |Alterar Usuários: | +Modify Campaigns: |Alterar Campanhas: | +Modify Lists: |Alterar Listas: | +Modify Scripts: |Alterar Scripts: | +Modify Filters: |Alterar Filtros: | +Modify In-Groups: |Alterar Grupos de Ent.: | +Modify User Groups: |Alterar Grupos de Usuário: | +Modify Remote Agents: |Alterar Agentes Remotos: | +Modify Servers: |Alterar Servidor: | +View Reports: |Mostrar Relatórios: | +You do not have permission to view this page|Você não tem permissão para ver esta página| +Lead Time Zone Lookup: |Pesquisa do Fuso Horário do Registro:| +Lead Duplicate Check: |Verificação de Duplicidade de Registro:| +Agent Pause Codes Active -<\/B> Allows agents to select a pause code when they click on the PAUSE button in vicidial.php. Pause codes are definable per campaign at the bottom of the campaign view detail screen and they are stored in the vicidial_agent_log table. Default is N|Códigos de Pausa do Agente Ativos - Permite aos agentes selecionar códigos de pausa quando eles clicam o botão pausa no vicidial.php. Códigos de pausa são definidos por campanha no final da página de detalhes da campanha e são guardados na tabela vicidial_agent_log. O padrão é N| +AGENT PAUSE CODES|CÓDIGOS DE PAUSA DO AGENTE| +If the Agent Pause Codes Active field is set to active then the agents will be able to select from these pause codes when they click on the PAUSE button on their screens. This data is then stored in the vicidial agent log. The Pause code must contain only letters and numbers and be less than 7 characters long. The pause code name can be no longer than 30 characters.|Se o Código de Pausa do Agente estiver ativa então os agentes serão capazes de escolher entre esses códigos de pausa quando clicarem no botão PAUSA em suas telas. Esta informação será então gravada na tabela de log do agente. O código de pausa deve conter somente letras e números e deve ser menor que 7 caracteres. O nome do código de pausa não pode ser maior que 30 caracteres.| +AGENT PAUSE CODES FOR THIS CAMPAIGN|CÓDIGOS DE PAUSA PARA CAMPANHA| +PAUSE CODES|CÓDIGOS DE PAUSA| +BILLABLE|COBRÁVEL| +ADD NEW AGENT PAUSE CODE|NOVO CÓDIGO DE PAUSA| +Pause Code: |Código de Pausa: | +Pause Code Name: |Nome do Código de Pausa: | +Billable: |Cobrável: | +New Agent Pause Code|Novo Código de Pausa| +Modify Agent Pause Code|Alterar Código de Pausa| +Delete Agent Pause Code|Apagar Código de Pausa| +AGENT PAUSE CODE NOT ADDED|CÓDIGO DE PAUSA NAO INCLUÍDO| +there is already an entry for this campaign with this pause code|já existe uma entrada para esta campanha e este código de pausa| +AGENT PAUSE CODE ADDED|CÓDIGO DE PAUSA INCLUÍDO| +AGENT PAUSE CODE NOT MODIFIED|CÓDIGO DE PAUSA NÃO ALTERADO| +CAMPAIGN PAUSE CODE NOT DELETED|CÓDIGO DE PAUSA DA CAMPANHA NÃO REMOVIDO| +Campaign Description -<\/B> This is a memo field for the campaign, it is optional and can be a maximum of 255 characters in length|Descrição da Campanha - Este é um campo de texto para a campanha, é opicional e pode ter no máximo 255 caracteres de comprimento| +Campaign Change Date -<\/B> This is the last time that the settings for this campaign were modified in any way|Data de Alteração da Campanha - Esta é a última vez que a configuração desta campanha foi alterada| +Campaign Stats Refresh -<\/B> This checkbox will allow you to force a vicidial stats refresh, even if the campaign is not active|Atualizar Estat. da Campanha - Este checkbox irá permitir que você force uma atualizaão das estatísticas, mesmo se a campanha não estiver ativa| +Last Campaign Login Date -<\/B> This is the last time that an agent was logged into this campaign|Data do Último Login na Campanha - É a data da última vez que um agente logou nesta campanha| +List Description -<\/B> This is the memo field for the list, it is optional|Descrição da List - É um campo texto para descrião da lista, é opicional| +List Change Date -<\/B> This is the last time that the settings for this list were modified in any way|Data de Alteração da Lista - Esta é a última vez que as configurações da lista foram modificadas| +List Last Call Date -<\/B> This is the last time that lead was dialed from this list|Data da Última Chamada da Lista - É a data em que o último registro da lista foi discado| +List Description: |Descrição da Lista: | +List Change Date: |Data da Alteração: | +Campaign Description: |Descrição da Campanha: | +VICIDIAL Recording Override -<\/B> This option will override whatever the option is in the campaign for recording. DISABLED will not override the campaign recording setting. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load|Sobrepor Config. de Gravação do VICIDIAL - Esta opção irá sobrepor qualquer configuração de gravação que esteja na campanha. DISABLED não irá sobrepor a configuração da campanha. NEVER irá desabilitar a gravação no client. ONDEMAND é o padrão e permite ao agente iniciar e parar a gravação conforme necessário. ALLCALLS irá iniciar a gravação no client quando uma chamada é enviada ao agente. ALLFORCE irá iniciar a gravação no client quando uma chamada é enviada para o agente, sem dar a opção de parar a gravação, Para ALLCALLS e ALLFORCE existe uma opção para atrasar a gravação e evitar gravações curtas demais e evitar carga no sistema| +VICIDIAL Recording Override: |Sobrepor Conf. de Gravação no VICIDIAL:| +MODIFY VICIDIAL SYSTEM SETTINGS|ALTERAR CONFIG. DE SISTEMA DO VICIDIAL| + System Settings | Config. de Sistema | +VICIDIAL SYSTEM SETTINGS MODIFIED|CONFIGURAÇÕES DE SISTEMA ALTERADAS| +Version: |Versão: | +Use Non-Latin: |Uso Não-Latino: | +Webroot Writable: |Raiz Web Gravável: | +Enable QueueMetrics Logging: |Habilitar Log para o QueueMetrics: | +QueueMetrics Server IP: |IP do Servidor QueueMetrics: | +QueueMetrics DB Name: |Nome do BD do QueueMetrics: | +QueueMetrics DB Login: |Login do BD do QueueMetrics: | +QueueMetrics DB Password: |Senha do BD do QueueMetrics: | +Use Non-Latin -<\/B> This option allows you to default the web display script to use UTF8 characters and not do any latin-character-family regular expression filtering or display formatting. Default is 0|Uso Não-Latino - Esta opção permite configurar o padrão de visualização para usar caracteres UTF8 e não filtrar com expressões regulares os caracteres da família dos latinos ou mostrar formatação. Padrão é 0| +Webroot Writable -<\/B> This setting allows you to define whether temp files and authentication files should be placed in the webroot on your web server. Default is 1|Raiz Web Gravável - Esta configuração permite que você define se os arquivos temporários e de autenticação devem ser gravados na raiz do website ou do servidor web. Padrão é 1| +Enable QueueMetrics Logging -<\/B> This setting allows you to define whether VICIDIAL will insert log entries into the queue_log database table as Asterisk Queues activity does. QueueMetrics is a standalone, closed-source statistical analysis program. You must have QueueMetrics already installed and configured before enabling this feature. Default is 0|Habilitar Log para o QueueMetrics - Esta configuração permite que você defina se o VICIDIAL irá enviar registros de log para a base de dados queue_log conforme a atividade de Queues do Asterisk faz. QueueMetrics é um programa de fonte fechado para analise estatística. Você deve ter o QueueMetrics instalado e configurado antes de habilitar este recurso. O padrão é 0| +QueueMetrics Server IP -<\/B> This is the IP address of the database for your QueueMetrics installation|IP do servidor do QueueMetrics - É o IP do servidor do QueueMetrics| +QueueMetrics Database Name -<\/B> This is the database name for your QueueMetrics database|Nome do BD do QueueMetrics - É o nome do banco de Dados do QueueMetrics| +QueueMetrics Database Login -<\/B> This is the user name used to log in to your QueueMetrics database|Login do BD do QueueMetrics - éste es el nombre delusuario usado para abrirse una sesión a su base de datos deQueueMetrics| +QueueMetrics Database Password -<\/B> This is the password used to log in to your QueueMetrics database|Senha do BD do QueueMetrics - É a senha a ser usada para logar no DB do QueueMetrics| +QueueMetrics URL -<\/B> This is the URL or web site address used to get to your QueueMetrics installation|URL do QueueMetrics - É a URL ou endereço do site usado para entrar na sua instalação do QueueMetrics| +QueueMetrics Log ID -<\/B> This is the server ID that all VICIDIAL logs going into the QueueMetrics database will use as an identifier for each record|ID do Log do QueueMetrics - É o ID do servidor que o VICIDIAL coloca no BD do QueueMetrics para identificação de cada registro| +QueueMetrics Log ID: |ID do Log do QueueMetrics: | +Campaign Dial Status Added|Status de Discagem Adicionado| +Campaign Dial Status Removed|Status de Discagem Removido| +To add another status to dial, select it from the drop-down list and click ADD. To remove one of the dial statuses, click on the REMOVE link next to the status you want to remove|Para adicionar outro status de discagem, selecione-o na lista e clique ADD. Para remover um dos status, clique no link REMOVE ao lado do status que você quer remover| +CAMPAIGN DIAL STATUS NOT ADDED|STATUS DE DISCAGEM NÃO INCLUÍDO| +CAMPAIGN DIAL STATUS ADDED|STATUS DE DISCAGEM INCLUÍDO| +this dial status is not selected for this campaign|esse status de discagem não está selecionado para esta campanha| +CAMPAIGN DIAL STATUS NOT REMOVED|STATUS DE DISCAGEM NÃO REMOVIDO| +CAMPAIGN DIAL STATUS REMOVED|STATUS DE DISCAGEM REMOVIDO| +>REMOVE<|>REMOVER<| +Dial Status |Status de Discagem| +no dial statuses selected for this campaign|nenhum status de discagem selecionado para essa campanha| +QueueMetrics EnterQueue Prepend -<\/B> This field is used to allow for prepending of one of the vicidial_list data fields in front of the phone number of the customer for customized QueueMetrics reports. Default is NONE to not populate anything|Prefixo QueueMetrics EnterQueue - Este campo é usado para permitir prefixar um dos campos da tabela vicidial_list na frente do número do telefone do cliente para relatórios customizados no QueueMetrics. O padrão é NONE para não colocar nada| +QueueMetrics EnterQueue Prepend: |Prefixo QueueMetrics EnterQueue: | +VICIDIAL Agent Disable Display -<\/B> This field is used to select when to show an agent when their session has been disabled by the system, a manager action or by an external measure. The NOT_ACTIVE setting will disable the message on the agents screen. The LIVE_AGENT setting will only display the disabled message when the agents vicidial_auto_calls record has been removed, such as during a force logout or emergency logout|Mostrar Bloqueio ao Agente VICIDIAL - Este campo é usado para selecionar quando mostrar para um agente que sua sessão foi bloqueada pelo sistema, ação do gerente ou ocorrência externa. A configuração NOT_ACTIVE irá desabilitar a mensagem na tela do agente. A configuração LIVE_AGENT só irá mostrar a mensagem de bloqueio quando o registro da vicidial_auto_calls for removido, nas situações de logout forçado ou logout de emergência| +VICIDIAL Agent Disable Display: |Mostrar Bloqueio ao Agente VICIDIAL:| +Disable Alter Customer Data -<\/B> If set to Y, does not change any of the customer data record when an agent dispositions the call. Default is N|Desabilitar Alteração nos Dados do Cliente - Quando configurada como Y, não permite ao usuário alterar registros de cliente quando o Agente finaliza a chamada. O padrão é N| +Disable Alter Customer Data: |Desabilitar Alteração de Dados do Cliente:| +Agent Alter Customer Data Override -<\/B> This option will override whatever the option is in the campaign for altering of customer data. NOT_ACTIVE will use whatever setting is present for the campaign. ALLOW_ALTER will always allow for the agent to alter the customer data, no matter what the campaign setting is. Default is NOT_ACTIVE|Sobrepor Permissão de Alteração-<\/B> Esta opção irá sobrepor qualquer opção na campanha para alterar dados do cliente. NOT_ACTIVE irá usar qualquer configuração presente na campanha. ALLOW_ALTER irá sempre permitir alteração no registro do cliente, não importando a configuração da campanha. O padrão é NOT_ACTIVE| +Agent Alter Customer Data Override: |Sobrepor Permissão de Alteração| +Allow No-Hopper-Leads Logins -<\/B> If set to Y, allows agents to login to the campaign even if there are no leads loaded into the hopper for that campaign. This function is not needed in CLOSER-type campaigns. Default is N|Permitir Logar sem Registro no Hopper - Quando Y, permite agentes logarem na campanha mesmo que não existam registros carregados no hopper para esta campanha. Esta funcionalidade não é necessária em campanha de Finalização(CLOSER). O padrão é N| +Allow No-Hopper-Leads Logins: |Permitir Logar Sem Registros no Hopper: | +Enable SIPSAK Messages -<\/B> If enabled the server will send messages to the SIP phone to display on the phone LCD display when logged into VICIDIAL. Feature only works with SIP phones and requires sipsak application to be installed on the web server. Default is 0|Habilitar Mensagens SIPSAK - Se habilitado, o servidor irá mandar mensagens para o fone SIP mostrar no display quando logado no VICIDIAL. Este recurso só funciona com telefones SIP e requer o aplicativo sipsak instalado no servidor web. Padrão é 0| +Enable SIPSAK Messages: |Habilitar Mensagens SIPSAK: | +Allow SIPSAK Messages -<\/B> If set to 1, this will allow the phones table setting to work properly, the server will send messages to the SIP phone to display on the phone LCD display when logged into VICIDIAL. This feature only works with SIP phones and requires sipsak application to be installed on the web server. Default is 0|Permitir Mensagens SIPSAK - Se configurada como 1, irá permitir que a configuração da tabela de ramais funcione corretamente, o servidor irá enviar mensagens para o telefone SIP mostrar no Display LCD quando logado no VICIDIAL. Este recurso só funciona em telefones SIP e requer o aplicativo sipsak instalado no servidor web. O padrão é 0| +Allow SIPSAK Messages: |Permitir Mensagens SIPSAK| +Admin Home URL -<\/B> This is the URL or web site address that you will go to if you click on the HOME link at the top of the admin.php page|URL Home do Admin - É a URL do site que você irá se clicar no link HOME no topo da página admin.php| +Admin Home URL: |URL Home do Admin: | +>HOME<|>HOME<| + Welcome | Bemvindo | +### START translations for 2.0.4 release ### +CHECK FOR DUPLICATES BY PHONE IN ALL CAMPAIGN LISTS|VERIFICAR REGISTROS DUPLICADOS EM TODAS AS LISTAS DA CAMPANHA| +CHECK FOR DUPLICATES BY PHONE IN ENTIRE SYSTEM|VERIFICAR REGISTROS DUPLICADOS NO SISTEMA INTEIRO| +PHONE CODE OVERRIDE FOR THIS FILE|SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO| +The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. The lead loader allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation, but it does allow you to check for duplicates in itself, within the campaign or within the entire system. Also, make sure that you have created the list that these leads are to be under so that you can use them. Here is a list of the fields in their proper order for the lead files:|O carregador de registros baseado em Web do VICIDIAL simplesmente recebe um arquivo de registros, de até 8MB, que é delimitado por tab ou pipe e o carrega na tabela vicidial_list. O Carregador permite escolher os campos, e os formatos TXT - Texto Simples, CSV - Separado por Virgulas, e XLS - Excel. O carregador de arquivos não valida dados, mas permite que você verifique duplicidades nele próprio, na campanha ou no sistema inteiro. Também, tenha certeza que você criou a lista em que esses registros serão carregados antes de carregar o arquivo. Aqui está uma lista dos campos e sua ordem correta para o arquivo de registros:| +NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. Also, for duplication checks against gampaign lists, the list that has new leads going into it does need to be created in the system before you start to load the leads.|ATENÇÃO: A funcionalidade de carregar registros usando arquivos EXCEL é permitida por uma série de scripts e precisa estar devidamente configurada no arquivo /etc/astguiclient.conf no servidor web. Também, alguns módulos perl devem ser carregados para que funcione, OLE-Storage_Lite e Spreadsheet-ParseExcel. Você pode verificar erros de tempo de execução neles olhando o arquivo de log do apache. Também, para verificação de duplicados na lista da campanha, a lista com os novos registros precisa existir no sistema antes de iniciar a carga.| +Campaign List Mix Added|Mesclagem de Listas Incluído| +Modify Campaign List Mix|Alterar Mesclagem de Listas| +Campaign List Mix Removed|Listas de Campanha Removida| +Campaign Statuses|Status da Campanha| +Campaign HotKeys|Atalhos da Campanha| +Campaign Lead Recycle Entries|Reciclagem de Registros da Campanha| +Campaign Auto Alt Dial Statuses|Status de Disc. Alt. da Campanha| +Campaign Agent Pause Codes|Códigos de Pausa de Agente da Campanha| +Campaign Dial Statuses|Status de Discagem da Campanha| +Campaign List Mixes|Mesclagem de Listas| + Lead Recycle |Reciclagem de Registros| + Auto-Alt Dial |Discagem Auto-Alt.| + Pause Codes |Códigos de Pausa| + List Mix |Mesclagem de Lista| + Campaigns Main |Campanhas| +List Order Mix -<\/B> Overrides the Lead Order and Dial Status fields. Will use the List and status parameters for the selected List Mix entry in the List Mix sub section instead. Default is DISABLED|Ordem de Mesclagem - Sobrepõe a ordem nos campos Ordem de Registros e Status de Discagem. | +List Mix ID -<\/B> ID of the list mix. Must be from 2-20 characters in length with no spaces or other special punctuation.|ID da Mescl. de Lista - ID da mesclagem de listas. Deve ter entre 2 e 20 caracteres de comprimento sem espaços ou pontos.| +List Mix Name -<\/B> Descriptive name of the list mix. Must be from 2-50 characters in length|Nome da Mescl. de Lista - nombre descriptivo de la mezcla dela lista. Debe ser a partir de 2-50 caracteres en longitud| +List Mix Detail -<\/B> The composition of the List Mix entry. Contains the List ID, mix order, percentages and statuses that make up this List Mix. The percentages always have to add up to 100, and the lists all have to be active and set to the campaign for the order mix entry to be Activated|Detalhes da Mescl. de Lista - Composição da Mesclagem de listas. Contém o ID, ordem, percentuais, e status que montam essa Mesclagem. Os percentuais devem sempre somar 100, e as listas devem estar ativas e configuradas na campanha em que a mesclagem vai ser configurada| +List Mix Method -<\/B> The method of mixing all of the parts of the List Mix Detail together. EVEN_MIX will mix leads from each part interleaved with the other parts, like this 1,2,3,1,2,3,1,2,3. IN_ORDER will put the leads in the order in which they are listed in the List Mix Detail screen 1,1,1,2,2,2,3,3,3. RANDOM will put them in RANDOM order 1,3,2,1,1,3,2,1,3. Default is IN_ORDER.|Método de Mesclagem - O método de Mesclagem de todos os ítens da lista. EVEN_MIX mistura os registros de cada parte intercalados com as outras partes, por exemplo: 1,2,3,1,2,3,1,2,3. IN_ORDER irá colocar os registros na ordem que estão listados na tela de detalhes 1,1,1,2,2,2,3,3,3. RANDOM irá colocar em ordem randômica: 1,3,2,1,1,3,2,1,3. O padrão é IN_ORDER.| +LIST MIXES FOR THIS CAMPAIGN: |MESCLAGEM DE LISTAS PARA ESTA CAMPANHA:| +The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls.|O campo RESPOSTA HUMANA(human_answered) é usado quando é calculado o percentual de desligamento(drop), ou índice de abandono. Configurando como Y irá usar este status quando for contar chamadas atendidas por humanos| +HUMAN ANSWER|RESPOSTA HUMANA| +ADDING VICIDIAL SYSTEM STATUSES|INCLUINDO STATUS DE SISTEMA DO VICIDIAL| +MODIFY VICIDIAL SYSTEM STATUSES|ALTERAR STATUS DE SISTEMA DO VICIDIAL| +SYSTEM STATUS NOT ADDED|STATUS DE SISTEMA NÃO INCLUÍDO| +SYSTEM STATUS ADDED|STATUS DE SISTEMA INCLUÍDO| +SYSTEM STATUS NOT DELETED|STATUS DE SISTEMA NÃO REMOVIDO| +the system status cannot be a reserved status: |el estado de sistema no puede ser un estado reservado:| +the system status needs to be at least 1 characters in length|el estado de sistema necesita ser por lo menos los caracteres 1 enlongitud| +VICIDIAL STATUSES WITHIN THIS SYSTEM: |ESTADOS DE VICIDIAL DENTRO DE ESTE SISTEMA:| +ADD NEW SYSTEM STATUS|INCLUIR STATUS DE SISTEMA| +CUSTOM CAMPAIGN STATUSES LISTINGS:|LISTA DE STATUS CUSTOMIZADOS:| +CAMPAIGN HOTKEYS LISTINGS:|LISTA DE ATALHOS DA CAMPANHA:| +CAMPAIGN LEAD RECYCLE LISTINGS:|LISTA DE RECICLAGEM DE REGISTROS:| +LEAD RECYCLES|RECICLAGEM DE REGISTROS| +CAMPAIGN LEAD AUTO-ALT DIAL LISTINGS:|LISTA DE DISC. ALTERN. DE REG.:| +CAMPAIGN AGENT PAUSE CODE LISTINGS:|LISTA DE CÓDIGOS DE PAUSA DE AGENTE:| +CAMPAIGN LIST MIX LISTINGS:|LISTA DE MESCLAGEM DE LISTA DE REGISTROS:| +The Category option allows you to group several statuses into a catogy that can be used for statistical analysis.|A opção de categoria permite agrupar vários status em uma categoria que podem ser usados para análise estatística.| +MODIFY VICIDIAL STATUS CATEGORIES|ALTERAR CATEGORIA DE STATUS| +ADDING VICIDIAL STATUS CATEGORY|INCLUIR CATEGORIA DE STATUS| + Status Categories |Categoria de Status| + System Statuses |Status do Sistema| +MODIFY VICIDIAL SYSTEM STATUSES|ALTERAR STATUS DE SISTEMA| +MODIFY VICIDIAL STATUS CATEGORY|ALTERAR CATEGORIA DE STATUS| +Through the use of system statuses, you can have statuses that exist for campaign and in-group. The Status must be 1-6 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as an agent disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a catogy that can be used for statistical analysis|Com o uso do status do sistema, você pode ter status que existem para campanhas e grupos de entrada. O Status deve ter entre 1 e 6 caracteres de comprimento, a descrição deve ter entre 2 e 30 caracteres de comprimento e Selecionável define se será mostrado no VICIDIAL na finalização da chamada. O campo human_answered é usado para calcular o percentual de drop, ou índice de abandono. Configurando human_answered para Y irá usar este status quando contando as chamadas atendidas por humanos. A opção de Categoria permite agrupar vários status em uma categoria que pode ser usada para análise estatística| +Through the use of system status categories, you can group together statuses to allow for statistical analysis on a group of statuses. The Category ID must be 2-20 characters in length with no spaces, the name must be 2-50 characters in length, the description is optional and TimeonVDAD Display defines whether that status will be one of the upto 4 statuses that can be calculated and displayed on the Time On VDAD Real-Time report|Através do uso de categoria de status de sistema, você pode agrupar status para permitir análise estatística em um grupo de status. O ID da categoria deve ter entre 2 e 20 caracteres sem espaços, o nome deve ter entre 2 e 50 caracteres, a descrição é opicional e o Mostrar TimeonVDAD define se o status deve ser um dos 4 status que podem ser calculados e mostrados no relatório em tempo real Time On VDAD | +ADD NEW STATUS CATEGORY|INCLUIR CATEG. DE STATUS| +STATUS CATEGORY NOT ADDED|CATEGORIA NÃO INCLUIDA| +there is already a status category in the system with this ID|já existe uma categoria de status com esse ID no sistema| +ID must be between 2 and 20 characters in length|ID deve ter entre 2 e 20 caracteres | +name name must be between 2 and 50 characters in length|o nome deve ter entre 2 e 50 caracteres| +STATUS CATEGORY NOT MODIFIED|CATEGORIA NÃO ALTERADA| +the status category cannot be a reserved category: |a categoria de status não pode ser uma categoria reservada:| +the status category needs to be at least 2 characters in length|a categoria de status precisa ter pelo menos 2 caracteres| +STATUS CATEGORY DELETED|CATEGORIA REMOVIDA| +STATUS CATEGORY MODIFIED|CATEGORIA ALTERADA| +Category: |Categoria:| +the system status name needs to be at least 1 characters in length|o nome do status deve ter pelo menos 1 caractere de comprimento| +SYSTEM STATUS NOT MODIFIED|STATUS DO SISTEMA NÃO ALTERADO| +SYSTEM STATUS MODIFIED|STATUS DO SISTEMA ALTERADO| +ERROR: There are already 4 Status Categories set to TimeOnVDAD Display|ERRO: Já existem 4 Categorias de Status no Relatório TimeOnVDAD| +CUSTOM CAMPAIGN STATUS MODIFIED|STATUS CUSTOMIZADO ALTERADO| +LIST MIX NOT MODIFIED|MESCLAGEM DE LISTA NÃO ALTERADA| +LIST MIX MODIFIED|MESCLAGEM DE LISTA ALTERADA| +You cannot delete the last list_id entry from a list mix|Você não pode apagar a última entrada de lista para uma mesclagem de lista| +LIST MIX ADDED: |MESCLAGEM INCLUÍDA:| +LIST MIX NOT ADDED |MESCLAGEM NÃO INCLUÍDA| +There is already a list mix with this ID in the system|Já existe uma mesclagem de lista com esse ID no sistema| +LIST MIX NOT DELETED|MESCLAGEM NÃO REMOVIDA| +LIST MIX DELETED: |MESCLAGEM REMOVIDA:| +SET TO ACTIVE|ATIVAR| +LIST MIX NOT ACTIVATED|MESCLAGEM NÃO ATIVADA| +LIST MIX ACTIVATED|MESCLAGEM ATIVADA| +Enable Agent Transfer Logfile -<\/B> This option will log to a text logfile on the webserver every time a call is transferred to an agent. Default is 0, disabled|Habilitar Log de Transf.- Esta opção irá gravar um regsitro de ocorrências em um arquivo no servidor web cada vez que uma chamada for transferida para um agente. O padrão é 0, desabilitado| +Enable Agent Transfer Logfile|Habilitar Log de Transferências| +Call Time -<\/B> This is the call time scheme to use for this inbound group. Keep in mind that the time is based on the server time. Default is 24hours|Horário de Chamada É a configuração do horário de chamada para ser usado neste grupo de entrada. Lembre-se que o horário é baseado no horário do servidor. Padrão é 24Horas| +After Hours Action -<\/B> The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field. Default is MESSAGE|Ação Fora de Expediente- A ação a ser tomada se a ligação for feita fora do horário estabelecido para esse grupo de entrada. HANGUP irá desligar imediatamente a chamada, MESSAGE irá tocar o arquivo definido no campo Arquivo de Mensagem Fora de Expediente, EXTENSION irá enviar a chamada para uma extensão do plano de discagem e VOICEMAIL irá enviar a chamada para a caixa postal listada no campo Voicemail Fora do Expediente. Padráo é MESSAGE| +After Hours Message Filename -<\/B> The audio file located on the server to be played if the Action is set to MESSAGE. Default is vm-goodbye|Arquivo Fora do Expediente - O arquivo de audio localizado no servidor, que deve ser tocado quando a ação estiver configurada como MESSAGE. Padrão é vm-goodbye| +After Hours Extension -<\/B> The dialplan extension to send the call to if the Action is set to EXTENSION. Default is 8300|Extensão Fora do Expediente - Extensão a ser enviada a chamada que entrar se o campo Ação estiver como EXTENSION. O padrão é 8300| +After Hours Voicemail -<\/B> The voicemail box to send the call to if the Action is set to VOICEMAIL|Voicemail Fora do Expediente- A caixa de VoiceMail a ser enviada a chamada, quando o campo Ação for VOICEMAIL| +Welcome Message Filename -<\/B> The audio file located on the server to be played when the call comes in. If set to ---NONE--- then no message will be played. Default is ---NONE---|Arquivo de Mensagem Boasvindas - Arquivo de audio localizado no servidor a ser tocado quando uma chamada entra. Se estiver configurado como ---NONE--- então nenhuma mensagem irá ser tocada. O padrão é ---NONE---| +Music On Hold Context -<\/B> The music on hold context to use when the customer is placed on hold. Default is default|Contexto da Música de Espera- O contexto de Música de Espera a ser usado quando o cliente é colocado em espera. O padrão é default| +On Hold Prompt Filename -<\/B> The audio file located on the server to be played at a regular interval when the customer is on hold. Default is generic_hold. This audio file MUST be 9 seconds or less in length.|Arquivo de Mensagem de Espera - Arquivo de audio localizado no servidor a ser tocado em um intervalo regular quando o cliente está em espera. O padrão é generic_hold. Este arquivo de audio deve ter até 9 segundos| +On Hold Prompt Interval -<\/B> The length of time in seconds to wait before playing the on hold prompt. Default is 60|Intervalo de Anúncio - O tempo em segundos para esperar até tocar a mensagem de Espera. O padrão é 60| +Agent Alert Extension -<\/B> The extension to send into the agent session to announce that a call is coming to the agent. This extension should have a Playback of an audio file. To not use this function set this to X. Default is X|Extensão de Alerta do Agente - É a extensão para enviar para a sessão do agente o anuncio da chamada entrante. Esta extensão deve ter um Playback de um arquivo de audio. Para não usar esta função, configure como X. O padrão é X| +Agent Alert Delay -<\/B> The length of time in milliseconds to wait before sending the call to the agent after playing the on Agent Alert Extension. Default is 1000|Atraso de Alerta ao Agente - O tempo em milisegundos para esperar antes de enviar a chamada para o agente após tocar na extensão do agente. O padrão é 1000| +Call Time: |Horário de Chamada:| +After Hours Action: |Ação Fora do Expediente:| +After Hours Message Filename: |Arquivo Fora do Expediente:| +After Hours Extension: |Extensão Fora do Expediente:| +After Hours Voicemail: |Voicemail Fora do Expediente:| +Welcome Message Filename: |Arquivo de Boas Vindas:| +Music On Hold Context: |Contexto da Música de Espera:| +On Hold Prompt Filename: |Arquivo de Aviso de Espera| +On Hold Prompt Interval: |Intervalo de Aviso de Espera:| +Agent Alert Extension: |Extensão de Alerta ao Agente:| +Agent Alert Delay: |Atraso de Alerta ao Agente:| +You will also be able to set the rank, or skill level, in this section for each of the inbound groups as well as being able to see the number of calls received from each inbound group for this specific agent|Você também poderá configurar o ranking, ou nível de conhecimento, nessa sessão para cada grupo de entrada, assim como será capaz de ver o número de chamadas recebidas por cada grupo de entrada por agente específico| +Allow Inbound and Blended -<\/B> This is where you can set whether the users of this campaign will have the option to take inbound calls with this campaign. If you want to do blended inbound and outbound then this must be set to Y. If you only want to do outbound dialing on this campaign set this to N. Default is N|Permitir Entrantes e Blended - Aqui é onde se configura se o usuário desta campanha irá ter a opção de receber chamadas entrantes nesta campanha. Se você quiser mesclar entrantes e saintes, deve estar configurado como Y. Se você quer apenas fazer chamadas saintes nesta campnaha, configure como N. O padrão é N| +Allow Inbound and Blended: |Permitir Entrantes e Blended:| +Manual Dial List ID -<\/B> The default list_id to be used when an agent placces a manual call and a new lead record is created in vicidial_list. Default is 999. This field can contain digits only|ID da Lista Manual - O list_id padrão para ser usado quando um agente faz uma chamada manual e novos registros são criados na vicidial_list. O padrão é 999. O campo pode receber somente digitos| +Manual Dial List ID: |ID da Lista Manual :| +inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest|inbound_group_rank: ordena pelo ranking dado para um agente para um grupo de entrada. Do mais alto para o mais baixo| +fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first|fewest_calls: ordena pelo número de chamadas recebidas por um agente para o grupo de entrada específico. Menor qtd de chamadas primeiro| +Campaign Ranks: |Rankings da Campanha:| +AGENT RANKS FOR THIS CAMPAIGN:|RANKING DO AGENTE NA CAMPANHA:| +Copy Campaign|Copiar Campanha| +COPY A CAMPAIGN|COPIAR CAMPANHA| +Source Campaign: |Campanha Origem:| +New Copied Campaign Addition|Inclusão de Campanha Copiada| +Copy In-Group|Copiar Grupo de Entrada| +New Copied In-Group Addition|Inclusão de Grupo de Entrada Copiada| +Copy User|Copiar Usuário| +New Copied User Addition|Inclusão de Usuário Copiado| +COPY USER|COPIAR USUÁRIO| +Copy In-Group|Copiar Grupo de Entrada| +COPY INBOUND GROUP|COPIAR GRUPO DE ENTRADA| +campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest|campaign_rank: ordena pelo ranking dado para o agente na campanha. Mais alto para Mais baixo| +Default Transfer Group -<\/B> This field is the default In-Group that will be automatically selected when the agent goes to the transfer-conference frame in their agent interface|Grupo de Transf. Padrão - Este campo é o Grupo de Entrada padrão que será automaticamente selecionado quando um agente seleciona transferência-conferência na tela do agente| +Default Transfer Group: |Grupo de Transferência Padrão:| +Allowed Transfer Groups: |Grupos de Transferência Permitidos:| +Allowed Transfer Groups -<\/B> With these checkbox listings you can select the groups that agents in this campaign can transfer calls to. Allow Closers must be enabled for this option to show up|Grupos de Transferência Permitidos - Nessa lista você pode selecionar grupos para os quais os agentes nessa campanha podem transferir chamadas. Permitir Finalizadores (closers) deve estar habilitado para que esta opção seja mostrada| +Campaign Ranks -<\/B> In this section you can define the rank an agent will have for each campaign. These ranks can be used to allow for preferred call routing when Next Agent Call is set to campaign_rank|Rankings da Campanha - Nessa sessão você define o ranking que cada agente terá em cada campanha. Esses rankings podem ser usados para permitir roteamento preferencial de chamadas quando o campo Próximo Agente está como campaign_rank| +Also in this section is the ability to give the agent a rank for each inbound group. These ranks can be used for preferred call routing when that option is selected in the in-group screen|Também nessa sessão está a possibilidade de atribuir um ranking do agente para cada Grupo de Entrada. Esses rankings podem ser usados para roteamento preferencial quando essa opção está selecionada na tela de Grupos de Entrada| +### START translations for 2.0.5 release ### +QC Enabled -<\/B> This option allows the user to log in to the Quality Control agent screen|CQ Habilitado - Esta opção permite ao usuário logar na tela de agente de Controle de Qualidade| +QC User Level -<\/B> This setting defines what the agent Quality Control user level is. This will dictate the level of functionality for the agent in the QC section|Nível de usuário CQ - Esta configuração define qual é o nível do usuário do Controle de Qualidade. Isso irá ditar o nível de funcionalidade desse agente na seção de CQ| +QC Record Pass -<\/B> This option allows the agent to specify that a record has passed the first round of QC after reviewing the record|Registro Passou no CQ - Esta opção permite ao agente especificar que um registro passou no primeiro nível de Controle de Qualidade após revisar o registro| +QC Record Finish -<\/B> This option allows the agent to specify that a record has finished the second round of QC after reviewing the passed record|Finalizado no CQ - Esta opção permite ao agente especificar que um registro finalizou o segundo nível de Controle de Qualidade após revisar o registro| +QC Record Commit -<\/B> This option allows the agent to specify that a record has been committed in QC. It can no longer be modified by anyone|Confirmado no CQ - Esta opção permite ao agente especificar que um registro foi Confirmado no Controle de Qualidade. E não poderá ser alterado por ninguém| +QC Allowed Campaigns -<\/B> This is a selectable list of Campaigns which members of this user group will be able to QC. The ALL-CAMPAIGNS option allows the users in this group to QC any campaign on the system|Campanha com CQ - Esta lista selecionável de campanhas tem os membros para esse grupo de usuários que terão habilitado o controle de qualidade. A opcão ALL-CAMPAIGNS permite ao usuário neste grupo fazer controle de qualidade em qualquer campanha do sistema| +QC Allowed Inbound Groups -<\/B> This is a selectable list of Inbound Groups which members of this user group will be able to QC. The ALL-GROUPS option allows the users in this user group to QC any inbound group on the system|Permitir CQ de Entrada- Esta é uma lista selecionável de Grupos de Entrada aos quais os membros deste grupo de usuários podem realizar Controle de Qualidade. A opção ALL-GROUPS permite que usuários deste grupo fazer Controle de Qualidade em qualquer grupo do sistema| +QC Enabled: |CQ Ativado:| +QC User Level: |Nível de Usuário CQ:| +QC Pass: |Passou no CQ:| +QC Finish: |Fim do CQ:| +QC Commit: |Confirmado CQ:| +Modify Nothing|Não Modificar Nada| +Modify Nothing Except Status|Não Modificar Nada Exceto Status| +Modify All Fields|Modificar Todos Campos| +Verify First Round of QC|Verificar primeiro nível de CQ| +View QC Statistics|Vizualizar Estatísticas de CQ| +Ability to Modify FINISHed records|Capacidade de Alterar Registros Finalizados| +Manager Level|Nível Gerente| +USERS CAN VIEW ANY CAMPAIGN|USUÁRIOS PODEM VER QUALQUER CAMPANHA| +USERS CAN QC ANY CAMPAIGN|USUÁRIOS PODEM FAZER CQ EM QUALQUER CAMPANHA| +USERS CAN QC ANY INBOUND GROUP|USUÁRIOS PODEM FAZER CQ EM QUALQUER GRUPO DE ENTRADA| +QC Allowed Campaigns: |Campanhas Permitidas no CQ:| +QC Allowed Inbound Groups: |Grupos de Entrada para CQ:| +Queue Priority -<\/B> This setting is used to define the order in which the calls from this outbound campaign should be answered in relation to the inbound calls if this campaign is in blended mode|Prioridade da Fila - Valor utilizado para definir a ordem na qual as chamadas dessa campanha de saída devem ser respondidas em relação as chamadas entrantes desta campanha em modo blended| +Queue Priority: |Prioridade da Fila:| +Drop Action: |Ação de Drop:| +Drop Transfer Group: |Grupo de Transferência de Drop:| +Drop Action -<\/B> This menu allows you to choose what happens to a call when it has been waiting for longer than what is set in the Drop Call Seconds field. HANGUP will simply hang up the call, MESSAGE will send the call the Drop Exten that you have defined below, VOICEMAIL will send the call to the voicemail box that you have defined below and IN_GROUP will send the call to the Inbound Group that is defined below|Ação de Drop - Este menu permite que você escolha o que acontece com uma chamada quando esta ficou esperando mais que o tempo configurado no campo Tempo Limite de Drop. HANGUP irá simplesmente desligar a chamada, MESSAGE irá enviar a chamada para Extensão de Drop que você definiu abaixo, VOICEMAIL irá enviar a chamada para a caixa de voicemail que você definiu abaixo e IN_GROUP irá enviar a chamada para o grupo de entrada que você define abaixo| +Drop Exten -<\/B> If Drop Action is set to MESSAGE, this is the dial plan extension that the call will be sent to if it reaches Drop Call Seconds|Extensão de Drop - Se a Ação de Drop estiver configurada como MESSAGE, este é o número do plano de discagem a ser discado para transferir a chamada após o tempo limite de drop| +Drop Call Seconds -<\/B> The number of seconds a call will stay in queue before being considered a DROP|Tempo Limite de Drop- O número em segundos que uma chamada deve ficar na fila de espera até ser considerada um DROP| +Drop Transfer Group -<\/B> If Drop Action is set to IN_GROUP, the call will be sent to this inbound group if it reaches Drop Call Seconds|Grupo de Transferência de Drop - Caso a Ação de Drop esteja configurada como IN_GROUP, a chamada será enviada para esse Grupo de Entrada após o tempo limite| +QC SETTINGS FOR THIS CAMPAIGN|CONFIGURAÇÕES DE CQ PARA CAMPANHA| +QC Enabled: |CQ Ativado:| +QC Statuses: |Status de CQ:| +Modify Campaign QC Settings|Alterar Configurações de CQ| +QC Enabled -<\/B> Setting this field to Y allows for the agent Quality Control features to work. Default is N|CQ Ativado - Configurando este campo como Y permite que os recursos de Controle de Qualidade do agente funcionem. O padrão é N| +QC Statuses -<\/B> This area is where you select which statuses of leads should be gone over by the QC system. Place a check next to the status that you want QC to review|Status de CQ - Esta área é onde você escolhe quais status de registro devem passar pelo Controle de Qualidade. Selecione o status que você quer que o CQ revise| +QC SETTINGS NOT MODIFIED|CONFIG. DE CQ NÃO ALTERADAS| +QC SETTINGS MODIFIED|CONFIG. DE CQ ALTERADAS| +QC WebForm Address -<\/B> This is the website address that a QC agent can go to when clicking on the WEBFORM link in the QC screen|Endereço WebForm de CQ - Este é o endereço do websitem que o agente de CQ pode entrar quando clicar no botão WEBFORM na tela de CQ| +QC Script -<\/B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen|Script CQ - Este é o Script que pode ser usado pelos agentes de CQ na aba SCRIPT na tela de CQ| +QC WebForm: |WebForm de CQ:| +QC Script|Script de CQ| +In-Group Recording Override -<\/B> This field allows for the overriding of the campaign call recording setting. This setting can be overridden by the vicidial_user recording override setting. DISABLED will not override the campaign recording setting. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording|Sobreposição de Gravação de Entrada - Este campo permite a sobreposição da configuração da gravação na campanha. Esta configuração pode ser sobreposta pela configuração de sobreposição de gravação do usuário. DISABLED não irá sobrepor a configuração da campanha. NEVER irá desabilitar a gravação no client. ONDEMAND é o padrão e permite ao agente iniciar e finalizar a gravação conforme necessário. ALLCALLS irá iniciar a gravação no client quando uma chamada é enviada ao agente. ALLFORCE irá iniciar gravação no client sempre que uma ligação é enviada ao agente sem dar opção ao agente de parar a gravação| +In-Group Recording Filename -<\/B> This field will override the Campaign Recording Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE|Nome do Arquivo de Gravação de Entrada- Este campo irá sobrepor o perfil de nome de arquivo de gravação da campanha, a não ser que esteja configurado como NONE. As variáveis permitidas são: CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. O padrão é FULLDATE_AGENT e irá ficar assim: 20051020-103108_6666. Outro exemplo é CAMPAIGN_TINYDATE_CUSTPHONE que irá ficar assim: TESTCAMP_51020103108_3125551212. 50 caracteres no máximo. Padrão é NONE| +In-Group Recording Override: |Sobrepor Config. de Grav. de Entr.:| +In-Group Recording Filename: |Arquivo de Gravação de Entrada:| +ADDING VICIDIAL QC STATUS CODE|INCLUINDO CÓDIGO DE STATUS DE CQ| +MODIFY VICIDIAL QC STATUS CODE|ALTERAR CÓDIGO DE STATUS DE CQ| +VICIDIAL QC STATUS CODES|CÓDIGOS DE STATUS DE CONTROLE DE QUALIDADE| +The Quality Control-QC system within VICIDIAL has its own set of status codes separate from those within the call handling functions of VICIDIAL. QC statuse codes must be between 2 and 8 characters in length and contain no special characters like a space or colon. The QC status code description must be between 2 and 30 characters in length.|O sistema de Controle de Qualidade do VICIDIAL tem seu conjunto de status separados daqueles usados na finalização de chamadas do VICIDIAL. Os códigos de CQ devem ter entre 2 e 8 caracteres de comprimento e não podem conter caracteres especiais como espaços ou virgulas. A descrição do código de status de CQ deve ter entre 2 e 30 caracteres| + QC Status Codes |Cód. de Status CQ| +VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM: |CÓDIGOS DE STATUS DE CQ NESTE SISTEMA VICIDIAL:| +ADD NEW QC STATUS CODE|INCLUIR CÓDIGO DE CQ| +QC STATUS CODE NOT DELETED|CÓDIGO DE STATUS CQ NÃO REMOVIDO| +QC STATUS CODE DELETED: |CÓDIGO DE STATUS CQ REMOVIDO:| +QC STATUS CODE NOT MODIFIED |CÓDIGO DE STATUS CQ NÃO ALTERADO| +QC STATUS CODE MODIFIED: |CÓDIGO DE STATUS CQ ALTERADO:| +the qc status code needs to be at least 1 characters in length|o código de status cq precisa ter pelo menos 1 caracter de comprimento| +the qc status code name needs to be at least 1 characters in length|o nome do status cq precisa ter pelo menos 1 caracter de comprimento| +QC STATUS CODE NOT ADDED |CÓDIGO DE STATUS CQ NÃO INCLUÍDO| +there is already a qc status code in the system with this name:|já existe um código de status cq no sistema com esse nome:| +QC STATUS CODE ADDED: |CÓDIGO DE STATUS CQ ADICIONADO:| +code must be between 1 and 8 characters in length|código deve ter entre 1 e 8 caracteres de comprimento| +code name must be between 2 and 30 characters in length|nome do código deve ter entre 2 e 30 caracteres de comprimento| +CALL HANGUP REASON STATS|ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO| +After Hours Action -<\/B> The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field, IN_GROUP will send the call to the inbound group selected in the After Hours Transfer Group select list. Default is MESSAGE|Ação Fora do Expediente - A ação a ser realizada se o horário for fora do definido no horário de chamada para este grupo de entrada. HANGUP irá imediatamente desligar a chamada, MESSAGE irá tocar o arquivo no campo Arquivo de Mensagem Fora de Expediente, EXTENSION irá enviar a chamada para o extensão do campo Extensão Fora do Expediente no plano de discagem e VOICEMAIL irá enviar a chamada para a caixa de voicemail listada no campo de Voicemail Fora do Expediente, IN_GROUP irá enviar a chamada para o grupo de entrada selecionado na lista Grupo de Entrada Fora do Expediente. Padrão é MESSAGE| +After Hours Transfer Group -<\/B> If After Hours Action is set to IN_GROUP, the call will be sent to this inbound group if it enters the in-group outside of the call time scheme defined for the in-group|Grupo de Transferência Fora do Expediente- Se a Ação de Fora do Expediente estiver configurada para IN_GROUP, a chamada irá ser enviada para esse grupo de entrada se ela entrar neste grupo de entrada fora do horário configurado no Horário de Chamadas para este grupo de entrada| +After Hours Transfer Group: |Grupo de Transferência Fora do Exped.:| +Total calls taken in to this In-Group:|Total de chamadas recebidas pelo Grupo:| +CALL HOLD TIME BREAKDOWN IN SECONDS|TEMPO DE ESPERA POR SEGUNDOS| +Date Range:|Período:| +ADDING NEW PHONE ALIAS|INCLUINDO ALIAS DE RAMAL| +ADD NEW PHONE ALIAS|INCLUIR ALIAS DE RAMAL| +MODIFY PHONE ALIAS|ALTERAR ALIAS DE RAMAL| +DELETE PHONE ALIAS|REMOVER ALIAS DE RAMAL| +PHONE ALIAS LIST|LISTA DE ALIAS DE RAMAL| +Phone Alias List|Lista de Alias de Ramal| +Add A New Phone Alias|Incluir Alias de Ramal| +ADD A NEW PHONE ALIAS|INCLUIR ALIAS DE RAMAL| +Alias ID: |ID do Alias:| +Alias Name: |Nome do Alias: | +Phone Logins List: |Lista de Logins de Ramal:| +PHONE ALIAS NOT ADDED|ALIAS DE RAMAL NÃO INCLUIDO| +there is already a Phone Alias in the system with this ID|já existe um Alias de Ramal no sistema com esse ID| +there is already a Phone Login in the system with this ID|ja existe um Login no sistema com esse ID| +PHONE ALIAS ADDED|ALIAS DE RAMAL INCLUÍDO| +PHONE ALIAS NOT MODIFIED|ALIAS DE RAMAL NÃO ALTERADO| +PHONE ALIAS MODIFIED|ALIAS DE RAMAL ALTERADO| +PHONE ALIAS NOT DELETED|ALIAS DE RAMAL NÃO REMOVIDO| +PHONE ALIAS DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE ALIAS| +Click here to delete phone alias|Clique aqui para remover o alias de ramal| +PHONE ALIAS DELETION COMPLETED|REMOÇÃO DO ALIAS DE RAMAL CONCLUÍDA| +PHONE ALIAS LISTINGS|LISTAGEM DE ALIAS DE RAMAL| +there is already a Phone alias in the system with this login|já existe um alias de Ramal no sistema com esse login| +there is already a Phone in the system with this login|já existe um Ramal no sistema com este login| +DELETE THIS PHONE ALIAS|REMOVER ESTE ALIAS DE RAMAL| +MODIFY A PHONE ALIAS RECORD|ALTERAR UM ALIAS DE RAMAL| +Alias ID -<\/B> The ID of the alias used to allow for phone load balanced logins. no spaces or other special characters allowed. Must be between 2 and 20 characters in length|ID do Alias - O ID do alias usado para permitir balanceamento de carga entre ramais. Não é permitido espacos ou caracteres especiais. Deve ter entre 2 e 20 caracteres| +Alias Name -<\/B> The name used to describe a phones alias, Must be between 2 and 50 characters in length|Nome do Alias - O nome usado para descrever o alias do ramal, deve ter entre 2 e 50 caracteres| +Phones Logins List -<\/B> The comma separated list of phone logins used when an agent logs in using phone load balanced logins. The Agent application will find the active server with the fewest agents logged into it and place a call from that server to the agent upon login|Lista de Logins de Ramais - Uma lista, separada por vírgulas, logins de ramais usados quando o agente está usando ramais do balanceamento de carga. O aplicativo agente irá encontrar o servidor ativo com a menor quantidade de agentes logados e fazer a chamada a partir daquele servidor para o agente no login| +PHONES WITHIN THIS PHONES ALIAS|RAMAIS DESTE ALIAS| +Add New Shift|Incluir Turno| +New Shift Addition|Inclusão de Turno| +Modify Shift|Alterar Turno| +Delete Shift|Remover Turno| +Shifts|Turnos| +Shift ID -<\/B> This is the short name of a Vicidial Shift Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters|ID do Turno- Este é o nome curto para uma definicao de Turno. Precisa ser um identificador único. Não usar pontos ou espaços para este campo, máximo de 20 e mínimo de 2 caracteres| +Shift Name -<\/B> This is a more descriptive name of the Shift Definition. This is a short summary of the Shift definition. max 50 characters, minimum of 2 characters|Nome do Turno - Este é um nome mais descritivo da definição do turno. É um resumo da definição do turno. Máximo de 50 caracteres, mínimo de 2 caracteres| +Shift Start Time -<\/B> This is the time that the campaign shift begins. Must only be numbers, 9:30 AM would be 0930 and 5:00 PM would be 1700|Início do Turno- É o horário que o turno da campanha começa. Deve ter apenas números, 9:30 seria apenas 0930 e 17:00 seria 1700| +Shift Length -<\/B> This is the time in Hours and Minutes that the campaign shift lasts. 8 hours would be 08:00 and 7 hours and 30 minutes would be 07:30|Duração do Turno - Este é o tempo em horas e minutos que dura o turno. 8 horas seria 08:00 e 7 horas e 30 minutos seria 7:30| +Shift Weekdays -<\/B> In this section you should choose the days of the week that this shift is active|Dias do Turno - Nesta sessão você deve escolher os dias da semana em que este turno funciona| +Show Shifts|Mostrar Turnos| +Add A New Shift|Incluir Turno| +Shift ID: |ID do Turno:| +Shift Name: |Nome do Turno:| +Shift Start Time: |Início do Turno:| +Shift End Time: |Final do Turno:| +SHIFT DEFINITION NOT ADDED|CONFIGURAÇÃO DE TURNO NÃO INCLUÍDA| +there is already a shift entry with this ID|já existe uma entrada de turno com este ID| +Shift ID and name must be at least 2 characters in length|ID e Nome do turno devem ter pelo menos 2 caracteres| +Shift Start Time must be 4 digits in length and be a valid time|Horário de início deve ter 4 caracteres e ser um horário válido| +Shift Length must be 5 characters in length and be 24 hours or less|Duração do Turno deve ter 5 caracteres e 24 horas ou menos| +SHIFT ADDED: |TURNO INCLUÍDO:| +MODIFY A SHIFT|ALTERAR TURNO| +USER GROUPS USING THIS SHIFT:|GRUPOS DE USUÁRIO USANDO ESTE TURNO:| +DELETE THIS SHIFT DEFINITION|REMOVER ESTE TURNO| +MODIFY A SHIFT|ALTERAR TURNO| +SHIFT NOT DELETED|TURNO NÃO REMOVIDO| +SHIFT DELETION CONFIRMATION: |CONFIRMAÇÃO DE REMOÇÃO DE TURNO:| +Click here to delete shift|Clique aqui para remover o turno| +SHIFT DELETION COMPLETED:|REMOÇÃO DE TURNO FINALIZADA:| +SHIFT MODIFIED|TURNOS ALTERADOS| +SHIFT LISTINGS:|LISTA DE TURNOS:| +Shift Weekdays: |Dias do Turno:| +Sunday|Domingo| +Monday|Segunda| +Tuesday|Terça| +Wednesday|Quarta| +Thursday|Quinta| +Friday|Sexta| +Saturday|Sábado| +Group Shifts: |Turnos do Grupo:| +Group Shifts -<\/B> This is a selectable list of shifts that can restrict the agents login time on the system|Turnos do Grupo - Esta é uma lista selecionável de turnos que podem restringir o login do agente no sistema| + Timeclock|Relógio Ponto| +Timeclock End Of Day -<\/B> This setting defines when all users are to be auto logged out of the timeclock system. Only runs once a day. must be only 4 digits 2 digit hour and 2 digit minutes in 24 hour time. Default is 0000|Fim do dia - Esta configuração define quando os usuários devem ser retirados do sistema de ponto automaticamente. Só roda uma vez por dia. Deve ter somente 4 caracteres, 2 para hora e 2 para os minutos no formato 24 horas. O padrão é 0000| +Timeclock Last Auto Logout -<\/B> This field displays the date of the last auto-logout|Último Logout Automático do Ponto - Este campo mostra a data do último logout automático -| +Timeclock Last Auto Logout: |Último Logout Automático do Ponto:| +Timeclock End Of Day: |Timeclock Final do Dia:| +SURVEY SETTINGS FOR THIS CAMPAIGN:|CONFIG. DE PESQUISA PARA ESTA CAMPANHA:| +Modify Campaign Survey|Alterar Campanha de Pesquisa| +Survey First Audio File -<\/B> This is the audio filename that is played as soon as the customer picks up the phone when running a survey campaign.|Primeiro Audio da Pesquisa - Este é o nome do arquivo de audio que é tocado assim que o cliente atende o telefone em uma campanha de pesquisa.| +Survey DTMF Digits -<\/B> This field is where you define the digits that a customer can press as an option on a survey campaign. valid dtmf digits are |Digitos DTMF da Pesquisa - Este campo é onde você define os digitos que um cliente pode digitar como opção para campanha de pesquisa. Digitos válidos são | +Survey Not Interested Digit -<\/B> This field is where you define the customer digit pressed that will show they are Not Interested.|Digito de Não Interessado - Este campo é onde você define qual digito o cliente aperta para dizer que não está interessado.| +Survey Not Interested Status -<\/B> This field is where you select the status to be used for Not Interested. If DNC is used and the campaign is set to use DNC then the phone number will be automatically added to the VICIDIAL internal DNC list.|Status de Não Interessado - Este campo é onde você seleciona o status a ser usado para Não Interessado. Se o DNC for usado e a campanha estiver configurada para Bloquear DNC então o número do telefone irá automaticamente para a lista de Não Ligar do VICIDIAL.| +Survey Opt-in Audio File -<\/B> This is the audio filename that is played when the customer has opted-in to the survey, not opted-out or not responded if the no-response-action is set to OPTOUT. After this audio file is played, the Survey Method action is taken.|Arquivo de Aceito - Este é o arquivo de audio que é tocado quando o cliente aceita participar da pesquisa, não respondeu "não interessado" e não respondeu, se a opção de ação sem resposta for OPTOUT. Após esse arquivo de audio ser tocado, a ação do método de pesquisa é realizada | +Survey Not Interested Audio File -<\/B> This is the audio filename that is played when the customer has opted-out of the survey, not opted-in or not responded if the no-response-action is set to OPTIN. After this audio file is played, the call will be hung up|Arquivo de Não Interessado - Este é o nome do arquivo de audio que é tocado quando o cliente desistiu da pesquisa, não aceitou a pesquisa ou não respondeu, caso a ação para sem resposta seja OPTIN. Após este arquivo de audio ser tocado, a chamada será desligada| +Survey Method -<\/B> This option defines what happens to a call after the customer has opted-in. AGENT_XFER will send the call to the next available agent. VOICEMAIL will send the call to the voicemail box that is specified in the Voicemail field. EXTENSION will send the customer to the extension defined in the Survey Xfer Extension field. HANGUP will hang up the customer. CAMPREC_60_WAV will send the customer to have a recording made with their response, this recording will be placed in a folder named as the campaign inside of the Survey Campaign Recording Directory.|Método de Pesquisa - Esta opção define o que acontece com uma chamada após o cliente ter aceitado a pesquisa. AGENT_XFER irá enviar a chamada para o próximo agente disponível. VOICEMAIL irá enviar a chamada para o voicemail especificado no campo Voicemail. EXTENSION irá enviar o cliente para uma extensão definida no campo Extensão de Transf. HANGUP irá desligar o cliente. CAMPREC_60_WAV irá enviar o cliente para que grave uma resposta, esta gravação ficará na pasta com o nome da campanha, dentro do diretório de gravações da Campanha de Pesquisa| +Survey No-Response Action -<\/B> This is where you define what will happen if there is no response to the survey question. OPTIN will only send the call on to the Survey Method if the customer presses a dtmf digit. OPTOUT will send the customer on to the Survey Method even if they do not press a dtmf digit.|Ação p/ Sem Resposta - Aqui é definido o que acontece se não há resposta para a pergunta da pesquisa. OPTIN só irá enviar a chamada para o método de pesquisa se o cliente apertar algum digito DTMF. OPTOUT irá enviar o cliente para o método mesmo que ele não pressione um dígito.| +Survey Response Digit Map -<\/B> This is the section where you can define a description to go with each dtmf digit option that the customer may select.| Mapa de Digitos de Resposta - Aqui você pode definir uma descrição para representar cada dígito que o cliente pode selecionar| +Survey Xfer Extension -<\/B> If the Survey Method of EXTENSION is selected then the customer call would be directed to this dialplan extension|Extensão de Transfer. - Se o método de pesquisa selecionado for EXTENSION o cliente será transferido para esta extensão do plano de discagem| +Survey Campaign Recording Directory -<\/B> If the Survey Method of CAMPREC_60_WAV is selected then the customer response will be recorded and placed in a directory named after the campaign inside of this directory.|Diretório de Gravação - Se o método de pesquisa selecionado for CAMPREC_60_WAV então o cliente poderá gravar uma mensagem que será colocada no diretório com o nome da campanha, dentro deste diretório| +SURVEY SETTINGS NOT MODIFIED|CONFIGURAÇÃO DE PESQUISA NÃO ALTERADA| +SURVEY SETTINGS MODIFIED|CONFIGURAÇÃO DE PESQUISA ALTERADA| +Survey First Audio File|Primeiro Arquivo de Audio| +Survey DTMF Digits|Dígitos DTMF| +Survey Not Interested Digit|Dígito p/ Não Interessado| +Survey Not Interested Status|Status p/ Não Interessado| +Survey Opt-in Audio File|Arquivo de Audio para Interessado| +Survey Not Interested Audio File|Arquivo de Audio para não Interessado| +Survey Method|Método de Pesquisa| +Survey No-Response Action|Ação p/ sem Resposta| +Survey Response Digit Map|Mapa de Digitos| +Survey Xfer Extension|Extensão de Transfer.| +Survey Campaign Recording Directory|Diretório de Gravações da Pesquisa| +Add Timeclock Log Record -<\/B> This option allows the user to add records to the timeclock log|Incluir Registro de Ponto - Esta opção permite ao usuário adicionar registros de log ao Relógio de Ponto| +Modify Timeclock Log Record -<\/B> This option allows the user to modify records in the timeclock log|Alterar Registro de Log do Ponto - Esta opção permite ao usuário alterar os registros do log do Relógio de ponto| +Delete Timeclock Log Record -<\/B> This option allows the user to delete records in the timeclock log|Remover Registro de Log do Ponto - Esta opção permite ao usuário remover registros do log do relógio de ponto| +Add Timeclock Log Record|Incluir Registro de Ponto| +Modify Timeclock Log Record|Alterar Registro de Log do Ponto| +Delete Timeclock Log Record|Remover Registro de Log do Ponto| +USER GROUP TIMECLOCK STATUS REPORT|RELATÓRIO DE STATUS DE RELÓGIO DE PONTO| +Click here to see the Timeclock Status for this user group|Clique aqui para ver o Status de Relógio de ponto para este usuário| +ADD NUMBERS TO THE DNC LIST|INCLUIR NÚMEROS PARA LISTA DE BLOQUEIO| +Phone Numbers: |Números de Telefone:| +one phone number per line only|somente um telefone por linha| +VICIDIAL DNC List -<\/B> This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add numbers to this list so that they will not be called by campaigns that use the internal DNC list|Lista de Bloqueio do VICIDIAL - Esta lista de bloqueio contém cada registro que foi enviado para um status de Não Ligar no sistema. Através da página: LISTAS - INCLUIR BLOQUEIO você pode manualmente adicionar números para esta lista para que não sejam ligados por campanhas que usam a lista de bloqueio interna| + Time Sheet |Planilha de Horário| +Timeclock Record Edit|Alteração de Ponto| +Default date format with year month day|Formato de data Padrão com ano mês dia| +USA date format with month day year|Formato de data dos EUA com mês dia ano| +European date format with day month year|Formato de data Europeu com dia mês ano| +Text date format with abbreviated month day|Formato de data abreviada em texto com mes e dia| +followed by 24 hour time|seguido por horário 24 horas| +followed by 12 hour time|seguido por horário 12 horas| +Agent Screen Header Date Format -<\/B> This menu allows you to choose the format of the date that shows up at the top of the VICIDIAL agent screen. The options for this setting are: default is|Formato da data do cabeçalho da tela do agente - Este menu permite você escolher o formato da data que é mostrada na parte de cima da tela do agente. As opções para esta configuração são: o padrão é| +Agent Screen Customer Date Format -<\/B> This menu allows you to choose the format of the customer time zone date that shows up at the top of the Customer Information section of the VICIDIAL agent screen. The options for this setting are: default is|Formato da data do cliente na tela do agente - Este menú permite você selecionar o formato para a data no fuso horário do cliente que aparece no topo das informações sobre o cliente na tela do agente. As opções para esta configuração são: o padrão é| +Agent Screen Customer Phone Format -<\/B> This menu allows you to choose the format of the customer phone number that shows up in the status section of the VICIDIAL agent screen. The options for this setting are: default is|Formato do Telefone do Cliente na Tela do Agente - Este menú permite escolher o formato do telefone do cliente que é mostrado na seção de status da tela do agente. As opções são: o padrão é| +dash separated phone number|número separado por traço| +dash separated number with area code in parenthesis|número separado por traço, ddd entre parentesis| +No formatting|Sem Formatação| +with space after city code|com espaço após o código da cidade| +space separated phone number|número separado por espaços| +Agent Screen Header Date Format|Formato da Data no Cabeçalho da tela do Agente| +Agent Screen Customer Date Format|Formato da Data do Cliente na tela do Agente| +Agent Screen Customer Phone Format|Formato do Número do Telefone na tela do Agente| +ERROR- There is a problem with the data that you entered, please go back|ERRO - Existe um problema com os dados digitados, por favor retorne| +A timeclock session cannot overlap another timeclock session|Uma sessão de Ponto não pode sobrepor outra sessão de ponto| +Disable Alter Customer Phone -<\/B> If set to Y, does not change the customer phone number when an agent dispositions the call. Default is Y|Desab. Alterar Telefone do Cliente - Se configurado como Y, não altera o telefone do cliente quando um agente finaliza a chamada. O padrão é Y| +Agent API Access -<\/B> This option allows the account to be used with the vicidial agent API commands|Agente para Acesso ao API - Esta opção permite esta conta ser usada com comandos de API| +Agent Alter Customer Phone Override -<\/B> This option will override whatever the option is in the campaign for altering of customer phone number. NOT_ACTIVE will use whatever setting is present for the campaign. ALLOW_ALTER will always allow for the agent to alter the customer phone number, no matter what the campaign setting is. Default is NOT_ACTIVE|Sobrepor Permissão de Alter. de Telefone- Esta opção irá sobrepor qualquer configuração na campanha sobre alterar o telefone do cliente. NOT_ACTIVE irá usar a configuração presente na campanha. ALLOW_ALTER irá sempre permitir que o agente altere o telefone do cliente, não importando a configuração da campanha. O padrão é NOT_ACTIVE| +Agent API Active -<\/B> If set to 1, this will allow the Agent API interface to function. Default is 0|API do Agente Ativa - Se configurado como 1, irá permitir que a interface API do agente Funcione. O padrão é 0| +Agent Alter Customer Phone Override: |Sobrepor Permissão de Alter. de Telefone:| +Agent API Access: |Agente para Acesso ao API:| +Disable Alter Customer Phone: |Desab. Alterar Telefone do Cliente :| +Agent API Active: |API do Agente Ativa:| +Agent Display Queue Count -<\/B> If set to Y, when a customer is waiting for an agent, the Queue Calls display at the top of the agent screen will turn red and show the number of waiting calls. Default is Y|Mostrar Contagem da Fila ao Agente - Quando configurada como Y, quando um cliente está esperando um agente, será demonstrado na tela do agente a quantidade de clientes em espera. O padrão é Y| +Agent Display Queue Count: |Mostrar Clientes em Espera ao Agente:| +agents in dead calls|agentes em chamadas perdidas| +QC Last Pull Time: |Última Hora de Retirada do CQ:| +and less than 43200 seconds or 12 hours|e menos de 43200 segundos ou 12 horas| +LEADS AT LIMIT|REGISTROS NO LIMITE| +Lead counts taken from active lists in the campaign only|Contagem de registros tirada das listas ativas nesta campanha| +QC Get Record Launch-<\/B> This allows one of the following actions to be triggered upon a QC agent receiving a new record|Entrada do Registro de CQ - Isso permite uma das seguintes ações a ser ativada na entrada de um registro de CQ para um agente| +QC Show Recording -<\/B> This allows for a recording that may be linked with the QC record to be display in the QC agent screen|Mostrar Gravação do CQ - Permite que uma gravação que está ligada com o registro do CQ seja mostrada na tela do agente de CQ| +QC Shift -<\/B> This is the shift timeframe used to pull QC records for a campaign. The days of the week are ignored for these functions|Turno de CQ- Este é o controle de tempo usado para trazer registros de uma campanha para o CQ. Os dias da semana são ignorados para esta função| +QC Get Record Launch|Entrada de registro CQ| +QC Show Recording|Mostrar Gravações CQ| +QC Shift|Turno de CQ| +Inbound Group QC Settings|Config. de CQ para Entrantes| +QC Shift -<\/B> This is the shift timeframe used to pull QC records for an inbound_group. The days of the week are ignored for these functions|Turno de CQ - Este é o turno usado pelo CQ para trazer registros de CQ para um grupo de entrada. Os dias da semana são ignorados para estas funções| +The Sale Category and Dead Lead Category are both used by the List Suggestion system when analyzing list statistics.|A Categoria de Venda e a Categoria Registro Ruim são ambas usadas pelo sistema de Sugestão de Listas quando analisando as estatisticas da lista.| +Sale Category: |Categoria de Venda:| +Dead Lead Category: |Categoria de Registro Ruim:| +Manual Dial Filter -<\/B> This allows you to filter the calls that agents make in manual dial mode for this campaign by any combination of the following: DNC - to kick out, CAMPAIGNLISTS - the number must be within the lists for the campaign, NONE - no filter on manual dial or fast dial lists|Filtro de Discagem Manual - Permite que você filtre as chamadas que os agentes fazem no modo manual de discagem para esta campanha por uma combinação dos seguintes: DNC - para tirar, CAMPAIGNLISTS - o número deve estar nas lístas para a campanha, NONE - sem filtros na discagem manual ou lista de discagem rápida | +Manual Dial Filter: |Filtro de Discagem Manual:| +Agent Screen Clipboard Copy -<\/B> THIS FEATURE IS CURRENTLY ONLY ENABLED FOR INTERNET EXPLORER. This feature allows you to select a field that will be copied to the computer clipboard of the agent computer upon a call being sent to an agent. Common uses for this are to allow for easy pasting of account numbers or phone numbers into legacy client applications on the agent computer|Cópia p/ Área de Transf. do Agente - ESTE RECURSO SÓ FUNCIONA NO INTERNET EXPLORER. Este recurso permite que você escolha um campo que será copiado para a área de transferência do agente quando uma chamada é enviada ao agente. Um uso comum para este recurso é permitir fácil uso do comando "colar" para números do cliente ou números de telefone em aplicativos cliente no computador do agente| +Agent Screen Clipboard Copy|Cópia p/ Área de Transf. do Agente| +EXTENDED alternate numbers are numbers loaded into the system outside of the standard lead information screen. Using EXTENDED you can have hundreds of phone numbers for a single customer record.|EXTENDIDOS são números alternativos que são carregados no sistema fora da tela padrão de informações sobre registros. Usando EXTENDED você pode ter centenas de números de telefone para um único registro de cliente. | +Agent Screen Extended Alt Dial -<\/B> This feature allows for agents to access extended alternate phone numbers for leads beyond the standard Alt Phone and Address3 fields that can be used in VICIDIAL for phone numbers beyond the main phone number. The Extended phone numbers can be dialed automatically using the Auto-Alt-Dial feature in VICIDIAL Campaign settings, but enabling this Agent Screen feature will also allow for the agent to call these numbers from their agent screen as well as edit their information|Discagem Extendida na tela do Agente - Este recurso permite ao agente acessar a lista extendida de telefones alternativos para o registro, além dos campos Alt Phone e Address3, que podem ser usados no vicidial para números de telefone além do telefone principal do cliente. Os números extendidos podem ser discados automaticamente usando-se o recurso Auto-Alt-Dial nas config. da campanha, mas habilitar isso na tela do Agente irá permitir ao agente ligar para estes números a partir da tela e também alterar essas informações| +Agent Screen Extended Alt Dial:|Discagem Extendida na tela do Agente :| +Use Campaign DNC List -<\/B> This defines whether this campaign is to filter leads against a DNC list that is specific to that campaign only. If it is set to Y, the hopper will look for each phone number in the campaign-specific DNC list before placing it in the hopper. If it is in the campaign-specific DNC list then it will change that lead status to DNCC so it cannot be dialed. Default is N.|Usar Lista de Bloqueio - Este recurso define se a campanha deve filtrar registros usando a lista de Bloqueio que é específica para esta campanha. Se configurado como Y, o hopper irá procurar cada número na lista específica de Bloqueio antes de colocar o número na lista do hopper. Se estiver em uma lista específica de Bloqueio, então ele irá alterar o status do registro para DNCC para que este registro não seja discado. O padrão é N| +Use Campaign DNC List|Usar Lista de Bloqueio| +and possibly the campaign-specific DNC list|e possivelmente a lista específica de bloqueio| +There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them|Existe também a opção de incluir registros em listas de bloqueio específicas de campanhas| +NOTE: Copying a campaign will copy all settings from the master campaign you select, but it will not copy a campaign-specific DNC list if there was one on the selected master campaign|ATENÇÃO: Copiar uma campanha irá copiar todas as configurações da campanha que você escolher, mas não irá copiar a lista de bloqueio específica da campanha que você selecionar| +Add New |Incluir| +Copy |Copiar| +New DID Addition|Incluir DDR| +New Copied DID Addition|Inclusão de DDR por cópia| +Modify |Alterar| +Delete |Remover| +Play Place in Line -<\/B> This defines whether the caller will hear their place in line when they enter the queue as well as when they hear the announcemend. Default is N|Tocar Posição na Fila - Isto define se o cliente irá ouvir seu lugar na fila de atendimento quando entram na fila e também periodicamente. O padrão é N| +Play Estimated Hold Time -<\/B> This defines whether the caller will hear the estimated hold time before they are transferred to an agent. Default is N|Tocar Tempo Estimado - Isto define se o cliente irá ouvir o tempo estimado de espera antes de ser transferido para um agente. O padrão é N| +Hold Time Option -<\/B> This allows you to specify the routing of the call if the estimated hold time is over the amount of seconds specified below. Default is NONE|Opção de Tempo de Espera - Permite que você especifique uma rota para a chamada caso o tempo de espera esteja superior a quantidade de segundos configurada abaixo. O padrão é NONE| +Hold Time Option Seconds -<\/B> If Hold Time Option is set to anything but NONE, this is the number of seconds of estimated hold time that will trigger the hold time option. Default is 360 seconds|Tempo de Opção de Espera - Se a opção de tempo de espera estiver configurado para um valor diferente de NONE, este número em segundos de tempo estimado de atendimento irá acionar esta opção de espera. O padrão é 360 segundos| +Hold Time Option Extension -<\/B> If Hold Time Option is set to EXTENSION, this is the dialplan extension that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|Extensão de Opção de Tempo - Se a Opção de Tempo de Espera estiver como EXTENSION, esta extensão do plano de discagem será usada para enviar a chamada quando o tempo de espera superar a configuração de tempo de espera| +Hold Time Option Voicemail -<\/B> If Hold Time Option is set to VOICEMAIL, this is the voicemail box that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|VoiceMail da Opção de Espera - Se a Opção de Espera estiver como VOICEMAIL, esta é a caixa de voicemail que a chamada será direcionada, caso o tempo de espera exceda o tempo configurado na opção de tempo| +Hold Time Option Transfer In-Group -<\/B> If Hold Time Option is set to IN_GROUP, this is the inbound group that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|Gr. de Entr. da Opção de Espera - Se a Opção de Espera for IN_GROUP, este grupo de entrada será usado para transferir a chamada que entrar e o tempo de espera estimado for maior que o tempo da opção.| +Hold Time Option Callback Filename -<\/B> If Hold Time Option is set to CALLERID_CALLBACK, this is the filename prompt that is played before the call is logged as a new lead to the list ID specified below if the estimated hold time exceeds the Hold Time Option Seconds|Arquivo de Agendamento da Espera - Se a configuração de Opção de Tempo de Espera estiver como CALLERID_CALLBACK, esse arquivo será tocado e então a chamada será considerada com status de novo para a lista abaixo se o tempo estimado de espera exceder o tempo configurado| +Hold Time Option Callback List ID -<\/B> If Hold Time Option is set to CALLERID_CALLBACK, this is the List ID the call is added to as a new lead if the estimated hold time exceeds the Hold Time Option Seconds|ID da Lista de Agendamento de Espera - Se a Opção de Tempo de Espera estiver como CALLERID_CALLBACK, esta é a ID da lista na qual a chamada é adicionada como novo registro caso o tempo de chamada exceda o tempo definido na configuração | +Hold Recall Transfer In-Group -<\/B> If a customer calls back to this in-group more than once and this is not set to NONE, then the call will automatically be sent on to the In-Group selected in this field. Default is NONE|Grupo de Rechamada de Espera- Se um cliente liga de volta para este grupo de entrada mais de uma vez e esta config. estiver como NONE, então a chamada é automaticamente desviada para o Grupo de Entrada selecionado neste campo. O padrão é NONE| +No Delay Call Route -<\/B> Setting this to Y will remove all wait times and audio prompts and attempt to send the call right to an agent. Does not override welcome message or on hold prompt settings. Default is N|Rotear Sem Atraso - Configurando como Y irá remover qualquer tempo de espera ou anuncios de audio e irá tentar enviar a chamada direto para o agente. Não sobrepõe mensagem de boas vindas e anuncios da fila de espera. O padrão é N| +Play Welcome Message -<\/B> These settings select when to play the defined welcome message, ALWAYS will play it every time, NEVER will never play it, IF_WAIT_ONLY will only play the welcome message if the call does not immediately go to an agent, and YES_UNLESS_NODELAY will always play the welcome message unless the NO_DELAY setting is enabled. Default is ALWAYS|Tocar Mensagem de Boas Vindas - Esta configuração seleciona quando tocar mensagens de boas vindas, ALWAYS irá tocar toda vez, NEVER nunca irá tocar, IF_WAIT_ONLY irá somente tocar a mensagem se a chamada não for diretamente para o agente, e YES_UNLESS_NODELAY irá sempre tocar a mensagem a não ser que a configuração de Sem Atraso estiver habilitada. O padrão é ALWAYS| +Play Place in Line: |Tocar Lugar na Fila:| +Play Estimated Hold Time: |Tocar Tempo Estimado:| +Hold Time Option: |Opção de Espera:| +Hold Time Option Seconds: |Tempo de Opção de Espera:| +Hold Time Option Extension: |Extensão de Opção de Espera:| +Hold Time Option Voicemail: |Voicemail da Opção de Espera:| +Hold Time Option Transfer In-Group: |Grupo de Entrada da Opção de Espera:| +Hold Time Option Callback Filename: |Arq. de Agend. da Opção de Espera:| +Hold Time Option Callback List ID: |Lista de Agend. da Opção de Espera:| +Hold Recall Transfer In-Group: |Grupo de Transferência de Rechamada:| +No Delay Call Route: |Rotear sem Atrasos:| +Play Welcome Message: |Tocar Mens. de Boas Vindas:| +DID Extension -<\/B> This is the number, extension or DID that will trigger this entry and that you will route within the system using this function|Extensão DDR- Este é o número, extensão ou DDR que irá acionar esta entrada e que você irá rotear no sistema usando este recurso| +DID Description -<\/B> This is the description of the DID routing entry|Descrição do DDR - Esta é a descrição do roteamento ao DDR| +DID Active -<\/B> This the field where you set the DID entry to active or not. Default is Y|DDR Ativo - Este é o campo que você configura se o DDR está ativo ou não. O padrão é Y| +DID Route -<\/B> This the type of route that you set the DID to use. EXTEN will send calls to the extension entered below, VOICEMAIL will send calls directly to the voicemail box entered below, AGENT will send calls to a VICIDIAL agent if they are logged in, PHONE will send the call to a phones entry selected below, IN_GROUP will send calls directly to the specified inbound group. Default is EXTEN|Rota DDR - Este é o tipo de rota que seu DDR irá usar. EXTEN irá enviar as chamadas para a extensão abaixo, VOICEMAIL irá enviar as chamadas para uma caixa de voicemail digitada abaixo, AGENT irá enviar as chamadas para um agente do VICIDIAL se ele estiver logado no sistema, PHONE irá enviar a chamada para um ramal configurado abaixo, IN_GROUP irá enviar as chamadas diretamente para um grupo de entrada especificado abaixo. O padrão é EXTEN| +Extension -<\/B> If EXTEN is selected as the DID Route, then this is the dialplan extension that calls will be sent to. Default is 9998811112, no-service|Extensão - Se EXTEN for selecionado como rota, então este é a extensão do plano de discagem que as chamadas serão enviadas. O padrão é 999811112, sem-serviço| +Extension Context -<\/B> If EXTEN is selected as the DID Route, then this is the dialplan context that calls will be sent to. Default is default|Contexto da Extensão - Se EXTEN estiver selecionado como Rota do DDR, então este é o contexto do plano de discagem para o qual as chamadas serão enviadas. O padrão é default| +Voicemail Box -<\/B> If VOICEMAIL is selected as the DID Route, then this is the voicemail box that calls will be sent to. Default is empty|Caixa de VoiceMail - Se VOICEMAIL estiver selecionado como rota de DDR, então esta é a caixa de voicemail que a chamada deve ser enviada. O padrão é vazio| +Phone Extension -<\/B> If PHONE is selected as the DID Route, then this is the phone extension that calls will be sent to.|Extensão do Ramal - Se PHONE estiver selecionado na rota DDR, então esta é a extensão do ramal que as chamadas serão enviadas.| +Phone Server IP -<\/B> If PHONE is selected as the DID Route, then this is the server IP for the phone extension that calls will be sent to|IP do Servidor do Ramal - Se PHONE estiver selecionado como rota DDR, então este é o IP do servidor do ramal que as chamadas devem ser enviadas| +User Agent -<\/B> If AGENT is selected as the DID Route, then this is the VICIDIAL Agent that calls will be sent to|Usuário do Agente - Se AGENT estiver selecionado como rota DDR, então este é o agente do vicidial que as chamadas devem ser enviadas| +User Unavailable Action -<\/B> If AGENT is selected as the DID Route, and the user is not logged in or available, then this is the route that the calls will take|Ação p/ Usuário não Dispon. - Se AGENT estiver selecionado como rota de DDR, e o usuário não estiver logado ou disponível, então esta é a rota que as chamadas serão direcionadas| +User Route Settings In-Group - If AGENT is selected as the DID Route, then this is the In-Group that will be used for the queue settings as the caller is waiting to be sent to the agent. Default is AGENTDIRECT|Config. de Grupo de Entr. do Agente - Se AGENT estiver selecionado como roda DDR, então este é o grupo de entrada que irá ser usado para configurações de fila na qual o cliente ficará esperando para ser direcionado ao agente. O padrão é AGENTDIRECT| +In-Group ID -<\/B> If IN_GROUP is selected as the DID Route, then this is the In-Group that calls will be sent to|ID do Grupo de Entr. - Se IN_GROUP estiver selecionado como rota de DDR, então este é o grupo de entrada a ser enviadas as chamadas| +In-Group Call Handle Method -<\/B> If IN_GROUP is selected as the DID Route, then this is the call handling method used for these calls. CID will add a new lead record with every call using the CallerID as the phone number, CIDLOOKUP will attempt to lookup the phone number by the CallerID in the entire system, CIDLOOKUPRL will attampt to lookup the phone number by the CallerID in only one specified list, CIDLOOKUPRC will attampt to lookup the phone number by the CallerID in all of the lists that belong to the specified campaign, CLOSER is specified for VICIDIAL Closer calls, ANI will add a new lead record with every call using the ANI as the phone number, ANILOOKUP will attempt to lookup the phone number by the ANI in the entire system, ANILOOKUPRL will attampt to lookup the phone number by the ANI in only one specified list, XDIGITID will prompt the caller for an X digit code before the call will be put into the queue. Default is CID|Método de Manuseio do Grupo de Entrada - Se IN_GROUP estiver selecionado como rota de DDR, então este é o método usado para manusear estas chamadas. CID irá incluir um registro de chamada para cada chamada usando o CallerID como número do telefone, CIDLOOKUP irá tentar localizar o número do telefone pelo CallerID no sistema inteiro, CIDLOOKUPRL irá tentar localizar o número do telefone somente em uma lista específica, CIDLOOKUPRC irá tentar encontrar o número do telefone em todas as listas que pertencem a uma campanha específica, CLOSER é especificado para chamadas de finalização, ANI irá incluir um novo registro para cada chamada usando o ANI como número de telefone, ANILOOKUP irá tentar procurar o telefone pelo ANI no sistema todo, ANILOOKUPRL irá tentar localizar o telefone pelo ANI somente na lista especificada, XDIGITID irá pedir para o cliente uma quantidade de dígitos antes da chamada ser colocada na fila. O padrão é CID| +In-Group Agent Search Method -<\/B> If IN_GROUP is selected as the DID Route, then this is the agent search method to be used by the inbound group, LO is Load-Balanced-Overflow and will try to send the call to an agent on the local server before trying to send it to an agent on another server, LB is Load-Balanced and will try to send the call to the next agent no matter what server they are on, SO is Server-Only and will only try to send the calls to agents on the server that the call came in on. Default is LB|Método de Busca do Grupo de Entrada - Se IN_GROUP estiver selecionado na rota de DDR, então este é o método de pesquisa do agente a ser usado pelo grupo de entrada, LO é Balanceamento de Carga com Transbordo e irá tentar enviar a chamada para um agente no servidor local antes de tentar enviar para outro servidor, LB é balanceamento de carga e tentará enviar a chamada para o próximo agente não importando o servidor que estiver logado, SO é Somente Servidor e tentará enviar a chamada somente para agentes no mesmo servidor da chamada. O padrão é LB| +In-Group List ID -<\/B> If IN_GROUP is selected as the DID Route, then this is the List ID that leads may be searched through and that leads will be inserted into if necessary|ID da Lista do Grupo de Entrada- Se IN_GROUP estiver selecionado como rota de DDR, então este é o ID da lista que os registros devem ser pesquisados e onde o novo registro será incluído se necessário| +In-Group Campaign ID -<\/B> If IN_GROUP is selected as the DID Route, then this is the Campaign ID that leads may be searched for in if the call handle method is CIDLOOKUPRC|ID da Camp. do Grp. de Entrada- Se IN_GROUP estiver selecionado como rota de DDR, então este é o ID da campanha que os registros devem ser procurados quando o método de pesquisa for CIDLOOKUPRC| +In-Group Phone Code -<\/B> If IN_GROUP is selected as the DID Route, then this is the Phone Code used if a new lead is created|Código do Tel. de Entrada - Se IN_GROUP estiver selecionado como rota de DDR, então este é o código de telefone usado para um novo registro| +Phones Email -<\/B> The email address associated with this phone entry. This is used for voicemail settings|Email do Ramal - Endereço de email associado ao ramal. Isto pode ser usado para configurações de VoiceMail| +ADD A NEW DID|INCLUIR DDR| +DID Extension: |Extensão DDR:| +DID Description: |Descrição DDR:| +COPY DID|COPIAR DDR| +Source DID: |DDR Origem:| +DID NOT ADDED|DDR NÃO INCLUÍDO| +there is already a DID in the system with this ID|já existe um DDR com este ID no sistema| +there is already a DID in the system with this extension|já existe um DDR com esta extensão no sistema| +DID NOT MODIFIED|DDR NÃO ALTERADO| +DID MODIFIED|DDR ALTERADO| +MODIFY A DID RECORD: |ALTERAR UM REGISTRO DDR:| +DID Route: |Rota DDR:| +Extension: |Extensão:| +Extension Context: |Contexto da Extensão:| +Voicemail Box: |Caixa do Voicemail:| +Phone Extension: |Extensão do Ramal:| +User Agent: |Agente:| +User Unavailable Action: |Ação p/ Agente não Disponível:| +User Route Settings In-Group: |Config. de Rota de Entrada do Agente:| +In-Group ID: |ID do Grp. de Entrada:| +In-Group Call Handle Method: |Método de Manuseio de Chamada Entrante:| +In-Group Agent Search Method: |Método de Busca de Agente p/ Ch. Entr.:| +In-Group List ID: |ID da Lista de Entrada:| +In-Group Campaign ID: |ID da Campanha de Entrada:| +In-Group Phone Code: |Código do Ramal de Entrada:| +DELETE THIS DID|REMOVER DDR| +Email: |Email:| +DID NOT DELETED|DDR NÃO REMOVIDO| +DID DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DO DDR| +Click here to delete |Clique aqui para remover| +DID DELETION COMPLETED|REMOÇÃO DO DDR FINALIZADA| +Delete DIDs: |Remover DDRs:| +Modify DIDs: |Alterar DDRs:| +To disable the On Hold Prompt, set the interval to 0|Para desabilitar a Mensagem em Espera, configuro o intervalo como 0| +3-Way Call Outbound CallerID -<\/B> This defines what is sent out as the outbound callerID number from 3-way calls placed by the agent, CAMPAIGN uses the custom campaign callerID, CUSTOMER uses the number of the customer that is active on the agents screen and AGENT_PHONE uses the callerID for the phone that the agent is logged into|CallerID de Chamada a 3 - Isso define o que é enviado como número do CallerID em chamadas a 3 realizadas pelo agente. CAMPAIGN usa o CallerID customizado da campanha, CUSTOMER usa o número do cliente que está ativo na tela do agente e AGENT_PHONE usa o callerID do ramal que o agente está logado| +3-Way Call Outbound CallerID:|CallerID de Chamada a 3:| +INBOUND_MAN allows the agent to place manual dial calls from a campaign list while being able to take inbound calls between manual dial calls|INBOUND_MAN permite ao agente fazer chamadas manuais a partir de uma campanha enquanto está disponível para receber chamadas entrantes, entre as chamadas manuais| +FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button|FORCE irá forçar o agente escolher um código de pausa se eles clicar no botão pausa| +3-Way Call Dial Prefix -<\/B> This defines what is used as the dial prefix for 3-way calls, default is empty so the campaign dial prefix is used, passthru so you can hear ringing is 88|Prefixo para Chamadas a 3 - Isso define o que será usado como prefixo de discagem nas chamadas a 3, o padrão é vazio, então o prefixo da campanha é usado, uma alternativa para se ouvir tocar é 88| +3-Way Call Dial Prefix|Prefixo para chamadas a 3| +Force Timeclock Login -<\/B> This option allows you to not let an agent log in to the VICIDIAL agent interface if they have not logged into the timeclock. Default is N. There is an option to exempt admin users, levels 8 and 9|Forçar Login no Ponto - Esta opção permite você não deixar um agente entrar na interface de agente do VICIDIAL se ele não estiver logado no sistema de relógio de ponto. O padrão é N. Existe uma opção para isentar usuários admin, níveis 8 e 9| +Force Timeclock Login|Forçar Login no Ponto| +Stats Percent of Calls Answered Within X seconds - This field allows you to set the number of hold seconds that the realtime stats display will use to calculate the percentage of answered calls that were answered within X number of seconds on hold|Percentual Estatístico de Chamadas Atendidas em X seg - Este campo permite você configurar o número de segundos que a tela de estatísticas em tempo real demorará para calcular o percentual de chamadas atendidas que foram atendidas antes de X segundos em espera| +Stats Percent of Calls Answered Within X seconds|Percentual Estatístico de Chamadas Atendidas em X seg| +Web Form Target-<\/B> This is where you can set the custom web page frame that the web form will be opened in when the user clicks on the WEB FORM button. Default is _blank.|Target do Form. Web- Esta configuração é onde você coloca o frame da página que o formulário web irá ser aberto quando o usuário clica no botão WEB FORM. O padrão é _blank.| +Web Form Target|Target do Form. Web| +To customize the query string after the web form, simply begin the web form with VAR and then the URL that you want to use, replacing the variables with the variable names that you want to use --A--phone_number--B-- just like in the SCRIPTS tab section|Para personalizar a string de pesquisa do formulário web, simplesmente inicie o formulário web com VAR e então a URL que você quer usar, substituindo as variáveis com os nomes de variável que você quer usar --A--phone_number--B-- da mesma forma que na seção SCRIPTS| +Recording Web Link -<\/B> This setting allows you to override the default of the display of the recording link in the admin web pages. Default is SERVER_IP|Link Web de Gravação - Esta configuração permite que você altere o padrão do link apresentado na tela de gravação no site admin. O padrão é SERVER_IP| +Alternate Recording Server IP -<\/B> This setting is where you can put a server IP or other machine name that can be used in place of the server_ip in the links to recordings within the admin web pages. Default is empty|IP do Serv. Altern. de Gravação- Esta configuração é onde você pode colocar um IP do servidor ou outro nome de máquina que pode ser usado para colocar no lugar do server_ip nos links de gravação nas páginas do site admin. O padrão é vazio| +Recording Web Link|Link Web de Gravação| +Enable Vtiger Integration -<\/B> This setting allows you to enable Vtiger integration with VICIDIAL. Currently links to Vtiger admin and search as well as user replication are the only integration features available. Default is 0|Habilitar Integração com Vtiger - Esta configuração permite que seja habilitada a integração entre VICIDIAL e VTIGER. Atualmente o único tipo de integração disponível são links para o site de administração, pesquisa e replicação do cadastro de usuários. O padrão é 0| +Vtiger DB Server IP -<\/B> This is the IP address of the database for your Vtiger installation|IP do Serv. BD Vtiger - É o endereço IP do servidor de banco de dados da instalação do Vtiger| +Vtiger Database Name -<\/B> This is the database name for your Vtiger database|Base de Dados Vtiger - Este é o nome da base de dados para o Vtiger| +Vtiger Database Login -<\/B> This is the user name used to log in to your Vtiger database|Login do BD do Vtiger - É o nome do usuário usado para acessar o BD do Vtiger| +Vtiger Database Password -<\/B> This is the password used to log in to your Vtiger database|Senha do BD Vtiger - É a senha usada para acessar o BD do Vtiger| +Vtiger URL -<\/B> This is the URL or web site address used to get to your Vtiger installation|URL do Vtiger - Esta é a URL ou endereço do site usado para acessar o Vtiger| +Enable Vtiger Integration:|Habilitar Integração com Vtiger:| +Vtiger DB Server IP|IP do Servidor Vtiger| +Vtiger Database Name|Base de Dados do Vtiger| +Vtiger Database Login|Login do BD do Vtiger| +Vtiger Database Password|Senha do BD do Vtiger| +Vtiger URL|URL do Vtiger| +VTIGER HOME|VTIGER HOME| +Active -<\/B> This field defines whether the user is active in the system and can use VICIDIAL resources. Default is Y|Ativo - Este campo define se o usuário está ativo no sistema e pode usar os recursos do VICIDIAL. O padrão é Y| +show only active users|mostrar somente usuários ativos| +show all users|mostrar todos usuários| +Vtiger Search Category -<\/B> If Vtiger integration is enabled in the system settings then this setting will define where the vtiger_search.php page will search for the phone number that was entered. There are 4 options that can be used in this field: LEAD- This option will search through the Vtiger leads only, ACCOUNT- This option will search through the Vtiger accounts and all contacts and sub-contacts for the phone number, VENDOR- This option will only search through the Vtiger vendors, ACCTID- This option works only for accounts and it will take the vicidial vendor_lead_code field and try to search for the Vtiger account ID. If unsuccessful it will try any other methods listed that you have selected. Multiple options can be used for each search, but on large databases this is not recommended. Default is LEAD|Categoria de Pesquisa Vtiger- Se a integração do Vtiger estiver habilitada no sistema então esta configuração irá definir onde a página vtiger_search.php irá pesquisar o número do telefone que foi digitado. Existem 4 opções que podem ser usadas nesse campo: LEAD- Esta opção irá pesquisar apenas nos registros do Vtiger, ACCOUNT- Esta opção irá pesquisar nas contas do Vtiger e todos os contatos e sub-contatos para o número do telefone, VENDOR- Esta opção irá apenas pesquisar nos vendedores do Vtiger, ACCTID- Esta opção funciona somente para contas e irá pegar o campo vendor_lead_code no vicidial e tentará procurar no ID da conta do Vtiger. Se nao tiver sucesso irá tentar outros métodos listados que você selecionou. Múltiplas opções podem ser usadas para pesquisa, mas em bases de dados grandes não é recomendado. O padrão é LEAD| +Vtiger Search Category:|Categoria de Pesquisa Vtiger:| +ACTIVE LISTS CHANGED|LISTAS ATIVAS ALTERADAS| +SUBMIT ACTIVE LIST CHANGES|ENVIAR ALTERAÇÕES EM LISTAS ATIVAS| +LAST CALL DATE|ÚLTIMA CHAMADA| +User Group Bulk Change|Troca de Grupo de Usuário em Lote| +Bulk Group Change|Troca de Grupo em lote| +Vtiger Create Call Record -<\/B> If Vtiger integration is enabled in the system settings then this setting will define whether a new Vtiger activity record is created for the call when the agent goes to the vtiger_search page. Default is Y|Vtiger Cria Registro de Chamada - Se a integração com Vtiger estiver habilitada, esta configuração define se um registro de atividade do Vtiger é gravado quando o agente entra na página de pesquisa do vtiger (vtiger_search). O padrão é Y| +Vtiger Create Call Record:|Criar Registro de Chamada no Vtiger:| +Vtiger Create Lead Record -<\/B> If Vtiger integration is enabled in the system settings and Vtiger Search Category includes LEAD then this setting will define whether a new Vtiger lead record is created when the agent goes to the vtiger_search page and no record is found to have the call phone number. Default is Y|Criar Registro de Tel. no Vtiger- Se a integração com o Vtiger estiver habilitada no sistema e a Categoria de Pesquisa no Vtiger incluir LEAD, esta configuração define se um novo registro da chamada do Vtiger é criado quando o agente entra na página de pesquisa do vtiger e o registro não é encontrado para que se tenha um número de telefone. O padrão é Y| +Vtiger Create Lead Record:|Criar Registro de Tel. no Vtiger:| +Vtiger Screen Login -<\/B> If Vtiger integration is enabled in the system settings then this setting will define whether the user is logged into the Vtiger interface automatically when they login to VICIDIAL. Default is Y|Tela de Login do Vtiger - Se a integração do Vtiger estiver habilitada então esta configuração irá definir se o usuário será logado automaticamente na interface do Vtiger quando entra no VICIDIAL. O padrão é Y| +Vtiger Screen Login:|Tela de Login do Vtiger:| +Alert Enabled -<\/B> This field shows whether the agent has web browser alerts enabled for when calls come into their vicidial.php session. Default is 0 for NO|Alerta Ativo - Este campo mostra se o agente tem alertas pelo browser habilitados para quando chamadas entram na sessão do usuário. O padrão é 0 para Não| +Alert Enabled:|Alerta Ativo:| +QC Features Active -<\/B> This option allows you to enable or disable the QC or Quality Control features. Default is 0 for inactive|Recursos de CQ Ativos - Esta opção permite habilitar ou desabilitar os recursos de CQ ou Controle de Qualidade. O padrão é 0 para Inativo| +Outbound Auto-Dial Active -<\/B> This option allows you to enable or disable outbound auto-dialing within VICIDIAL, setting this field to 0 will remove the LISTS and FILTERS sections and many fields from the Campaign Modification screens. Manual entry dialing will still be allowable from within the agent screen, but no list dialing will be possible. Default is 1 for active|Discagem Automática Ativa- Esta opção permite você habilitar ou desabilitar a discagem automática de saída do VICIDIAL, configurando este campo como 0 irá remover as seções de LISTAS e FILTROS e vários campos das telas de configuração de Campanha. Discagem Manual ainda será permitida pela tela do agente, mas a discagem por listas não será possível. O padrão é 1 para ativo| +QC Features Active:|Recursos de CQ Ativos:| +Outbound Auto-Dial Active:|Discagem Automática Ativa:| +Close Panel|Fechar Painel| +Choose Report Display Options|Escolher Opções do Relat.| +To select more than 1 campaign, hold down the Ctrl key and click|Para selecionar mais de 1 campanha, aperte Ctrl e clique| +CPD AMD Action -<\/B> If you are using the Sangoma ParaXip Call Progress Detection software then you will want to enable this setting either setting it to DISPO which will disposition the call as AA and hang it up if the call is being processed and has not been sent to an agent yet or MESSAGE which will send the call to the defined Answering Machine Message for this campaign. Default is DISABLED|Ação CPD AMD - Se você estiver usando o software de Detecção Sangoma ParaXip Call Progress então você deve habilitar esta configuração para DISPO que irá finalizar a chamada como AA e desligar se a chamada estiver sendo processada e ainda não foi enviada para um agente ou MESSAGE que irá enviar a chamada para o campo definido como Mensagem de Secretária Eletrônica para esta Campanha. O padrão é DISABLED| +CPD AMD Action:|Ação CPD AMD:| +Click here for user multiple day status detail report|Clique aqui para um relatório de status de vários dias| +Click here to download this list|Clique aqui para fazer download desta lista| +Download Lists:|Download de Listas:| +Active Asterisk Server -<\/B> If Asterisk is not running on this server, or if VICIDIAL should not be using this server, or if are only using this server for other scripts like the hopper loading script you would want to set this to N. Default is Y|Servidor Asterisk Ativo - Se o Asterisk não estiver rodando neste servidor, ou se o VICIDIAL não deveria estar usando este servidor, ou se estiver usando este servidor para outros scripts como o de carregamento de hopper, você deve configurar para N. O padrão é Y| +Generate conf files -<\/B> If you would like the system to auto-generate asterisk conf files based upon the phones entries, carrier entries and load balancing setup within VICIDIAL then set this to Y. Default is Y|Gerar Arquivos Conf - Se você deseja que o sistema gere automaticamente os arquivos conf do asterisk baseados nas configurações de ramal, operadoras, e balanceamento de carga no VICIDIAL então configure como Y. O padrão é Y| +Rebuild conf files -<\/B> If you want to force a rebuilding of the Asterisk conf files or if any of the phones or carrier entries have changed then this should be set to Y. After the conf files have been generated and Asterisk has been reloaded then this will be changed to N. Default is Y|Reconstruir Arquivos Conf - Se você quer forçar a reconstrução dos arquivos conf do Asterisk ou se qualquer um dos ramais ou operadoras foi alterado então isso deve ser Y. Após os aquivos conf terem sido criados e o Asterisk ter sido recarregado, então isso será alterado para N. O padrão é Y| +Active Asterisk Server:|Servidor Asterisk Ativo:| +Generate conf files:|Gerar Arquivos Conf:| +Rebuild conf files:|Reconstruir Arquivos Conf:| +Show Templates|Mostrar Templates| +Add A New Template|Incluir Template| +ADD NEW CONF TEMPLATE|INCLUIR TEMPLATE CONF| +ADD NEW CARRIER|Incluir Operadora| +ADDING NEW CONF TEMPLATE|INCLUINDO TEMPLATE CONF| +ADDING NEW CARRIER|INCLUIR OPERADORA| +MODIFY CONF TEMPLATE|ALTERAR TEMPLATE CONF| +MODIFY CARRIER|ALTERAR OPERADORA| +DELETE CONF TEMPLATE|REMOVER TEMPLATE CONF| +DELETE CARRIER|REMOVER OPERADORA| +CONF TEMPLATE LIST|LISTA DE TEMPLATES CONF| +CARRIER LIST|LISTA DE OPERADORAS| +Template ID:|ID do Template:| +Template Name:|Nome do Template:| +Template Contents:|Conteúdo do Template:| +Carrier ID:|ID da Operadora:| +Carrier Name:|Nome da Operadora:| +Registration String:|String de Registro:| +Account Entry:|Dados da Conta:| +Protocol:|Protocolo:| +Globals String:|String Global:| +Dialplan Entry:|Plano de Discagem:| +CONF TEMPLATE NOT ADDED|TEMPLATE DE CONF NÃO INCLUÍDA| +there is already a template in the system with this ID|já existe um template no sistema com esse ID| +CONF TEMPLATE ADDED|TEMPLATE DE CONF INCLUÍDO| +CARRIER NOT ADDED|OPERADORA NÃO INCLUÍDA| +there is already a carrier in the system with this ID|já existe uma operadora no sistema com este ID| +CONF TEMPLATE NOT MODIFIED|TEMPLATE DE CONF NÃO ALTERADO| +CARRIER NOT MODIFIED|OPERADORA NÃO ALTERADA| +CARRIER MODIFIED|OPERADORA ALTERADA| +CONF TEMPLATE NOT DELETED|TEMPLATE DE CONF NÃO REMOVIDO| +Template ID be at least 2 characters in length|ID do template deve ter pelo menos 2 caracteres| +CONF TEMPLATE DELETION CONFIRMATION|CONFIRMAR REMOÇÃO DO TEMPLATE DE CONF| +Click here to delete conf template|Clique aqui para remover esta template de conf| +CARRIER NOT DELETED|OPERADORA NÃO REMOVIDA| +Carrier ID be at least 2 characters in length|O ID da operadora precisa ter pelo menos 2 caracteres| +CARRIER DELETION CONFIRMATION|CONFIRMAR REMOÇÃO DA OPERADORA| +Click here to delete carrier|Clique aqui para remover a operadora| +CONF TEMPLATE DELETION COMPLETED|REMOÇÃO DO TEMPLATE DE CONF FINALIZADA| +CARRIER DELETION COMPLETED|REMOÇÃO DA OPERADORA FINALIZADA| +MODIFY A CONF TEMPLATE RECORD|ALTERAR UM REGISTRO DE TEMPLATE DE CONF| +DELETE THIS CONF TEMPLATE|REMOVER TEMPLATE DE CONF| +MODIFY A CARRIER RECORD|ALTERAR OPERADORA| +DELETE THIS CARRIER|REMOVER OPERADORA| +CARRIERS WITHIN THIS SERVER|OPERADORAS NESTE SERVIDOR| +CONF TEMPLATE LISTINGS|LISTA DAS TEMPLATES DE CONF| +CARRIER LISTINGS|LISTAS DAS OPERADORAS| +PHONES USING THIS CONF TEMPLATE|RAMAIS USANDO ESTA TEMPLATE DE CONF| +CARRIERS USING THIS CONF TEMPLATE|OPERADORAS USANDO ESTA TEMPLATE DE CONF| +Conf Override:|Sobrepor Conf:| +Template ID -<\/B> This field needs to be at least 2 characters in length and no more than 15 characters in length, no spaces. This is the ID that will be used to identify the conf template throughout the system|ID da Template - Este campo precisa ter pelo menos 2 caracteres de comprimento e não mais que 15 caracteres, sem espaços. Este é o ID que irá ser usado para identificar o template de conf no sistema| +Template Name -<\/B> This is the descriptive name of the conf file template entry|Nome da Template - Este é o nome descritivo da configuração da template| +Template Contents -<\/B> This field is where you can enter in the specific settings to be used by all phones and-or carriers that are set to use this conf template. Fields that should NOT be included in this box are: secret, accountcode, account, username and mailbox|Conteúdo da Template - Este campo é onde você pode configurar itens específicos para serem usados por todos os ramais e/ou todas as operadoras que estão configuradas para usar este template. Campos que NÃO devem ser incluídos nesse ítem são: secret, accountcode, account, username e mailbox| +Carrier ID -<\/B> This field needs to be at least 2 characters in length and no more than 15 characters in length, no spaces. This is the ID that will be used to identify the carrier for this specific entry throughout the system|ID da Operadora - Este campo precisa ter entre 2 e 15 caracteres de comprimento, sem espaços. Este é o ID que irá ser usado para identificar a operadora no sistema| +Carrier Name -<\/B> This is the descriptive name of the carrier entry|Nome da Operadora - Este é o nome descritivo da operadora no sistema| +Registration String -<\/B> This field is where you can enter in the exact string needed in the IAX or SIP configuration file to register to the provider. Optional but highly recommended if your carrier allows registration|String de Registro - Este campo é onde você coloca a string necessária na configuração do IAX ou SIP para registrar a operadora. Opcional mas altamente recomendado se sua operadora permite registro | +Template ID -<\/B> This optional field allows you to choose a conf file template for this carrier entry|ID do Template - Este campo opcional permite você escolha um template para esta configuração de operadora| +Account Entry -<\/B> This field is used if you have not selected a template to use, and it is where you can enter in the specific account settings to be used for this carrier|Dados da Conta - Este campo é usado se você não selecionou um template para ser usado, e é onde você pode entrar com configurações específicas para serem usadas para esta operadora| +Protocol -<\/B> This field allows you to define the protocol to use for the carrier entry. Currently only IAX and SIP are supported|Protocolo - Este campo permite que você defina o protocolo a ser usado para esta configuração de operadora. Atualmente somente IAX e SIP são suportados| +Globals String -<\/B> This optional field allows you to define a global variable to use for the carrier in the dialplan|String Global- Este campo opcional permite definir uma variável global para uso desta operadora no plano de discagem| +Dialplan Entry -<\/B> This optional field allows you to define a set of dialplan entries to use for this carrier|Plano de Discagem- Este campo opcional permite definir um conjunto de entradas no plano de discagem para serem usados com esta operadora| +Server IP -<\/B> This is the server that this specific carrier record is associated with|IP do Servidor - Este é o servidor que este registro de operadora está configurado| +Active -<\/B> This defines whether the carrier will be included in the auto-generated conf files or not|Ativo - Isto define se a operadora irá ser incluída nos arquivos conf gerados automáticamente ou não| +Conf Override Settings -<\/B> If populated, and the Template ID is set to --NONE-- then the contents of this field are used as the conf file entries for this phone. generate_vicidial_conf for this phones server must be set to Y for this to work. This field should NOT contain the [extension] line, that will be automatically generated|Config. Sobreposição de conf - Se preenchido, e o ID do Template estiver --NONE-- então o conteúdo deste campo será usado nas entradas do arquivo conf para este ramal. generate_vicidial_conf para o servidor deste ramal deve estar configurado como Y para funcionar. Este campo nao deve conter a linha [extension], que será automaticamente gerada| +Template ID -<\/B> This is the conf file template ID that this phone entry will use for its Asterisk settings. Default is --NONE--|ID do Template - Este é o ID do Template de arquivo conf que este ramal irá usar para as configurações do Asterisk. O padrão é --NONE--| +If you will be taking in inbound calls from this carrier trunk you might want to set the context=trunkinbound within this field so that you can use the DID handling process within VICIDIAL|Se você receberá chamadas entrantes desta operadora, você deve configurar o context=trunkinbound neste campo para que possa ser usado o processo de controle de DDR do VICIDIAL| +There is a reserved default DID that you can use which is just the word -default- without the dashes, that will allos you to send any call that does not match any other existing patterns to the default DID|Existe um DDR padrão reservado que você pode usar que é a palavra -default- sem os traços, que irá permitir que você envie uma chamada que não pertenca a nenhum padrão existente para o DDR padrão| +Campaign VDAD extension|Extensão VDAD da Campanha| +This field allows for a custom VDAD transfer extension. This allows you to use different call handling methods depending upon your campaign.|Este campo permite personalizar a extensão de transferência do VDAD. Isso permite que você use métodos de controle da chamada dependendo da sua campanha| + - 8364 - same as 8368|- 8364 - mesma que 8368 | + - 8365 - Will send the call only to an agent on the same server as the call is on|- 8365 - Irá enviar a chamada somente para o servidor no qual o agente está logado| + - 8366 - Used for press-1 and survey campaigns|- 8366 - Utilizado somente para campanhas de pressione-1 e pesquisa| + - 8367 - Will try to first send the call to an agent on the local server, then it will look on other servers|- 8367 - Irá tentar enviar a chamada para um agente no servidor local, então irá procurar em outros servidores| + - 8368 - DEFAULT – Will send the call to the next available agent no matter what server they are on|- 8368 - PADRÃO Irá enviar a chamada para o próximo agente disponível não importando o servidor em que está| + - 8369 - Used for Answering Machine Detection after that, same behavior as 8368|- 8369 - Usado para detecção de secretária eletrônica, após a detecção segue o mesmo caminho da 8368| + - 8373 - Used for Answering Machine Detection after that same behavior as 8366|- 8373 - Usado para detecção de secretária eletrônica, após a detecção segue o mesmo caminho da 8366| +Also in this section are the WEB VARs for each campaign. These allow each agent to have a different variable string that can be added to the WEB FORM or SCRIPT tab URLs by simply putting --A--web_vars--B-- as you would put any other field.|Também nesta seção estão as variáveis WEB para caba campanha. Elas permitem cada agente ter variáveis diferentes que podem ser adicionadas a URL do WEB FORM ou do SCRIPT, simplestemnte colocando --A--web_vars--B-- da mesma forma que faria com qualquer outro campo| +Group Alias List|Lista de Alias de Grupo| +Add A New Group Alias|Incluir Alias de Grupo| +ADD NEW GROUP ALIAS|INCLUIR ALIAS DE GRUPO| +ADDING NEW GROUP ALIAS|INCLUINDO ALIAS DE GRUPO| +MODIFY GROUP ALIAS|ALTERAR ALIAS DE GRUPO| +DELETE GROUP ALIAS|REMOVER ALIAS DE GRUPO| +GROUP ALIAS LIST|LISTA DE ALIAS DE GRUPOS| +GROUP ALIAS LISTINGS|LISTAS DE ALIAS DE GRUPO| +MODIFY A GROUP ALIAS RECORD|ALTERAR ALIAS DE GRUPO| +Group Alias ID|ID do Alias| +Group Alias Name|Nome do Alias| +CallerID Number|Número CallerID| +CallerID Name|Nome CallerID| +DELETE THIS GROUP ALIAS|REMOVER ESTE ALIAS DE GRUPO| +GROUP ALIAS NOT MODIFIED|ALIAS DE GRUPO NÃO ALTERADO| +GROUP ALIAS MODIFIED|ALIAS DE GRUPO ALTERADO| +ADD A NEW GROUP ALIAS|INCLUIR NOVO ALIAS DE GRUPO| +MODIFY A GROUP ALIAS RECORD|ALTERAR ALIAS DE GRUPO| +GROUP ALIAS NOT ADDED|ALIAS DE GRUPO NÃO INCLUÍDO| +GROUP ALIAS ADDED|ALIAS DE GRUPO INCLUÍDO| +GROUP ALIAS NOT DELETED|ALIAS DE GRUPO NÃO REMOVIDO| +GROUP ALIAS DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE ALIAS DE GRUPO| +Click here to delete group alias|Clique aqui para remover alias de grupo| +GROUP ALIAS DELETION COMPLETED|REMOÇÃO DO ALIAS DE GRUPO FINALIZADA| +Group Alias ID -<\/B> The ID of the group alias used by agents to dial out calls from the VICIDIAL agent interface with different Caller IDs. no spaces or other special characters allowed. Must be between 2 and 20 characters in length|ID do Alias de Grupo - É o ID do alias de grupo usado por agentes do sistema para realizar chamadas pela interface do VICIDIAL com CallerIDs diferentes. Não é permitido uso de caracteres especiais ou espaços. Deve ter entre 2 e 20 caracteres| +Group Alias Name -<\/B> The name used to describe a group alias, Must be between 2 and 50 characters in length|Nome do Alias de Grupo - O nome usado para descrever um alias de grupo, Deve ter entre 2 e 20 caracteres de comprimento| +Caller ID Number -<\/B> The Caller ID number used in this Group Alias. Must be digits only|Número do CallerID - O Número do Caller ID usado para este alias de grupo. Deve ter apenas dígitos| +Caller ID Name -<\/B> The Caller ID name that can be sent out with this Group Alias. As far as we know this will only work in Canada on PRI circuits and using an IAX loop trunk through Asterisk|Nome do CallerID - O Nome do Caller ID que é enviado com esse Alias de Grupo. Até onde sabemos isso só funciona nos circuitos PRI do Canadá e usando trunk IAX com Asterisk| +Group Alias Allowed -<\/B> If you want to allow your agents to use group aliases then you need to set this to Y. Group Aliases are explained more in the Admin section, they allow agents to select different callerIDs for outbound manual calls that they may place. Default is N|Alias de Grupo Permitidas - Se você quer permitir seus agentes a usarem alias de grupo então você deve configurar como Y. Alias de grupo são explicados melhor na seção Admin, eles permitem que os agentes usem CallerIDs diferentes para chamadas manuais que realizam. O padrão é N| +Default Group Alias -<\/B> If you have allowed Group Aliases then this is the group alias that is selected first by default when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty|Alias de Grupo Padrão - Se você permitiu Alias de Grupo então este é o alias de grupo que será selecionado como padrão quando o agente escolhe usar um alias de grupo em uma chamada manual. O padrão é NONE ou vazio| +Default Group Alias -<\/B> If you have allowed Group Aliases for the campaign that the agent is logged into then this is the group alias that is selected first by default on a call coming in from this inbound group when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty|Alias de Grupo Padrão - Se você permitium Alias de Grupo para a campanha que o agente está logado, então este é o alias de grupo que é selecionado como padrão em uma chamada vindo deste grupo de entrada quando o agente escolhe um alias de grupo para uma chamada manual. O padrão é NONE ou vazio| +Group Alias Allowed|Alias de Grupo Permitido| +Default Group Alias|Alias de Grupo Padrão| +AGENT_CHOOSE allows the agent to choose which callerID to use for 3-way calls from a list of choices.|AGENT_CHOOSE permite que o agente escolha qual CallerID usar em chamadas a 3 a partir de uma lista de opções| +you cannot use reserved words in group aliases|não pode ser usado palavras reservadas neste alias de grupo| +Agent Shift Enforcement Override|Sobrepor Controle de Turno do Agente| +Manager Shift Enforcement Override|Sobrepor Controle de Turno do Gerente| +Shift Enforcement|Controle de Turno| +Max Calls per Second|Máx. de Chamadas por Segundo| +Max FILL Calls per Second|Máx. de Cham. Trasnf. por Segundo| +This setting will override whatever the users user group has set for Shift Enforcement. DISABLED will use the user group setting. OFF will not enforce shifts at all. START will only enforce the login time but will not affect an agent that is running over their shift time if they are already logged in. ALL will enforce shift start time and will log an agent out after they run over the end of their shift time. Default is DISABLED.|Esta configuração irá sobrepor qualquer configuração feita no grupo do agente para controle de turno. DISABLED irá usár a configuração do grupo. OFF não irá forçar turnos. START irá somente forçar o horário de login do turno mas não terá efeito sobre horário acima do final do turno se o usuário ainda estiver logado. ALL irá forçar o inicio do turno e irá fazer logout do agente caso passe do final do horário do turno. O padrão é DISABLED.| +This setting if set to 1 will allow a manager to enter their user and password on an agent screen to override the shift restrictions on an agent session if the agent is trying to log in outside of their shift. Default is 0.|Esta configuração quando 1 irá permitir ao gerente entrar com suas credenciais na tela do agente para sobrepor o controle do turno caso o agente esteja tentando logar fora do horário determinado para seu turno. O padrão é 0.| +This setting allows you to restrict agent logins based upon the shifts that are selected below. OFF will not enforce shifts at all. START will only enforce the login time but will not affect an agent that is running over their shift time if they are already logged in. ALL will enforce shift start time and will log an agent out after they run over the end of their shift time. Default is OFF.|Esta configuração permite você restringir logins do agente baseado nos turnos selecionados abaixo. OFF não irá forçar controle de turno. START irá forçar o horário de login mas não terá efeito sobre um agente que está fazendo horário além do limite final e não saiu do sistema. ALL irá forçar o horário de início e fim, retirando o agente do sistema quando o horário do turno estiver terminado. O padrão é OFF| +This setting determines the maximum number of calls that can be placed by the outbound auto-dialing script on this server per second. Must be from 1 to 100. Default is 20.|Esta configuração determina o número máximo de chamadas que podem ser feitas pelo script de discagem automática neste servidor por segundo. Deve ser de 1 a 100. O padrão é 20| +This setting determines the maximum number of calls that can be placed by the auto-FILL outbound auto-dialing script on for all servers, per second. Must be from 1 to 200. Default is 40.|Esta configuração determina o número máximo de chamadas que podem ser feitas pelo discador automático de saída para todos os servidores, por segundo. Deve ter entre 1 e 200 caracteres. O padrão é 40.| +System Load|Carga do Sistema| +Live Channels|Canais Falando| +Disk Usage|Uso do HD| +These two statistics show the loadavg of a system times 100 and the CPU usage percentage of the server and is updated every minute. The loadavg should on average be below 100 multiplied by the number of CPU cores your system has, for optimal performance. The CPU usage percentage should stay below 50 for optimal performance.|Estas duas estatísticas mostram a média de carga de um sistema vezes 100 e o percentual de uso de CPU do servidor, atualizados a cada minuto. A média de carga deve ser em média menor que 100 multiplicado pelo número de núcleos de CPU que seu sistema tem, para melhor performance. O percentual de uso do CPU deve ficar abaixo de 50 para melhor performance.| +This field shows the current number of Asterisk channels that are live on the system right now. It is important to note that the number of Asterisk channels is usually much higher than the number of actual calls on a system. This field is updated once every minute.|Este campo mostra o número atual de canais ativos no Asterisk que estão falando neste momento. É importante perceber que o número de canais do Asterisk é normalmente muito mais alto do que as chamadas atuais do sistema. Este campo é atualizado a cada minuto.| +This field will show the disk usage for every partition on this server. This field is updated once every minute.|Este campo irá mostrar o uso de disco para cada partição neste servidor. Este campo é atualizado a cada minuto.| +ADMIN CHANGE LOG|LOG DE ALT. ADMIN| +USER ADMIN CHANGE LOG|LOG DE ALT. DO USUÁRIO ADMIN| +SECTION ADMIN CHANGE LOG|LOG DE ALT. DA SEÇÃO ADMIN| +DETAIL ADMIN CHANGE LOG|LOG DE ALT. DE DETALHES ADMIN| +Last 10000 records|Últimos 10000 registros| +Changes made by|Alterado por| +Record Detail|Detalhes do Reg.| +Section Records|Registros de Seção| +Click here to see Admin chages to this record|Clique aqui para ver alterações Admin para este registro| +Click here to see Admin chages to this campaign|Clique aqui para ver alterações Admin para esta campanha| +Click here to see Admin chages to this list|Clique aqui para ver alterações Admin para esta lista| +Click here to see Admin chages to this In-Group|Clique aqui para ver alterações Admin para este grupo de entrada| +Click here to see Admin chages to this DID|Clique aqui para ver alterações Admin para este DDR| +Click here to see Admin chages to this remote agent|Clique aqui para ver alterações Admin para este Agente Remoto| +Click here to see Admin chages to this user group|Clique aqui para ver as alterações Admin para este Grupo de usuários| +Click here to see Admin chages to this script|Clique aqui para ver as alterações Admin para este script| +Click here to see Admin chages to this filter|Clique aqui para ver as alterações Admin para este Filtro| +Click here to see Admin chages to this call time|Clique aqui para ver as alterações Admin para este Horário de Chamada| +Click here to see Admin chages to this shift|Clique aqui para ver as alterações Admin para este Turno| +Click here to see Admin chages to this phone alias|Clique aqui para ver as alterações Admin para este Alias de Ramal| +Click here to see Admin chages to this group alias|Clique aqui para ver as alterações Admin para este Alias de Grupo| +Click here to see Admin chages to this server|Clique aqui para ver as alterações Admin para este Servidor| +Click here to see Admin chages to this conf template|Clique aqui para ver as alterações Admin para este template de conf| +Click here to see Admin chages to this carrier|Clique aqui para ver as alterações Admin para esta Operadora| +Click here to see Admin chages to the system settings|Clique aqui para ver as alterações Admin para esta Configuração de sistema| +Export Reports|Exportar Relatórios| +This setting if set to 1 will allow a manager to access the export call reports on the REPORTS screen. Default is 0.|Esta configuração quando configurada como 1 irá permitir ao gerente acessar o ítem de exportação de relatórios na tela de relatórios. O padrão é 0| +This setting if set to 1 will allow a manager to click on the download list link at the bottom of a list modification screen to export the entire contents of a list to a flat data file. Default is 0.|Esta configuração quando 1 permite aoa gerente clicar no download da lista na parte inferior da tela de alteração de listas para exportar o conteúdo da lista para um arquivo em formato de texto. O padrão é 0.| +Export Calls Report|Exportar Relatórios de Chamadas| +EXPORT CALLS REPORT|EXPORTAR RELAT. DE CHAMADAS| +For the Export Calls Report, the following field order is used for exports| +Para a exportação do Relatório de Chamadas, a seguinte ordem de campos é usada na exportação| +Timeclock|Relógio Ponto| +Logout|Sair| +Show Users|Mostrar Usuários| +Add A New User|Incluir Usuário| +Search For A User|Pesquisar Usuário| +User Stats|Estatísticas de Usuário| +User Status|Status do Usuário| +Time Sheet|Planilha de Tempo| +Days Status|Status Diário| +Campaigns Main|Campanhas| +Statuses|Status| +HotKeys|Atalhos| +Lead Recycle|Reciclar Registro| +Auto Alt-Dial|Discar Num. Alt.| +Auto Alt Dial|Discar Num. Alt.| +List Mix|Mesclagem de Lista| +Pause Codes|Códigos de Pausa| +Basic|Básico| +Detail|Detalhes| +Survey|Pesquisa| +Real-Time|Tempo Real| +CAMPAIGN ID|ID| +DIAL PLAN|PLANO DE DISC.| +DIAL METHOD|MÉTODO DE DISC.| +LEADS COUNT|TOTAL DE REG.| +LEAD ORDER|ORDEM DOS REG.| +DIAL STATUSES|STATUS DE DISC.| +SCRIPT ID|ID DO SCRIPT| +SCRIPT NAME|NOME DO SCRIPT| +USER GROUP|GRUPO DE USUÁRIOS| +GROUP NAME|NOME DO GRUPO| +PRIORITY|PRIORIDADE| +FORCE TIMECLOCK|FORÇAR PONTO| +CALLTIME ID|ID DO HORÁRIO| +CALLTIME NAME|NOME DO HORÁRIO| +DEFAULT START|INÍCIO PADRÃO| +DEFAULT STOP|FIM PADRÃO| +SHIFT ID|ID DO TURNO| +SHIFT NAME|NOME DO TURNO| +SHIFT START|INÍCIO DO TURNO| +SHIFT LENGTH|FIM DO TURNO| +WEEKDAYS|SEMANAL| +Template ID|ID do Template| +Template Name|Nome do Template| +Carrier ID|ID da Operadora| +Carrier Name|Nome da Operadora| +Registration|Registro| +Active|Ativo| +USER ID|ID DO USUÁRIO| +FULL NAME|NOME COMPLETO| +LEVEL|NÍVEL| +LINKS|LINKS| +TRUNKS|TRUNKS| +HUMAN|HUMANO| +ANSWER|RESPOSTA| +CATEGORY|CATEGORIA| +STATUSES IN THIS CATEGORY|STATUS NESTA CATEGORIA| +Display|Mostrar| +Dates|Datas| +PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK|POR FAVOR SELECIONE UMA CAMPANHA OU GRUPO DE USUÁRIO E PERÍODO ACIMA E CLIQUE| +PLEASE SELECT A USER AND DATE-TIME ABOVE AND CLICK|POR FAVOR SELECIONE UM USUÁRIO E PERÍODO ACIMA E CLIQUE| +PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK|POR FAVOR SELECIONE UMA CAMPANHA E PERÍODO ACIMA E CLIQUE| +PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT|POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR| +DOWNLOAD|DOWNLOAD| +Users|Usuários| +User|Usuário| +Reports|Relatórios| +OUTBOUND|SAINTE| +INBOUND|ENTRANTE| +Server Stats and Reports|Estatísticas do Servidor e Relatórios| +Click here to see a VDAD report for this campaign|Clique aqui para ver um relatório VDAD para esta campanha| +Show DIDs|Mostrar DDRs| +Add A New DID|Incluir DDR| +Templates|Templates| +Carriers|Operadoras| +Carrier Name|Nome da Operadora| +Click here to see all CallBack Holds in this user group|Clique aqui para ver todos os registros de CallBack para este grupo de usuários| +Click here to see all CallBack Holds in this list|Clique aqui para ver todos os registros de Callback para esta lista| +Click here to see a report for this inbound group|Clique aqui para ver um relatório deste grupo de entrada| +Click here to Synchronize users with Vtiger|Clique aqui para sincronizar usuários com o Vtiger| +Alert Enabled|Alerta Habilitado| +Change Date|Data da Alter.| +Login Date|Data do Login| +List Last Call Date|Data da última chamada da lista| +Phone Code Override|Sobrepor Código do Telefone| +GROUP ALIAS ID|ID DO ALIAS DE GRUPO| +GROUP ALIAS NAME|NOME DO ALIAS DE GRUPO| +CID NUMBER|NÚMERO CID| +CID NAME|NOME CID| +PHONE ALIAS|ALIAS DE RAMAL| +ALIAS ID|ID DO ALIAS| +ALIAS NAME|NOME DO ALIAS| +PHONE LOGINS LIST|LISTA DE LOGINS DE RAMAL| +Shift Length|Duração do Turno| +short description of the shift|descrição curta do turno| +DELETE THIS SERVER|REMOVER ESTE SERVIDOR| +DELETE THIS CONFERENCE|REMOVER ESTA CONFERÊNCIA| +DELETE THIS VICIDIAL CONFERENCE|REMOVER ESTA CONFERÊNCIA VICIDIAL| +Install Date|Data da Instalação| +Human Answer|Resposta Humana| +STATUS CATEGORIES|CATEGORIA DE STATUS| +per campaign|por campanha| +all campaigns|todas campanhas| +CAMPAIGN|CAMPANHA| +STATUSES|STATUS| +### START translations for 2.2.0 release ### +Delete From DNC Lists|Remover da Lista de Bloqueio| +This setting if set to 1 will allow a manager to remove phone numbers from the DNC lists in the VICIDIAL system|Esta configuração quando 1 permite que o gerente remova números de telefone da lista de bloqueio no sistema VICIDIAL | +DNC NOT DELETED|BLOQUEIO NÃO REMOVIDO| +This phone number is not in the Do Not Call List|Este número de telefone não está na lista de bloqueio| +DNC DELETED|BLOQUEIO REMOVIDO| +ADD OR DELETE NUMBERS FROM THE DNC LIST|INCLUIR OU REMOVER TELEFONES DA LISTA DE BLOQUEIO| +Add or Delete|Incluir ou Remover| +Add-Delete Number From DNC|Incluir-Remover Número do Bloqueio| +Vtiger Search Dead Accounts|Pesquisar contas Mortas no Vtiger| +If Vtiger integration is enabled in the system settings then this setting will define whether deleted accounts will be searched when the agent clicks WEB FORM to search in the Vtiger system. DISABLED- deleted leads will not be searched, ASK- deleted leads will be searched and the vtiger search web page will ask the agent if they want to make the Vtiger account active, RESURRECT- will automatically make the deleted account active again and will take the agent to the account screen without delay upon clicking on WEB FORM. Default is DISABLED|Se a integração com o Vtiger estiver habilitada nas confifurações do sistema então esta configuração define se contas apagadas serão pesquisadas quando o agente clica em WEB FORM para procurar no sistema Vtiger. DISABLED- registros apagados não serão pesquisados, ASK- registros apagados serão pesquisados e a página de pesquisa do vtiger irá perguntar ao agente se ele quer ativar a conta no Vtiger, RESURRECT- irá automaticamente ativar a conta e levar o agente para a tela da conta sem atrasos após clicar em WEB FORM. O padrão é DISABLED| +The DISPO option will create a call record for the Vtiger account without the agent needing to go to the vtiger search page through the WEB FORM|A opção DISPO irá criar um registro de chamada para a conta Vtiger sem que o agente precise ir para a página da conta no Vtiger através do botão WEB FORM| +The NEW_WINDOW option will open a new window upon login to the VICIDIAL agent screen|A opção NEW_WINDOW irá abrir uma nova janela ao efetuar login na tela do agente do VICIDIAL| +Vtiger Status Call|Status da Chamada no Vtiger| +If Vtiger integration is enabled in the system settings then this setting will define whether the status of the Vtiger Account will be updated with the status of the VICIDIAL call after it has been dispositioned. Default is N|Se a integração com o Vtiger estiver habilitada nas configurações do sistema então esta configuração irá definir se o status da conta no Vtiger irá ser atualizada com o status da chamada no VICIDIAL depois que ela foi finalizada. O padrão é N| +There are also 5 additional settings that will define the kind of status: sale, dnc, customer contact, not interested, unworkable|Existem também 5 configurações adicionais que irão definir o tipo do status: sale, dnc, customer contact, not interested, unworkable| +If the customer is on hold and hears this estimated hold time message, the minimum time that will be played is 15 seconds|Se o cliente está em espera e ouve o tempo estimado de atendimento, o tempo mínimo que será tocado é de 15 segundos| +Email, User Code and Territory|Email, Código do Usuário e Território| +These are optional fields|Estes são campos opcionais| +All options except for the Not Interested, Third and Fourth digit options will move on to the Survey Method call path|Todas as opções, com exceção de Not Interested, Terceiro e Quarto dígito, irão mover a chamada para o método de Pesquisa(Survey)| +Survey Third Digit|Terceiro Dígito| +This allows for a third call path if the Third digit as defined in this field is pressed by the customer|Isto permite que exista um terceiro caminho se o terceiro dígito conforme definido por este campo for pressionado pelo cliente| +Survey Fourth Digit|Quarto Dígito| +This allows for a fourth call path if the Fourth digit as defined in this field is pressed by the customer|Isto permite que exista um quarto caminho se o quarto digito conforme digitado neste campo for digitado pelo cliente| +Survey Third Audio File|Terceiro Arquivo de Audio| +Survey Fourth Audio File|Quarto Arquivo de Audio| +This is the third audio file to be played upon the selection by the customer of the Third Digit option|Este é o terceiro arquivo de audio a ser tocado assim que seja selecionado pelo cliente a terceira opção| +Survey Third Status|Terceiro Status| +Survey Fourth Status|Quarto Status| +This is the third status used for the call upon the selection by the customer of the Third Digit option|Este é o terceiro status usado para a chamada assim que o cliente escolhe a terceira opção| +Survey Third Extension|Terceira Extensão| +Survey Fourth Extension|Quarta Extensão| +This is the third extension used for the call upon the selection by the customer of the Third Digit option. Default is 8300 which immediately hangs up the call after the Audio File message is played|Esta é a terceira extensão usada pela chamada assim que é selecionada pelo cliente a terceira opção. O padrão é 8300 que imediatamente desliga a chamada após a mensagem de audio é reproduzida| +RANDOM: Randomly grabs lead within the statuses and lists defined|RANDOM: Aleatoriamente pega um registro entre os status e listas definidas| +UP LAST CALL TIME: Sorts by the newest local call time for the leads|HORA DA ÚLTIMA CHAMADA PARA CIMA: Ordena os registros pela chamada mais recente | +DOWN LAST CALL TIME: Sorts by the oldest local call time for the leads|HORA DA ÚLTIMA CHAMADA PARA BAIXO: Ordena os registros pela chamada mais antiga| +WARNING, we only recommend List Mix for advanced users, Please read the ViciDial Manager Manual|ATENÇÃO, só recomendamos Mesclagem de Listas para usuários avançados, Por favor leia o Manual de Gerente do Vicidial| +Add Call Menu|Incluir Menu de Chamada| +Copy Call Menu|Copiar Menu de Chamada| +New Call Menu|Novo Menu de Chamada| +Modify Call Menu|Alterar Menu de Chamada| +Delete Call Menu|Remover Menu de Chamada| +Call Menus|Menus de Chamada| +Menu ID|ID do Menu| +This is the ID for this step of the call menu. This will also show up as the context that is used in the dialplan for this call menu|Este é o ID para este passo do menu de chamadas. Ele irá aparecer como o contexto que é usado no plano de discagem para este menu de chamadas| +Menu Name|Nome do Menu| +This field is the descriptive name for the call menu|Este campo é o nome descritivo do menu de chamadas| +Menu Prompt|Audio do Menu| +This field contains the file name of the audio prompt to play at the beginning of this menu|Este campo contém o nome do arquivo para o audio que será tocado no inicio do menu| +Menu Timeout|Tempo max do menu| +This field is where you set the timeout in seconds that the menu will wait for the caller to enter in a DTMF choice|Este campo é onde você configura o tempo máximo em segundos que um menu irá aguardar o cliente digitar uma opção em DTMF| +Menu Timeout Prompt|Audio de tempo excedido do menu| +This field contains the file name of the audio prompt to play when the timeout has been reached. Default is NONE to play no audio at timeout|Este campo contém o arquivo de audio a ser tocado caso o tempo máximo de espera tenha sido alcançado. O padrão é NONE para nao tocar audio| +Menu Invalid Prompt|Audio de Opção Inválida do menu| +This field contains the file name of the audio prompt to play when the caller has selected an invalid option. Default is NONE to play no audio at invalid|Este campo contém o nome do arquivo de audio que será tocado quando o cliente selecionar uma opção inválida. O padrão é NONE que não toca audio quando a opção é inválida| +Menu Repeat|Repetir Menu| +This field is where you define the number of times that the menu will play after the first time if no valid choice is made by the caller. Default is 1 to repeat the menu once|Este campo é onde você define o número de vezes que o menu irá tocar depois da primeira vez, se nenhuma opção for escolhida pelo cliente. O padrão é 1 para repetir o menu uma vez| +Menu Time Check|Verif. Horário de Menu| +This field is where you can select whether to restrict the Call Menu access to the specific hours set up in the selected Call Time. If the Call Time is blank, this setting will be ignored. Default is 0 for disabled|Este campo é onde você seleciona se as chamadas á URA devem ser restritas a horários específicos cadastrados no Cadastro de Horários de Chamada. Se o Horário de chamada estiver vazio, esta configuração será ignorada. O padrão é 0 para desabilitado| +Call Time ID|ID Hor. de Chamadas| +This is the Call Time ID that will be used to restrict calling times if the Menu Time Check option is enabled|Este é o ID do Horário de chamadas que será usado para restringir horários de chamada para este menu, quando a opção estiver habilitada| +Track Calls in Real-Time Report|Rastrear Chamadas no Relat. Tempo-Real| +This field is where you can select whether you want the call to be tracked in the Real-time screen as an incoming IVR type call. Default is 1 for active|Este campo é onde você seleciona se deseja que as chamadas devem ser rastreadas no relatório de Tempo-Real como uma chamada de URA. O padrão é 1 para ativo| +Option Value|Valor da Opção| +This field is where you define the menu option, possible choices are|Este campo é onde você define a opção de menu, as opções são| +Option Route|Rota da Opção| +This menu contains the options for where to send the call if this option is selected|Este menu contém as opções para onde enviar a chamada quando este menu for selecionado| +The special option TIMECHECK can be used only if you have Menu Time Check enabled and there is a Call Time defined for the Menu|A opção especial TIMECHECK pode ser usada somente se você habilitou a verificação de horário e existe um horário de chamadas definido para o menu| +Option Route Value|Valor da rota da opção| +This field is where you enter the value that defines where in the selected Option Route that the call is to be directed to|Este campo é onde você coloca o valor que define para onde, na Opção de Rota selecionada, a chamada deve ser direcionada | +Option Route Value Context|Contexto do valor da rota da opção| +This field is optional and only used for EXTENSION Option Routes|Este campo é opcional e somente é usado para Rotas do tipo EXTENSION| +ADD A NEW CALL MENU|INCLUIR UM MENU| +COPY CALL MENU|COPIAR UM MENU| +This menu contains the options for where to send the call if this option is selected: CALLMENU,INGROUP,DID,HANGUP,EXTENSION,PHONE. For CALLMENU, the Route Value should be the Menu ID of the Call Menu that you want the call sent to. For INGROUP, the In-Group that you want the call to be sent to needs to be selected as well as the other 5 options that need to be set to properly route a call to an Inbound Group. For DID, the Route Value needs to be the DID pattern that you want to send the call to. For HANGUP, the Route Value can be the name of an audio file to play before hanging up the call. For EXTENSION, the Route Value needs to be the dialplan extension you want to send the call to, and the Route Value Context is the context that extension is located in, if left blank the context will default to default. For PHONE, the Route Value needs to be the phone login value for the phones entry that you want to send the call to. For VOICEMAIL, the Route Value needs to be the voicemail box number, the unavailable mesage will be played. For AGI, the Route Value needs to be the agi script and any values taht need to be passed to it.| +Este menu contém as opções para onde enviar a chamada se esta opção for selecionada: CALLMENU,INGROUP,DID,HANGUP,EXTENSION,PHONE. Para CALLMENU, o Valor da Rota deve ser o ID do menu de chamadas para o qual você quer enviar a chamada. Para INGROUP, o In-Group que você quer que a chamada seja enviada deve estar selecionado junto com outras 5 opções que precisam estar configuradas para rotear corretamente a chamada para um grupo de entrada. Para DID, o valor de rota precisa ser o padrão DID para o qual você quer enviar a chamada. Para HANGUP, o Valor da Rota pode ser o nome do arquivo de audio a ser tocado antes de desligar a chamada. Para EXTENSION, o valor de rota precisa ser a extensão do plano de discagem para o qual você quer enviar a chamada, e o Valor do Contexto da Rota, é o contexto no qual a extensão está localizada. se deixado em branco o contexto usado será o default. Para PHONE, o valor da rota precisa ser o login do ramal para o qual deseja desviar a chamada. Para VOICEMAIL, o Valor da Rota precisa ser o número da caixa postal, a mensagem de não disponível será tocada. Para AGI, o valor da rota precisa ser o script agi e os valores que precisam ser passados a ele.| +Option Description|Descrição da Opção| +This field is where you can describe the option, this description will be put into the dialplan as a comment above the option|Este campo é onde você descreve a opção, esta descrição será colocada no plano de discagem como um comentário acima da opção| +Source Menu|Menu Origem| +CALL MENU NOT ADDED|MENU NÃO INCLUÍDO| +Call Menu ID must be between 2 and 50 characters in length and contain no|O ID do menu deve ter entre 2 e 50 caracteres de comprimento e nao conter| +CALL MENU ADDED|MENU INCLUÍDO| +CALL MENU NOT MODIFIED|MENU NÃO ALTERADO| +CALL MENU MODIFIED|MENU ALTERADO| +Click here to see Admin chages to this CALL MENU|Clique aqui para ver as alterações deste MENU| +DELETE THIS CALL MENU|REMOVER ESTE MENU| +MODIFY A CALL MENU RECORD|ALTERAR O REGISTRO DE MENU| +Time Check|Verif. Horário| +No Time Check|Sem Verif. Horário| +Realtime Tracking|Rastrear em Tempo-Real| +No Realtime Tracking|Sem Rastream. em Tempo-Real| +Call Menu Options|Opções do Menu| +Option|Opção| +CALL MENU NOT DELETED|MENU NÃO REMOVIDO| +CALL MENU DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE MENU| +Click here to delete CALL MENU|Clique aqui para remover o MENU| +CALL MENU DELETION COMPLETED|REMOÇÃO DE MENU COMPLETADA| +CALL MENU LISTINGS|LISTA DE MENUS| +CALLMENU will send the call to the defined Call Menu|MENU irá enviar a chamada para o menu determinado| +Call Menu|Menu| +If CALLMENU is selected as the DID Route, then this is the Call Menu that calls will be sent to|Se CALLMENU estiver selecionado como Rota de DDR, então este é o Menu para o qual a chamada será transferida| +Show Call Menus|Mostrar Menus| +Add A New Call Menu|Incluir um Menu| +Copy Call Menu|Copiar um Menu| +To delete an Option, just set the Route to REMOVE and the option will be deleted when you click the SUBMIT button|Para remover uma opção, apenas selecione a rota como REMOVE e a opção será removida quando você clicar no botão enviar| +Agent Only Callback Campaign Lock|Trava para Agendamento Vinculado| +This option defines whether AGENTONLY callbacks are locked to the campaign that the agent originally created them under. Setting this to 1 means that the agent can only dial them from the campaign they were set under, 0 means that the agent can access them no matter what campaign they are logged into. Default is 1|Esta opção define se Agendamento Vinculado(AGENTONLY) serão travados para a campanha que o a gente originalmente agendou. Configurando como 1 significa que o agente somente pode discar para eles a partir da campanha que os configurou, 0 significa que o agente pode acessar os agendamentos não importando a campanha que eles foram criados. O padrão é 1| +Central Sound Control Active|Controle Central de Audio Ativado| +This option defines whether the sound synchronization system is active across all servers. Default is 0 for inactive|Esta opção define se o sistema de sincronia de som está ativado entre todos os servidores. O padrão é 0 para inativo| +Sounds Web Server|Servidor Web de Sons| +This is the server name or IP address of the web server that will be handling the sound files on this system, this must match the server name or IP of the machine you are trying to access the audio_store.php webpage on or it will not work. Default is 127.0.0.1|Este é o nome do servidor ou endereço IP para o servidor web que estará controlando os arquivos de audio no sistema, isto deve combinar com o nome do servidor ou endereço IP no qual você está tentando acessar a página audio_store.php. O padrão é 127.0.0.1| +Sounds Web Directory|Diretório Web de Sons| +This auto-generated directory name is created at random by the system as the place that the audio store will be kept. All audio files will reside in this directory|Esta auto-generado nombre del directorio es creado al azar por el sistema como el lugar que la tienda de audio se mantendrá. Todos los archivos de audio residir en este directorio| +Audio Store|Audio de la tienda| +Audio File to Upload|Audio de un archivo para subir| +This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here|Esta utilidad te permite subir archivos de audio para el servidor de forma que puedan ser distribuidos a todos los servidores de Vicidial en un multi-cluster de servidores. Una nota importante, sólo dos tipos de archivos de audio de trabajo,. Archivos WAV PCM de 16 bits que se 8k y los archivos. GSM que se 8bit 8k. Por favor, verifique que los archivos tienen el formato correcto antes de subirlos aquí| +Sounds Update|Actualización de los sonidos| +If you want to force a check of the sound files on this server, and the central audio store is enabled as a system setting, then this field will allow the sounds updater to run at the next top of the minute. Any time an audio file is uploaded from the web interface this is automatically set to Y for all servers that have Asterisk active. Default is N|Si desea forzar una comprobación de los archivos de sonido en este servidor, y el almacén central de audio está activado como una configuración del sistema, este campo permitirán a los sonidos de actualización para ejecutar en la parte superior de la siguiente minuto. Toda vez que un archivo de audio se carga desde la interfaz web de este se ajusta automáticamente a Y para todos los servidores que tienen activos de Asterisk. Por defecto es n| +Active Voicemail Server|Servidor de correo de voz activo| +In multi-server systems, this is the server that will handle all voicemail boxes. This server is also where the dial-in generated prompts will be uploaded from, the 8168 recordings|En sistemas multi-servidor, este es el servidor que se encargará de todas las casillas de correo de voz. Este servidor es también donde la línea telefónica en mensajes generados se cargan desde el 8168 grabaciones| +Auto Dial Limit|Marcado automático de límite de| +This is the maximum limit of the auto dial level in the campaign screen|Este es el límite máximo de la escala de marcación automática en la pantalla de la campaña| +User Territories are not active on this system|Territorios de usuario no están activos en este sistema| +User Territories|Territorios de usuario| +List All Territories:|Lista de todos los territorios:| +User Territories Active|Territorios de usuario de Active| +This setting allows you to enable the User Territories setttings from the user modification screen. This feature was added to allow for more integration with a customized Vtiger installation but can have applications in a pure ViciDial system as well. Default is 0 for disabled|Esta configuración le permite habilitar la setttings territorios de usuario desde la pantalla de modificación del usuario. Esta característica se agregó para permitir una mayor integración con una instalación personalizada Vtiger pero puede tener aplicaciones en un sistema de Vicidial pura también. Por defecto es 0 para discapacitados| +List Territories|Lista de territorios| +Add Territory|Añadir Territorio| +Add User Territory|Añadir usuario Territorio| +Territory|Territorio| +Territory Description|Territorio Descripción| +Territory and Territory Description must be filled in|Territorio y Territorio Descripción deben ser rellenados| +there is already a territory in the system with this name|ya existe un territorio en el sistema con ese nombre| +Territory Added|Territorio en que se agregó| +Modify Territory|Modificar Territorio| +Territory not found|Territorio que no se encuentra| +This territory is not in the system with this name|Este territorio no está en el sistema con ese nombre| +Territory Modified|Territorio Modificado| +Territory must be filled in|Territorio debe ser llenado en| +Territory Deleted|Territorio eliminados| +Delete This Territory|Suprimir este territorio| +Vtiger Accounts|Cuentas Vtiger| +Agents|Agentes| +Territory, User and Level must be filled in|Territorio, y de nivel de usuario debe ser llenado en| +this territory user is already in the system|este usuario territorio ya está en el sistema de| +User Territory Added|Usuario Territorio Añadido| +this territory user is not in the system|este usuario territorio no está en el sistema| +User Territory Modified|Usuario Territorio Modificado| +Territory and User must be filled in|Territorio y el usuario deberá ser llenado en| +User Territory Deleted|Usuario Territorio eliminados| +Vtiger Change Territory Owner|Vtiger Cambio Territorio Propietario| +Had to add user territory|Tuvo que añadir el territorio de usuario| +Vtiger Territory Owner Changed|Vtiger Territorio Propietario cambiado| +Records Changed|Registros modificados| +ViciDial Recording Limit|Grabación Vicidial Límite| +This field is where you set the maximum number of minutes that a call recording initiated by ViciDial can be. Default is 60 minutes|Este campo es donde se define el número máximo de minutos que una grabación de la llamada iniciada por Vicidial puede ser. Por defecto es de 60 minutos| +This is the dial plan context that the agent applications, like ViciDial, primarily use. It is assumed that all numbers dialed by the client apps are using this context so it is a good idea to make sure this is the most wide context possible. verify with extensions.conf file before changing. default is default|Este es el contexto del plan de marcado que las solicitudes de agente, como Vicidial, principalmente el uso. Se supone que todos los números marcados por las aplicaciones cliente utilizan este contexto, por lo que es una buena idea para asegurarse de que este es el contexto más amplio posible. verificar con el archivo extensions.conf antes de cambiar. por defecto es por defecto| +Phone Context|Teléfono Contexto| +This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default|Este es el contexto del plan de marcado que este teléfono se utiliza para marcar. Si está ejecutando un centro de llamadas y usted no desea que sus agentes sean capaces de marcar fuera de la aplicación Vicidial por ejemplo, entonces puedes establecer este campo a un contexto dialplan que no existe, algo como agente nodial. por defecto es por defecto| +Use the HIDE option to completely remove the customer phone number from the agent display|Utilice la opción Ocultar para eliminar completamente el número de teléfono del cliente de la pantalla del agente de| +Click here to see a traffic report for this DID|Haga clic aquí para ver un informe de tráfico para este DID| +Agent Time Detail|Agente Tiempo Detalle| +User Timeclock Detail Report|Usuario Timeclock Detalle Informe| +Carrier Logging Active|Portador de registro activo| +This setting allows you to log all hangup return codes for any outbound list dialing calls that you are placing. Default is N.|Esta configuración le permite registrar todos los códigos de retorno para colgar cualquier lista de marcación saliente llamadas que están haciendo. Por defecto es N.| +Drop Lockout Time|Tiempo de caída de bloqueo| +This is a number of hours that DROP abandon calls will be prevented from being dialed, to disable set to 0. This setting is very useful in countries like the UK where there are regulations preventing the attempted calling of customers within 72 hours of an Abandon, or DROP. Default is 0|Este es un número de horas que DROP abandonar pide se le impida que se está marcando, para establecer inhabilitar a 0. Esta opción es muy útil en países como el Reino Unido, donde existen normas que impiden la tentativa de llamar a los clientes dentro de las 72 horas de abandono, o DROP. Por defecto es 0| +Phone Ring Timeout|Teléfono Anillo de tiempo de espera| +This is the amount of time, in seconds, that the phone will ring in the dialplan before sending the call to voicemail. Default is 60 seconds|Esta es la cantidad de tiempo, en segundos, que el teléfono sonará en el dialplan antes de enviar la llamada al buzón de voz. El valor predeterminado es 60 segundos| +Allow Custom Dialplan Entries|Permitir Custom Dialplan entradas| +This option allows you to enter custom dialplan lines into Call Menus. Default is 0 for inactive|Esta opción le permite introducir líneas personalizadas dialplan en llamadas menús. El valor predeterminado es 0 para los inactivos| +Custom Dilplan Entry|Custom Dilplan entrada| +This field allows you to enter in any dialplan elements that you want for the Call Menu|Este campo le permite entrar en los elementos dialplan que desea para el menú de llamada| +You can enter multiple propmts in this field and the other prompt fields by separating them with a pipe character|Puede introducir propmts múltiples en este campo y los demás ámbitos del sistema mediante la separación de ellos con un carácter de canalización| +Setting this field to zero 0 will mean that there will be no wait time after the prompt is played|Establecer este campo a cero 0 significa que no habrá tiempo de espera después de que el sistema se juega| +Conf File Secret|Conf. Archivo Secreto| +This is the secret, or password, for the phone in the iax or sip auto-generated conf file for this phone. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test|Este es el secreto o la contraseña, por el teléfono de la SIP IAX o auto-generados conf para este teléfono. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba| +Tracking Group|Grupo de seguimiento de| +This is the ID that you can use to track calls to this Call Menu when looking at the IVR Report. The list includes CALLMENU as the default as well as all of the In-Groups|Esta es la identificación que se puede utilizar para rastrear las llamadas a este menú de llamada cuando se mira al Informe de IVR. La lista incluye CALLMENU como predeterminado, así como todos los Grupos de In -| +Agent Alert Filename|Agente de Alerta Nombre de archivo| +The audio file to play to an agent to announce that a call is coming to the agent. To not use this function set this to X. Default is ding|El archivo de audio a jugar a un agente de anunciar que una llamada está llegando a su agente. Para no utilizar esta función establezca este valor por defecto es a X. Ding| +This field as with the other audio fields in In-Groups, with the exception of the Agent Alert Filename, can have multiple audio files played if you put a pipe-separated list of audio files into the field|Este campo como con los otros campos de audio en In-grupos, con la excepción del nombre de archivo de alerta de agente, puede tener múltiples archivos de audio reproducido si se pone un tubo de lista separada de los archivos de audio en el campo| +No Agents No Queueing|N de colas n Agentes| +If this field is set to Y or NO_PAUSED then no calls will be put into the queue for this in-group if there are no agents logged in and the calls will go to the No Agent No Queue Action. The NO_PAUSED option will also not send the callers into the queue if there are only paused agents in the in-group. Default is N|Si este campo está establecido en Y o NO_PAUSED entonces no se pide se pondrá en la cola de este grupo en si no hay agentes conectado y las llamadas se vaya a la agente n Ninguna acción de la cola. La opción NO_PAUSED no se envían también las personas que llaman a la cola si sólo hay una pausa en los agentes en el grupo. Por defecto es n| +No Agent No Queue Action|No No Acción cola de agente| +If No Agent No Queue is enabled, then this field defines where the call will go if there are no agents in the In-Group. Default is MESSAGE, this plays the sound files in the Action Value field and then hangs up|Si está activada ninguna cola Ningún Agente, entonces este campo se define en la llamada pasará si no hay agentes en la A-Group. Por defecto es el mensaje, este reproduce los archivos de sonido en el campo el valor de acción y luego cuelga el| +No Agent No Queue Action Value|No hay ninguna cola Acción Agente Valor| +This is the value for the Action above. Default is|Este es el valor de la acción anterior. El valor predeterminado es| +Quick Transfer Button|Rápida transferencia Button| +This option will add a Quick Transfer button to the agent screen below the Transfer-Conf button that will allow one click blind transferring of calls to the selected In-Group or number. IN_GROUP will send calls to the Default Xfer Group for this Campaign, or In-Group if there was an inbound call. The PRESET options will send the calls to the preset selected. Default is N for disabled|Esta opción agrega un botón de la transferencia rápida a la pantalla por debajo de la agente de transferencia de botón Conf. que permitirá la transferencia de un solo clic ciego de llamadas a los seleccionados en Grupo o un número. IN_GROUP enviará pide al Grupo de Xfer predeterminado para esta campaña, o en grupo-si hay una llamada entrante. Las opciones predeterminadas enviará las llamadas a los preset seleccionado. Por defecto es n para discapacitados| +PrePopulate Transfer Preset|Transferencia de rellenar previamente Preset| +This option will fill in the Number to Dial field in the Transfer Conference frame of the agent screen if defined. Default is N for disabled|Esta opción le proporcione el número telefónico al campo en el marco de la Conferencia de transferencia de la pantalla si el agente definido. Por defecto es n para discapacitados| +Enable TTS Integration|Habilitar TTS Integración| +This setting allows you to enable Text To Speech integration with Cepstral. This is currently only available for outbound Survey type campaigns. Default is 0 for disabled|Esta configuración le permite habilitar Texto a la integración de voz con Cepstral. Esto sólo está disponible actualmente para las campañas de tipo de encuesta de salida. Por defecto es 0 para discapacitados| +ADD NEW TTS ENTRY|ADD NEW TTS ENTRADA| +ADDING NEW TTS ENTRY|AGREGAR NUEVO TTS ENTRADA| +MODIFY TTS ENTRY|MODIFICAR TTS ENTRADA| +DELETE TTS ENTRY|DELETE TTS ENTRADA| +TTS ENTRY LIST|TTS LISTA INSCRITOS| +TEXT-TO-SPEECH(TTS) LISTINGS|Texto-a-voz (TTS) LISTINGS| +Text To Speech|Text To Speech| +Show TTS Entries|Mostrar las entradas TTS| +Add A New TTS Entry|Agregar una nueva entrada TTS| +TTS ID|TTS ID| +TTS Name|Nombre TTS| +TTS Text|TTS Texto| +TTS ENTRY NOT ADDED|TTS entrada no AGREGADOS| +there is already a tts entry in the system with this ID|ya hay una entrada de TTS en el sistema con este ID| +TTS ENTRY ADDED|TTS añadido la entrada de| +MODIFY A TTS RECORD|TTS MODIFICAR UN RECORD| +Click here to see Admin chages to this TTS entry|Haga clic aquí para ver chages Admin a esta entrada a TTS| +DELETE THIS TTS ENTRY|ELIMINAR ESTA ENTRADA TTS| +TTS ENTRY NOT MODIFIED|TTS ENTRADA SIN MODIFICAR| +TTS ENTRY MODIFIED|TTS entrada modificada| +TTS ENTRY NOT DELETED|TTS entrada no DELETED| +TTS ENTRY DELETION CONFIRMATION|TTS DE ENTRADA SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete tts entry|Haga clic aquí para eliminar TTS entrada| +This is the short name of a TTS entry. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters|Este es el nombre corto de una entrada de TTS. Esto debe ser un identificador único. No utilice espacios ni puntuacion para este campo. caracteres como máximo 50, mínimo de 2 caracteres| +This is a more descriptive name of the TTS entry. This is a short summary of the TTS definition. max 100 characters, minimum of 2 characters|Este es un nombre más descriptivo de la entrada TTS. Este es un breve resumen de la definición de TTS. 100 caracteres como máximo, mínimo de 2 caracteres de| +This option allows you to set the TTS entry to active or inactive|Esta opción le permite establecer la entrada de TTS a activos o inactivos| +This is the actual Text To Speech data field that is sent to Cepstral for creation of the audio file to be played to the customer. you can use Speech Synthesis Markup Language -SSML- in this field, for example|Este es el texto real de campo de datos de voz que se envía a Cepstral para la creación del archivo de audio que deben desempeñar para el cliente. Usted puede utilizar Speech Syntesis Markup Language-SSML-en este campo, por ejemplo,| +for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--. Here is a list of the available variables: |de 1 segundo descanso. También puede utilizar varias variables como el nombre, apellido y el título como variables Vicidial tal como lo harías en una secuencia de comandos: - A - first_name - B -. Aquí está una lista de las variables disponibles:| +Multiple Campaign Drop Rate Group|Varias campañas Drop Rate Grupo| +This feature allows you to set a campaign as a member of a Campaign Drop Rate Group, or a group of campaigns whose Human Answered calls and Drop calls for all campaigns in the group will be combined into a shared drop percentage, or abandon rate. This allows you to to run multiple campaigns at once and more easily control your drop rate. This is particularly useful in the UK where regulations permit this drop rate calculation method with campaign grouping for the same company even if there are several campaigns that company is running during the same day. To enable this for a campaign, just select a group from the list. There are 10 groups defined in the system by default, you can contact your system administrator to add more. Default is DISABLED|Esta característica le permite establecer una campaña como miembro de una campaña de la velocidad de descenso del Grupo, o un grupo de campañas cuyas llamadas contestadas y llamadas Humanos Drop para todas las campañas en el grupo se combinarán en un porcentaje de caída compartida, o tasa de abandono. Esto le permite ejecutar varias campañas a la vez y más fácil de controlar su tasa de caída. Esto es particularmente útil en el Reino Unido, donde las regulaciones lo permiten esta disminución método del tipo de cálculo con la campaña de la agrupación por la misma empresa, incluso si hay varias campañas que la empresa está ejecutando en el mismo día. Para habilitar esta para una campaña, sólo tienes que seleccionar un grupo de la lista. Hay 10 grupos definidos en el sistema por defecto, puede ponerse en contacto con el administrador del sistema para añadir más. Desactivado por defecto| +IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Conf File Secret field further down on this page|Importante, esta es la única contraseña para la red de interfaz de usuario del agente de teléfono, para cambiar el sip.conf iax.conf o contraseña, o en secreto, para este dispositivo de teléfono que tenga que modificar el campo Archivo Secreto Conf. más abajo en esta página| +Agent Status Viewable Groups|Estado del agente visible Grupos| +This is a selectable list of User Groups and user functions to which members of this user group can view the status of as well as transfer calls to inside of the agent screen. The ALL-GROUPS option allows the users in this group to see and transfer calls to any user on the system. The CAMPAIGN-AGENTS option allows users in this group to see and transfer calls to any user in the campaign that they are logged into|Esta es una lista seleccionable de grupos de usuarios y las funciones de usuario al que los miembros de este grupo de usuarios pueden ver el estado de las llamadas, así como la transferencia al interior de la pantalla del agente. La opción de grupo permite a los usuarios de este grupo para ver y transferir llamadas a cualquier usuario en el sistema. La campaña-AGENTES opción permite a los usuarios en este grupo para ver y transferir llamadas a cualquier usuario en la campaña que se registran en la| +Agent Status View Time|Ver estado del agente de turno| +This option defines whether the agent will see the amount of time that users in their agent sidebar have been in their current status. Default is N for no or disabled|Esta opción define si el agente va a ver la cantidad de tiempo que los usuarios en su barra lateral agente han sido en su estado actual. Por defecto es n sin o con discapacidad| +This option allows an agent to disposition a call as CALLBK and choose the date and time at which the lead will be re-activated|Esta opción permite que un agente a disposición de una llamada como CALLBK y elegir la fecha y hora en que el plomo se vuelva a activar| +Agent View Calls in Queue|Agente Pide Ver en cola| +If set to anything but NONE, agents will be able to see details about the calls that are waiting in queue in their agent screen. If set to a number value, the calls displayed will be limited to the number selected. Default is NONE|Si se pone a nada, pero NINGUNO, los agentes podrán consultar los detalles de las llamadas que están esperando en la cola en la pantalla de su agente. Si se establece en un valor de número, las llamadas que aparecerá será limitada al número seleccionado. El valor predeterminado es NINGUNO| +View Calls in Queue Launch|Ver las llamadas en cola de lanzamiento| +This setting if set to AUTO will have the Calls in Queue frame show up upon login by the agent into the agent screen. Default is MANUAL|Este ajuste, si en AUTO tendrá las convocatorias en el marco de la cola aparecen en inicio de sesión por el agente en la pantalla del agente. El valor predeterminado es MANUAL| +Agent Grab Calls in Queue|Agente Pide Agarre en cola| +This option if set to Y will allow the agent to select the call that they want to take from the Calls in Queue display by clicking on it while paused. Agents will only be able to grab inbound calls or transferred calls, not outbound calls. Default is N|Esta opción si se define Y permitirá que el agente para seleccionar la llamada que desea tomar de las llamadas en la pantalla de la cola haciendo clic en él durante la pausa. Los agentes sólo podrán coger las llamadas entrantes o las llamadas transferidas, las llamadas no de salida. Por defecto es n| +Agent Call Re-Queue Button|Agente de Call Re-Cola Button| +This option if set to Y will add a Re-Queue Customer button to the agent screen, allowing the agent to send the call into an AGENTDIRECT queue that is reserved for the agent only. Default is N|Esta opción si se define Y agregará un botón Re-cliente de la cola a la pantalla del agente, permite a las agencias para enviar la llamada en una cola de AGENTDIRECT que está reservado para el único agente. Por defecto es n| +Agent Pause After Each Call|Agente de pausa después de cada llamada| +This option if set to Y will pause the agent after every call automatically. Default is N|Esta opción si se define como Y hará una pausa en el agente después de cada llamada automáticamente. Por defecto es n| +Starts with the highest rank and works its way down|Comienza con la más alta categoría y se abre camino hacia abajo| +Starts with the lowest rank and works its way up|Comienza con el rango más bajo y se abre camino hasta| +Starts with owners beginning with Z and works its way down|Comienza con los propietarios de inicio con Z y obras de su camino hacia abajo| +Starts with owners beginning with A and works its way up|Comienza con los propietarios empiezan con la letra y se abre camino hasta| +No Hopper Dialing|N marcado Hopper| +If This is enabled, the hopper will not run for this campaign. This option is only available when the dial method is set to MANUAL or INBOUND_MAN. It is recommended that you do not enable this option if you have a very large lead database, over 100,000 leads. With No Hopper Dialing, the following features do not work: lead recycling, auto-alt-dialing, list mix, list ordering with Xth NEW. If you want to use Owner Only Dialing you must have No Hopper Dialing enabled. Default is N for disabled|Si esta opción está activada, la tolva no se ejecutará para esta campaña. Esta opción sólo está disponible cuando el método de línea se establece en Manual o INBOUND_MAN. Se recomienda que no habilite esta opción si usted tiene una base de datos de plomo muy grande, más de 100.000 clientes potenciales. Con n marcado Hopper, las características siguientes no funcionan: reciclaje de plomo, auto-alt-marcación, la mezcla lista, lista de pedido con X NEW. Si desea utilizar único dueño de marcado no debe tener marcado Hopper habilitado. Por defecto es n para discapacitados| +Owner Only Dialing|Único propietario de marcado| +If This is enabled, the agent will only receive leads that they are within the ownership parameters for. If this is set to USER then the agent must be the user defined in the database as the owner of this lead. If this is set to TERRITORY then the owner of the lead must match the territory listed in the User Modification screen for this agent. If this is set to USER_GROUP then the owner of the lead must match the user group that the agent is a member of. For this feature to work the dial method must be set to MANUAL or INBOUND_MAN and No Hopper Dialing must be enabled. Default is NONE for disabled|Si esta opción está activada, el agente sólo recibirá las pistas que están dentro de los parámetros de la propiedad. Si esto se establece a usuario entonces el agente debe ser definida por el usuario en la base de datos como el propietario de este lugar. Si esto se establece en territorio que entonces el dueño de la iniciativa debe coincidir con el territorio que figuran en la pantalla de modificación del usuario de este agente. Si esto se establece a USER_GROUP entonces el dueño de la iniciativa debe coincidir con el grupo de usuarios que el agente es un miembro de. Para que esta característica funcione el método de línea se debe establecer en Manual o INBOUND_MAN marcado Hopper y no debe estar activado. El valor predeterminado es NINGUNO para discapacitados| +Reset Times|Perdí Times| +This field allows you to put times in, separated by a dash-, that this list will be automatically reset by the system. The times must be in 24 hour format with no punctuation, for example 0800-1700 would reset the list at 8AM and 5PM every day. Default is empty|Este campo le permite poner veces, separados por un guión, que esta lista se restablece automáticamente por el sistema. Los tiempos deben estar en formato de 24 horas sin puntuacion, por ejemplo 0800-1700 se restablecer la lista de las 8 AM y las 5 PM todos los días. Por defecto está vacío| +Owner: |Propietario:| +OWNERS WITHIN THIS LIST|PROPIETARIOS dentro de esta lista| +RANKS WITHIN THIS LIST|RANKS dentro de esta lista| +Allow Alerts|Permitir Alertas| +This field gives you the ability to allow agent browser alerts to be enabled by the agent for when calls come into their vicidial.php session. Default is 0 for NO|Este campo le da la capacidad para permitir navegador agente de alertas para ser habilitado por el agente para cuando las llamadas entran en su período de sesiones vicidial.php. Por defecto es 0 para el NO| +Agent Display Dialable Leads|Agente de pantalla Dialable Leads| +This option if enabled will show the number of dialable leads available in the campaign in the agent screen. This number is updated in the system once a minute and will be refreshed on the agent screen every few seconds|Esta opción se mostrará si está habilitado el número de derivaciones dialable disponibles en la campaña en la pantalla del agente. Este segundo número se actualiza en el sistema una vez por minuto y se actualiza en la pantalla del agente por cada par de| +VICIDIAL Balance Rank|Balance Vicidial Rank| +This field allows you to set the order in which this server is to be used for balance dialing, if balance dialing is enabled. The server with the highest rank will be used first in placing Balance fill calls. Default is 0|Este campo le permite establecer el orden en que este servidor se va a utilizar para la marcación de equilibrio, si está activada la marcación de equilibrio. El servidor con el rango más alto será usado primero en la colocación de Balance llenar las llamadas. Por defecto es 0| +Inbound Summary Hourly Report|Resumen horario de entrada Informe| +orders by the amount of time agent has been actively waiting for a call|pedidos por la cantidad de tiempo que el agente ha estado activamente la espera de una llamada de| +Agent Script Override|Agente de secuencias de comandos Reemplazar| +If this field is set, this will be the script that the agent sees on their screen instead of the campaign script when the lead is from this list. Default is not set|Si se establece este campo, esta será la secuencia de comandos que el agente ve en su pantalla en lugar de la secuencia de comandos de campaña cuando la ventaja es de esta lista. Por defecto no se establece| +Music On Hold|Música en espera| +ADD NEW MUSIC ON HOLD ENTRY|ADD NEW MUSIC EN ESPERA DE ENTRADA| +ADDING NEW MUSIC ON HOLD ENTRY|ADDING NEW MUSIC EN ESPERA DE ENTRADA| +MODIFY MUSIC ON HOLD ENTRY|MODIFICAR MÚSICA EN ESPERA DE ENTRADA| +DELETE MUSIC ON HOLD ENTRY|DELETE MÚSICA EN ESPERA DE ENTRADA| +MUSIC ON HOLD ENTRY LIST|MÚSICA EN ESPERA LISTA DE ENTRADA| +We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files|Le recomendamos ENCARECIDAMENTE cargar sólo 16 bits 8k archivos de audio WAV PCM| +Music On Hold ID|Música en espera de identificación| +This is the short name of a Music On Hold entry. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 100 characters, minimum of 2 characters|Este es el nombre corto de una música en espera de entrada. Esto debe ser un identificador único. No utilice espacios ni puntuacion para este campo. 100 caracteres como máximo, mínimo de 2 caracteres de| +Music On Hold Name|Música en espera Nombre| +This is a more descriptive name of the Music On Hold entry. This is a short summary of the Music On Hold context and will show as a comment in the musiconhold-vicidial.conf file. max 255 characters, minimum of 2 characters|Este es un nombre más descriptivo de la música en espera de entrada. Este es un breve resumen de la música en espera contexto y se verá como un comentario en el musiconhold archivo vicidial.conf. máximo de 255 caracteres, mínimo de 2 caracteres| +This option allows you to set the Music On Hold entry to active or inactive. Inactive will remove the entry from the conf files|Esta opción le permite definir la música en espera la entrada en activo o inactivo. Inactivo eliminará la entrada de los archivos de conf| +Random Order|Orden aleatorio| +This option allows you to define the playback of the audio files in a random order. If set to N then the defined order will be used|Esta opción le permite definir la reproducción de los archivos de audio en un orden aleatorio. Si se establece a N, entonces el orden definido se utilizará| +To add a new audio file to a Music On Hold entry the file must first be in the audio store, then you can select the file and click submit to add it to the file list. Music on hold is updated once per minute if there have been changes made. Any files not listed in a music on hold entry that are present in the music on hold folder will be deleted|Para añadir un nuevo archivo de audio a una música en espera de entrada el primer archivo debe estar en la tienda de audio, puede seleccionar el archivo y haga clic en Enviar para añadirlo a la lista de archivos. Música en espera se actualiza una vez por minuto si se han producido cambios realizados. Cualquier archivo que no figuran en la música en la entrada de reserva que están presentes en la música en la carpeta celebrar serán eliminados| +MUSIC ON HOLD ENTRY NOT ADDED|MÚSICA EN ESPERA entrada no AGREGADOS| +there is already a moh entry in the system with this ID|ya hay una entrada en el Ministerio de Salud en el sistema con este ID| +MUSIC ON HOLD ENTRY ADDED|MÚSICA EN ESPERA añadido la entrada de| +Click here to see Admin chages to this Music On Hold entry|Haga clic aquí para ver chages de administración para esta música en espera de entrada| +Audio Files|Archivos de Audio| +Add An Audio File|Añadir un archivo de audio| +Rank: |Rango:| +MUSIC ON HOLD ENTRY NOT MODIFIED|MÚSICA EN ESPERA DE ENTRADA SIN MODIFICAR| +MUSIC ON HOLD ENTRY MODIFIED|MÚSICA EN ESPERA entrada modificada| +Add A New MOH Entry|Agregar una nueva entrada del Ministerio de Salud| +Show MOH Entries|Mostrar las entradas del Ministerio de Salud| +Active Agent Server|Active Server Agent| +Setting this option to N will prevent agents from being able to login to this server through the vicidial agent screen. This is very useful when using a phone login load balanced setup. Default is Y|Al establecer esta opción a N de impedir que los agentes de poder acceder a este servidor a través de la pantalla del agente Vicidial. Esto es muy útil cuando se utiliza una carga de inicio de sesión de instalación del teléfono equilibrada. Por defecto es Y| +Rebuild Music On Hold|Volver a generar música en espera| +If you want to force a rebuilding of the music on hold files or if the music on hold entries or server entries have changed then this should be set to Y. After the music on hold files have been synchronized and reloaded then this will be changed to N. Default is Y|Si desea forzar una reconstrucción de la música en los archivos de la bodega o si la música en las entradas de espera ni entradas de servidor han cambiado entonces esto debe establecerse en Y. Después de la música en espera los archivos se han sincronizado y volver a cargar entonces esto va a ser cambiado a N. defecto es Y| +MUSIC ON HOLD ENTRY NOT DELETED|MÚSICA EN ESPERA DE ENTRADA no se eliminan| +MUSIC ON HOLD ENTRY DELETION CONFIRMATION|MÚSICA EN ESPERA DE ENTRADA SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete music on hold entry|Haga clic aquí para borrar música en espera de entrada| +MUSIC ON HOLD DELETION COMPLETED|MÚSICA EN ESPERA SUPRESIÓN COMPLETA| +Starts with Eastern timezones and works West|Comienza con las zonas horarias del Este y del Oeste de obras| +Starts with Western timezones and works East|Comienza con las zonas horarias occidental y oriental de obras| +you must select a user group|usted debe seleccionar un grupo de usuarios| +Enable Second Webform|Formulario de Asistencia Segunda Habilitar| +WaitForSilence Options|Opciones WaitForSilence| +If Wait For Silence is desired on calls that are detected as Answering Machines then this field has those options. There are two settings separated by a comma, the first option is how long to detect silence in milliseconds and the second option is for how many times to detect that before playing the message. Default is EMPTY for disabled. A standard value for this would be wait for 2 seconds of silence twice|Si Wait For silencio es deseada en las llamadas que se detectan como Contestadoras entonces este campo tiene esas opciones. Hay dos opciones separadas por una coma, la primera opción es el tiempo para detectar silencio en milisegundos y la segunda opción es para cuántas veces se detecta que antes de reproducir el mensaje. Por defecto está vacío para discapacitados. Un valor estándar para este sería esperar 2 segundos de silencio en dos ocasiones| +This field is for entering the prompt to play when the agent gets an answering machine and clicks on the Answering Machine Message button in the transfer conference frame. You must set this to either an audio file in the audio store or a TTS prompt if TTS is enabled on your system|Este campo es para entrar en el sistema para jugar cuando el agente recibe un contestador automático y hace clic en el botón Responder a máquina contestadora en el marco de conferencias de transferencia. Debe establecer que esto sea un archivo de audio en la tienda de audio o un sistema TTS TTS si está habilitada en su sistema de| +EXTENDED ALTERNATE PHONE NUMBERS FOR THIS LEAD|EXTENDED SUPLENTE NÚMEROS DE TELÉFONO PARA ESTE DE PLOMO| +ADD NEW VOICEMAIL BOX|ADD NEW contestador| +ADDING NEW VOICEMAIL BOX|AGREGAR NUEVO contestador| +MODIFY VOICEMAIL BOX|MODIFICAR contestador| +MODIFY A VOICEMAIL BOX|MODIFICAR UN contestador| +DELETE VOICEMAIL BOX|DELETE contestador| +VOICEMAIL BOXES LIST|LISTA DE CORREO DE VOZ CAJAS| +VOICEMAIL BOXES|CAJAS DE CORREO DE VOZ| +ADD NEW VOICEMAIL BOX|ADD NEW contestador| +Voicemail ID|ID de correo de voz| +This is the all numbers identifier of this mailbox. This must not be a duplicate of an existing voicemail ID or the voicemail ID of a phone on the system, minimum of 2 characters|Este es el identificador de todos los números de este buzón. Esto no debe ser un duplicado de un mensaje de voz existentes de identificación o la identificación del correo de voz de un teléfono en el sistema, mínimo de 2 caracteres| +This is name associated with this voicemail box. max 100 characters, minimum of 2 characters|Este es el nombre asociado a este buzón de voz. 100 caracteres como máximo, mínimo de 2 caracteres de| +This is the password that is used to gain access to the voicemail box when dialing in to check messages max 10 characters, minimum of 2 characters|Esta es la contraseña que se utiliza para acceder al buzón de voz cuando se marca para revisar los mensajes máximo 10 caracteres, mínimo de 2 caracteres| +This option allows you to set the voicemail box to active or inactive. If the box is inactive you cannot leave messages on it and you cannot check messages in it|Esta opción le permite configurar la casilla de correo de voz activo o inactivo. Si el cuadro está inactivo no se puede dejar mensajes en él y no se puede revisar los mensajes en él| +This optional setting allows you to have the voicemail messages sent to an email account, if your system is set up to send out email. If this field is empty then no emails will be sent out|Este ajuste opcional le permite tener los mensajes de correo de voz enviado a una cuenta de correo electrónico, si su sistema está configurado para enviar correo electrónico. Si este campo está vacío, entonces no los correos electrónicos se envían| +VOICEMAIL BOX NOT ADDED|Contestador NO AGREGADOS| +there is already a voicemail box in the system with this ID|ya existe un buzón de voz en el sistema con este ID| +there is already a phone in the system with this voicemail ID|ya hay un teléfono en el sistema de correo de voz con este ID| +VOICEMAIL BOX ADDED|Contestador AGREGADOS| +VOICEMAIL BOX NOT MODIFIED|Contestador SIN MODIFICAR| +VOICEMAIL BOX MODIFIED|Contestador MODIFICADOS| +VOICEMAIL BOX NOT DELETED|Contestador no se eliminan| +VOICEMAIL BOX DELETION COMPLETED|Contestador SUPRESIÓN COMPLETA| +VOICEMAIL BOX DELETION CONFIRMATION|Contestador SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete voicemail box|Haga clic aquí para eliminar buzón de voz| +DELETE THIS VOICEMAIL BOX|Este mensaje de voz DELETE BOX| +Click here to see Admin chages to this voicemail box|Haga clic aquí para ver chages de administración para esta casilla de correo de voz| +The following fields must have data|Los siguientes campos deben disponer de datos| +Campaign CID Override|Campaña CID Override| +If this field is set, this will override the campaign CallerID that is set for calls that are placed to leads in this list. Default is not set|Si se establece este campo, que reemplazarán la campaña CallerID que se establece para las llamadas que se colocan a la cabeza en esta lista. Por defecto no se establece| +Answering Machine Message Override|Contestador automático de mensajes Override| +If this field is set, this will override the Answering Machine Message set in the campaign for customers in this list. Default is not set|Si se establece este campo, esto anulará el mensaje de contestador automático situado en la campaña para los clientes en esta lista. Por defecto no se establece| +Drop Inbound Group Override|Drop de entrada Grupo de Override| +If this field is set, this in-group will be used for outbound calls within this list that drop from the outbound campaign instead of the drop in-group set in the campaign detail screen. Default is not set|Si se establece este campo, en este grupo se utilizará para las llamadas salientes dentro de esta lista que la caída de la campaña de salida en lugar de la caída en grupo situado en la pantalla de detalle de la campaña. Por defecto no se establece| +Agent Select Territories|Agente Seleccione territorios| +If this option is enabled and the agent belongs to at least one territory, the agent will have the option of selecting territories to dial leads from. The agent will see a list of available territories upon login and they will have the ability to go back to that territory list when paused to change their territories. For this function to work the Owner Only Dialing option must be set to TERRITORY and User Terriories must be enabled in the System Settings.|Si esta opción está activada y el agente pertenece a al menos un territorio, el agente tendrá la opción de selección de territorios a los cables de línea. El agente podrá ver una lista de los territorios disponibles a inicio de sesión y tendrán la capacidad de volver a la lista territorio cuando se detuvo a cambiar sus territorios. Para esta función a la labor del único dueño de marcado opción debe configurarse con el territorio y territorios de usuario debe estar habilitado en la configuración del sistema.| +Agent Choose Territories|Agente Elija territorios| +This option if set to 1 allows the user to choose the territories that they will receive calls from when they login to a MANUAL or INBOUND_MAN campaign. Otherwise the user will be set to use all of the territories that they are set to belong to in the User Territories administrative section|Esta opción si se establece en 1 permite al usuario elegir los territorios que van a recibir llamadas de los usuarios cuando ingresan a un manual o campaña INBOUND_MAN. De lo contrario el usuario será configurado para utilizar todos los territorios que se establecen a pertenecer a los territorios de usuario administrativos sección| +The AREACODE option is just like the Y option, except it is used to also filter out an entire area code in North America from being dialed, in this case using the 201XXXXXXX entry in the DNC list would block all calls to the 201 areacode if enabled|La opción codigoDeArea es como la opción-y, excepto que se utiliza para filtrar también un código de área en toda América del Norte desde que se está marcando, en este caso mediante la entrada en la lista 201XXXXXXX DNC podría bloquear todas las llamadas a los 201 codigoDeArea si está habilitada| +If you have the active DNC option set to AREACODE then you can also use area code wildcard entries like this 201XXXXXXX to block all calls to the 201 areacode when enabled|Si usted tiene la opción de DNC activas de codigoDeArea a continuación, usted también puede usar el código de entradas de la zona este 201XXXXXXX como comodín para bloquear todas las llamadas a los 201 codigoDeArea cuando está activado| +Carrier Description|Descripción Carrier| +This is put in the comments of the asterisk conf files above the dialplan and account entries. Maximum 255 characters|Éste se coloca en los comentarios de los archivos de conf asterisco encima del dialplan y anotaciones en cuenta. Máximo 255 caracteres| +CAMPAIGNS ALLOWING THIS IN-GROUP|CAMPAÑAS QUE PERMITA EN ESTE GRUPO| +This is the secret, or password, for the server in the iax auto-generated conf file for this server on other servers. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test|Este es el secreto, o la contraseña, para que el servidor en el auto iax generado conf para este servidor en otros servidores. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba| +Delete Voicemail After Email|Eliminar correo de voz después del email| +This optional setting allows you to have the voicemail messages deleted from the system after they have been emailed out. Default is N|Este ajuste opcional le permite tener los mensajes de correo de voz se elimina del sistema después de haber sido enviado por correo electrónico a cabo. Por defecto es n| +Last Campaign Call Date|Última fecha de convocatoria de la Campaña| +This is the last time that a call was handled by an agent logged into this campaign|Esta es la última vez que una llamada fue manejado por un agente registrado en esta campaña| +Custom User Fields|Los campos de usuario personalizada| +These five fields can be used for various purposes, and they can be populated in the web form addresses and scripts as user_custom_one and so on|Estos cinco campos se puede utilizar para diversos fines, y que se puede rellenar en el formulario web y direcciones de secuencias de comandos como user_custom_one y así sucesivamente| +CRM Popup Login|CRM Popup Login| +If set to Y, the CRM Popup Address is used to open a new window on agent login to this campaign. Default is N|Si se establece en Y, la Dirección de Popup CRM se utiliza para abrir una nueva ventana de inicio de sesión agente a esta campaña. Por defecto es n| +CRM Popup Address|CRM Dirección Popup| +The web address of a CRM login page, it can have variables populated just like the web form address, with the VAR in the front and using --A--user_custom_one--B-- to define variables|La dirección en Internet de una página de acceso de CRM, puede tener las variables de población como la dirección de formulario web, con el VAR en el frente y con la opción - A - user_custom_one - B - para definir variables| +If IN_GROUP is selected as the DID Route, then this is the call handling method used for these calls. CID will add a new lead record with every call using the CallerID as the phone number, CIDLOOKUP will attempt to lookup the phone number by the CallerID in the entire system, CIDLOOKUPRL will attempt to lookup the phone number by the CallerID in only one specified list, CIDLOOKUPRC will attempt to lookup the phone number by the CallerID in all of the lists that belong to the specified campaign, CLOSER is specified for VICIDIAL Closer calls, ANI will add a new lead record with every call using the ANI as the phone number, ANILOOKUP will attempt to lookup the phone number by the ANI in the entire system, ANILOOKUPRL will attempt to lookup the phone number by the ANI in only one specified list, XDIGITID will prompt the caller for an X digit code before the call will be put into the queue, VIDPROMPT will prompt the caller for their ID number and will create a new lead record with the CallerID as the phone number and the ID as the Vendor ID, VIDPROMPTLOOKUP will attempt to lookup the ID in the entire system, VIDPROMPTLOOKUPRL will attempt to lookup the vendor ID by the ID in only one specified list, VIDPROMPTLOOKUPRC will attempt to lookup the vendor ID by the ID in all of the lists that belong to the specified campaign. Default is CID|IN_GROUP Si se selecciona como la Ruta de DID, entonces este es el llamado método de control utilizado para estas llamadas. Cid agregar un registro de conducir nuevo con cada llamada mediante la CallerID como el número de teléfono, CIDLOOKUP intentará buscar el número de teléfono por el CallerID en todo el sistema, CIDLOOKUPRL intentará buscar el número de teléfono por el CallerID en una sola lista especificada , CIDLOOKUPRC intentará buscar el número de teléfono por el CallerID en todas las listas que pertenecen a la campaña especificada, más cerca se especifica para Vicidial Closer llamadas, ANI añadirá un nuevo registro de conducir con cada llamada mediante la ANI como el número de teléfono, ANILOOKUP intentará buscar el número de teléfono de la ANI en todo el sistema, ANILOOKUPRL intentará buscar el número de teléfono de la ANI en una sola lista especificada, XDIGITID pedirá la llamada de un código de dos dígitos X antes de la llamada se pondrá en la cola, VIDPROMPT pedirá la persona que llama por su número de identificación y creará un registro de conducir nuevo con el CallerID como el número de teléfono y el ID como el identificador de proveedor, VIDPROMPTLOOKUP intentará buscar el ID en todo el sistema, VIDPROMPTLOOKUPRL intentará búsqueda del proveedor de identificación de la identificación en una sola lista se especifica, VIDPROMPTLOOKUPRC tratará de buscar el proveedor de identificación de la identificación en todas las listas que pertenecen a la campaña especificado. El valor predeterminado es CID| +UNIFIED_CONTACT- This option will use the beta Vtiger 5.1.0 feature to search by phone number and bring up a search page in Vtiger|UNIFIED_CONTACT-Esta opción se utiliza la versión beta 5.1.0 Vtiger función para buscar por número de teléfono y acceder a la página de búsqueda en Vtiger| +Timer Action|Temporizador de Acción de| +This feature allows you to trigger actions after a certain amount of time. the D1 and D2 DIAL options will launch a call to the Transfer Conference Number presets and send them to the agent session, this is usually used for simple IVR validation AGI applications or just to play a pre-recorded message. WEBFORM will open the web form address. MESSAGE_ONLY will simply display the message that is in the field below. NONE will disable this feature and is the default|Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado| +Timer Action Message|Temporizador de mensaje de acción| +This is the message that appears on the agent screen at the time the Timer Action is triggered|Este es el mensaje que aparece en la pantalla del agente en el momento de la acción del temporizador se dispara| +Timer Action Seconds|Temporizador Segundos Acción| +This is the amount of time after the call is connected to the customer that the Timer Action is triggered. Default is -1 which is also inactive|Esta es la cantidad de tiempo después de la llamada se conecta a los clientes que se desencadena la acción del temporizador. El valor predeterminado es -1, que también está inactivo| +This setting will override the Campaign settings|Esta configuración anula la configuración de la campaña| +Start Call URL|Iniciar llamada URL| +This web URL address is not seen by the agent, but it is called every time a call is sent to an agent if it is populated. Uses the same variables as the web form fields and scripts. This URL can NOT be a relative path. The Start URL does not work for Manual dial calls. Default is blank|Esta web dirección URL no es visto por el agente, sino que es llamado cada vez que una llamada se envía a un agente si se poblaron. Utiliza las mismas variables que los campos de formulario web y scripts. Esta URL no puede ser una ruta relativa. La URL de inicio no funciona para las llamadas de marcación manual. Por defecto está en blanco| +Dispo Call URL|Dispo Call URL| +This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. This URL can NOT be a relative path. Default is blank|Esta web dirección URL no es visto por el agente, sino que es llamado cada vez que una llamada es dispositioned por un agente, si se poblaron. Utiliza las mismas variables que los campos de formulario web y scripts. dispo y talk_time son las variables que puede utilizar para recuperar el agente definido por la disposición de la llamada y el tiempo de conversación real en segundos de la llamada. Esta URL no puede ser una ruta relativa. Por defecto está en blanco| +Xfer-Conf Number Override|Xfer-Conf Número Override| +These five fields allow for you to override the Transfer Conference number presets when the lead is from this list. Default is blank|Estos cinco campos permiten reemplazar la transferencia de presets Conferencia número cuando la iniciativa es de esta lista. Por defecto está en blanco| +These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-ViciDial consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field|Estos cuatro campos permiten que usted tenga dos conjuntos de transferencia de la Conferencia y presets DTMF. Cuando se carga la llamada o de la campaña, la secuencia de comandos vicidial.php mostrará dos botones en el marco de la transferencia de conferencias y rellenará de forma automática el número a marcar y el enviar los campos DTMF cuando se presiona. Si desea permitir Consultivo transferencias, un Fronter a una mayor, que el agente utiliza la casilla de consulta, que no funciona por falta de terceros Vicidial llamadas de consulta. Para aquellos que sólo tienen el agente, haga clic en el dial con el botón del cliente. Entonces, el agente puede dejar-3way-CALL y pasar a la siguiente llamada. Si desea permitir la transferencia ciega de los clientes a una secuencia de comandos AGI Vicidial para el registro o un IVR, a continuación, AXFER lugar en el número a marcar el terreno. También puede especificar una extensión personalizada después de la AXFER, por ejemplo, si usted quiere hacer una llamada a un IVR especiales que se han fijado a la extensión 83900 pondrías AXFER83900 en el número a marcar el terreno| diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/admin.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/admin.php index 51314b84..c8d4c1ad 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/admin.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/admin.php @@ -2047,11 +2047,12 @@ else # 100104-1454 - Fixed in-group/campaign copy duplication issue # 100116-0718 - Added presets to script select list # 100319-1708 - Changed user/pass for users to 20 characters in length, highlighted conf file secret in phones +# 100413-2328 - several small fixes, logging, removal of old SIP/IAX monitor/barge links # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.2.0-235'; -$build = '100319-1708'; +$admin_version = '2.2.0-236'; +$build = '100413-2328'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/welcome_demo.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/welcome_demo.php index 238cf5cf..3175fa64 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/welcome_demo.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/welcome_demo.php @@ -2,7 +2,7 @@ # welcome_demo.php - VICIDIAL welcome Demo page # # -# Copyright (C) 2009 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -78,6 +78,9 @@ echo "  
"; echo "   French Administration"; +echo "
"; +echo "   Brazilian Portuguese Administration"; echo "
\n"; echo "
 
\n"; diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/welcome_languages.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/welcome_languages.php index d53707a9..75b9382e 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/welcome_languages.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/welcome_languages.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -78,6 +78,9 @@ echo "  
"; echo "   French Administration"; +echo "
"; +echo "   Brazilian Portuguese Administration"; echo "
\n"; echo "
 
\n"; diff --git a/agc_2-X/trunk/translations/br_language.txt b/agc_2-X/trunk/translations/br_language.txt index fe900ccd..726ab452 100644 --- a/agc_2-X/trunk/translations/br_language.txt +++ b/agc_2-X/trunk/translations/br_language.txt @@ -101,12 +101,12 @@ You have now logged out. Thank you|Você fez o logoff. Obrigado| astGUIclient web-client VERSION|Versão do cliente web do astGUIClient| astGUIclient web client|astGUIclient web client| VICIDIAL web client|VICIDIAL web client| -VICIDIAL web-client version|VICIDIAL web-client version| -You can only monitor Zap channels|Você so pode monitorar os canais ZAP| -Stop Record|Pare a Gravação| -you are logged into this phone|Você está logado no telefone | +VICIDIAL web-client version|VICIDIAL web-client versão| +You can only monitor Zap channels|Você só pode monitorar os canais ZAP| +Stop Record|Parar Gravação| +you are logged into this phone|você está logado no ramal | Back to Main Window|Voltar a página principal| -LIVE CALLS ON THIS PHONE|CHAMADAS ATIVAS NESTE TELEFONE| +LIVE CALLS ON THIS PHONE|CHAMADAS ATIVAS NESTE RAMAL| LIVE CALLS IN THIS CONFERENCE|CHAMADAS ATIVAS NESTA CONFERÊNCIA| LIVE CALL TRANSFER|TRANSFERIR CHAMADAS ATIVAS| CLIENT CHANNEL|CANAL DO CLIENTE| @@ -126,11 +126,11 @@ Hangup Local|Desligar Local| Hijack Local|Capturar Local| Listen Local|Ouvir Local| Channel to be transferred|Canal a ser transferido| -Extensions Menu|Extensões do Menu| +Extensions Menu|Menu de Extensões| Send to selected extension|Enviar para a extensão selecionada| Send to selected vmail box|Enviar para a caixa postal selecionada| Send to this number|Envie para este número| -click on a number below to send to a conference|Clique no número abaixo para enviar a conferência| +click on a number below to send to a conference|clique no número abaixo para enviar a conferência| Send my channel too|Enviar meu canal para| Conferences Menu|Menu das conferências| LOCAL Extensions Dial|Discar a extensão local| @@ -140,7 +140,7 @@ Call selected vmail box|Ligar para a caixa postal selecionada| LOCAL DIAL EXTENSIONS|DISCAR A EXTENSÃO LOCAL| OUTBOUND CALLS|CHAMADAS SAINTES| INBOUND CALLS|CHAMADAS ENTRANTES| -Refresh rate|Atualizar a taxa| +Refresh rate|Taxa de Atualização| MANUAL DIAL|DISCAGEM MANUAL| CALL DATE\/TIME|DATA/HORA DA CHAMADA| LOCAL HANGUP|DESLIGAR LOCAL| @@ -148,11 +148,12 @@ PARKED CALLS|CHAMADAS EM ESPERA| PARKED BY|EM ESPERA POR| PARKED TIME|TEMPO EM ESPERA| Registered to|Registrado para| -Enter Conference|Entrar na conferência|Dial From Conf +Enter Conference|Entrar na conferência| +Dial From Conf|Discar da confêrencia| Active Extensions|Extensões Ativas| Outside Lines|Linhas externas| Local Extensions|Extensões Locais| -Data Goes Here|Data vai aqui| +Data Goes Here|Os Dados vão aqui| Trunk Action|Atividade do Tronco| Local Action|Atividade Local| Conferences List|Lista das conferências| @@ -167,7 +168,7 @@ is not valid|não é válido| or protocol|ou protocolo| Conf Extension Check|Verificação da Extensão de Conferência| has been registered to|já foi registrado para| -LIVE INBOUND CALL|CHAMADA ENTRANDO| +LIVE INBOUND CALL|CHAMADA ENTRANTE| Number Dialed|Número Discado| SEND TO MY VOICEMAIL|ENVIAR PARA MINHA CAIXA POSTAL| Live Extension Check|Verificação de extensões ativas| @@ -181,8 +182,8 @@ must be set|Deve ser definido| not sent|não enviado| Cannot find empty conference|Não foi possível achar uma conferência vazia| is not live|não está ativo| -RECORDING WILL LAST UP TO 60 MINUTES|AS GRAVAÇÕES VÃO DURAR 60 MINUTOS| -Parked Calls Display|Mostra as ligações em espera| +RECORDING WILL LAST UP TO 60 MINUTES|AS GRAVAÇÕES VÃO DURAR ATÉ 60 MINUTOS| +Parked Calls Display|Mostrar ligações em espera| Database Query Script|Script de consulta ao banco de dados| Group Choice|Escolha do Grupo| has been registered to user|foi registrado para o usuário| @@ -196,12 +197,12 @@ voicemail box|Caixa Postal| Re-Login|Re-Login| User Password|Senha do Usuário| User Login|Login do Usuário| -Phone Login|Login do Telefone| -Phone Password|Senha do Telefone| +Phone Login|Login do Ramal| +Phone Password|Senha do Ramal| Campaign not active, please try again|A campanha não está ativa, por favor tente novamente| Login incorrect, please try again|Usuário incorreto, por favor tente novamente| Campaign Login|Login da Campanha| -Sorry, your phone login and password are not active in this system, please try again|Desculpe seu login de telefone e senha não estão ativos nesta campanha, por favor tente novamente| +Sorry, your phone login and password are not active in this system, please try again|Desculpe seu login de ramal e senha não estão ativos nesta campanha, por favor tente novamente| leads left to call in hopper|Contatos restantes na lista de discagem| CAMPAIGN CUSTOM PARKING|ESPERA CUSTOMIZADA| CAMPAIGN DEFAULT PARKING|ESPERA PADRÃO| @@ -221,13 +222,13 @@ Sorry, there are no leads in the hopper for this campaign|Desculpe, não existem Dial Next Number|Discar proximo número| LIVE CALLS IN YOUR SESSION|LIGAÇÕES ATIVAS NA SUA SESSÃO| Stop Recording|Parar Gravação| -Start Recording|Inicia Gravação| +Start Recording|Iniciar Gravação| Transfer number must have more than 1 digit|O número a ser transferido deve ter mais de 1 digito| Grab Parked Call|Pegar ligãções em espera| Park Call|Colocar em espera| Waiting for Ring|Aguardando Atender| Called 3rd party|Ligou para o terceiro| -LEAVE 3-WAY CALL|ABANDONAR CHAMADA A TRES| +LEAVE 3-WAY CALL|ABANDONAR CHAMADA A TRÊS| Dial With Customer|Discar com o cliente| Park Customer Dial|Colocar chamada do cliente em espera| Hangup Xfer Line|Desligar linha Xfer| @@ -236,7 +237,7 @@ Hangup Customer|Desligar Cliente| Transfer - Conference|Transferir a conferência| LOCAL CLOSER|CLOSER LOCAL| INTERNAL CLOSER|CLOSER INTERNO| -Dial Blind Transfer|Transferência sem acompanhamento| +Dial Blind Transfer|Transferência sem consulta| Dial timed out, contact your system administrator|Tempo de discagem excedido, favor contactar o administrador| No more leads in the hopper for campaign|Não existem mais registros na fila de discagem dessa campanha| Web Form|Web Form| @@ -248,16 +249,16 @@ Wait 50 seconds for the dial to fail out if it is not answered|Aguarda 50 segund STILL A LIVE CALL! Hang it up then you can log out|VOCÊ ESTÁ EM UMA CHAMADA ATIVA! Desligue a chamada e você poderá sair do sistema| Hide conference call channel information|Ocultar informações de discagem do canal| Show conference call channel information|Mostrar informações de discagem do canal| -Logged in as User|Loggado como usuario| -No one is in your session|Não existe ninguem na sua sessão| +Logged in as User|Logado como usuário| +Noone is in your session|Não existe ninguém na sua sessão| Customer has hung up|O cliente desligou| -End-of-call Disposition Selection|Fim da seleção de status| +End-of-call Disposition Selection|Seleção do Motivo de Finalização| CLOSER INBOUND GROUP SELECTION|SELECAO DO GRUPO DE ENTRADA DO CLOSER| Closer Inbound Group Selection|Seleção do grupo de entrada do closer| -BLENDED CALLING|LIGACAO MISTURADA| -outbound activated|ligações externas ativadas| +BLENDED CALLING|LIGAÇÃO MESCLADA| +outbound activated|ligações saintes ativadas| Preview the Lead then|Mostrar o contato, então| -Lead was not reverted, there was an error|O contato não pode ser revertido. Houve um erro.| +Lead was not reverted, there was an error|O contato não pode ser lido. Houve um erro.| call was not placed, there was an error|A ligação não foi efetuada. Houve um erro.| Number to call|Número a ser discado| Customer Information|Informações do cliente| @@ -265,15 +266,15 @@ Lead Dispositioned As|Status da ligação definida como| Any changes made to the customer information below at this time will not be comitted, You must change customer information before you Hangup the call|Qualquer alteração feita nesta página não será salva. Você deve mudar as informações do cliente antes de desligar a ligação| When active, simply press the keyboard key for the desired disposition for this call. The call will then be hungup and dispositioned automatically|Quanto ativo apenas pressione a tecla do teclado referente ao status desejado. A ligação será desligada e salva com o status definido automaticamemente| Disposition Hot Keys|Atalhos para os status| -Cust Time|Tempo de cliente| +Cust Time|Horário do cliente| RECORD ID|ID da gravação| -RECORDING FILE|GRAVANDO ARQUIVO| +RECORDING FILE|ARQUIVO DE GRAVAÇÃO| HOT KEYS ACTIVE|ATALHOS DE STATUS ATIVOS| HOT KEYS INACTIVE|ATALHOS DE STATUS INATIVOS| DIAL OVERRIDE|DISCAGEM SOBREPOSTA| -SKIP LEAD|IGNORAR CONTATO| -DIAL LEAD|DISCAR CONTATO| -LEAD PREVIEW|VISUALIZAR CONTATO| +SKIP LEAD|PULAR REGISTRO| +DIAL LEAD|DISCAR REGISTRO| +LEAD PREVIEW|VISUALIZAR REGISTRO| PAUSE AGENT DIALING|PAUSAR DISCAGEM DO AGENTE| DISPOSITION CALL|SELEÇÃO DE STATUS| session ID|ID da sessão| @@ -300,7 +301,7 @@ Note: a dial prefix of|Nota: prefixo de discagem de| Hangup Again|Desligue novamente| Go Back|Voltar| Call Agent Again|Ligar novamente para o agente| -MY CALLBACK ONLY|ESTE AGENDAMENTO SO APARECE PARA MIM| +MY CALLBACK ONLY|SOMENTE MEUS AGENDAMENTOS| ACTIVE CALLBACKS|AGENDAMENTOS ATIVOS| CALLBACKS FOR AGENT|AGENDAMENTOS POR AGENTE| Dial Code:|Codigo de Área:| @@ -311,7 +312,7 @@ CB Comments|Comentarios do CB| Title|Título| STATUS| STATUS| RESET| REINICIAR| -CLEAR FORM|LIMPAR FORMULARIO| +CLEAR FORM|LIMPAR FORMULÁRIO| SUBMIT|ENVIAR| Incoming|Entrante| Calling|Ligando| @@ -330,14 +331,14 @@ BUILD|CONFIGURAÇÃO| Server|Servidor| RECORD |REGISTRO | >HANGUP|>DESLIGAR| ->XFER|>TRANFERENCIA| +>XFER|>TRANFERÊNCIA| PARK|ESPERA| -IN-NUMBER|NUMERO ENTRANTE| -NUMBER|NUMERO| +IN-NUMBER|NÚMERO ENTRANTE| +NUMBER|NÚMERO| CALLERID|CALLERID| CALL| CHAMADA| PICKUP|CAPTURAR| -CONFERENCE|CONFERENCIA| +CONFERENCE|CONFERÊNCIA| Refresh|Atualizar| Send DTMF|Enviar DTMF| BORDER|BORDA| @@ -346,8 +347,8 @@ ORDER|ORDEM| >LOGOUT|>SAIR| Channel| Canal| Extensions|Extensões| -Conferences|Conferencias| -Conference|Conferencia| +Conferences|Conferências| +Conference|Conferência| Recording|Gravando| Record|Gravar| Welcome|Bem vindo| @@ -362,46 +363,46 @@ Initializing|Inicializando| Invalid|Inválido| Username|Usuário| Notes|Notas| -First|Primeiro| -MI: |MI:| -Last|Ultimo| +First|Nome| +MI: |Inicial:| +Last|Sobrenome| Address|Endereço| City|Cidade| State|Estado| PostCode|CEP| Province|Bairro| Vendor ID|Vendedor| -DialCode|Codigo de Area| +DialCode|Codigo de Área| Alt. Phone|Telefone Alternativo| Show|Mostrar| Email|Email| Comments|Comentários| REFRESH|ATUALIZAR| -ALT PHONE DIAL|DISCAR TELEFONE ALT| -MAIN PHONE|TELEFONE PRINCIPAL| -ALT PHONE|TELEFONE ALTERNATIVO| +ALT PHONE DIAL|DISCAR FONE ALT| +MAIN PHONE|FONE PRINC| +ALT PHONE|FONE ALT| ADDRESS3|ENDERECO3| FINISH LEAD|FINALIZAR CONTATO| Dial Alt Phone Number|Discar telefone alternativo| Phone|Telefone| DIAL| DISCAR| -SUBMIT FAVORITES CHANGES - requires logout|PARA ENVIAR MODIFICACOES FAVORITAS E NECESSARIO FAZER O LOGOUT| +SUBMIT FAVORITES CHANGES - requires logout|ENVIAR ALTERAÇÕES FAVORITAS - requer logout| BACK TO MAIN WINDOW - ignore changes made|VOLTAR A TELA PRINCIPAL - as alterações serão ignoradas| -AVAILABLE EXTENSIONS|EXTENSOES DISPONIVEIS| +AVAILABLE EXTENSIONS|EXTENSÕES DISPONÍVEIS| edit|editar| FAVORITES|FAVORITOS| ### END translation phrases through 1.1.11 release ### -Search Existing Leads|Ligações Existentes Da Busca| -This option if checked will attempt to find the phone number in the system before inserting it as a new lead|Esta opção se verificado tentará encontrar o número de telefone no sistema antes de introduzi-lo como uma ligação nova| -Finish Wrapup and Move On|Revestimento Wrapup e movimento sobre| -seconds remaining in wrapup|segundos restantes no wrapup| -Call Wrapup:|Chamada Wrapup:| +Search Existing Leads|Pesquisar Registros Existentes| +This option if checked will attempt to find the phone number in the system before inserting it as a new lead|Esta opção caso esteja marcada irá tentar encontrar o número do fone no sistema antes de inserir um novo registro| +Finish Wrapup and Move On|Finalizar pós-atendimento e seguir| +seconds remaining in wrapup|segundos restantes de pós-atendimento| +Call Wrapup:|Chamada pós-atd:| ### months of the year for CallBack date select screen ### January|Janeiro| Frebruary|Fevereiro| March|Março| April|Abril| -May|Pode| +May|Maio| June|Junho| July|Julho| August|Agosto| @@ -410,64 +411,64 @@ October|Outubro| November|Novembro| December|Dezembro| ### BEGIN translation phrases for 2.0.1 release ### -Previous Callback Information|Informação Precedente Da Rechamada| +Previous Callback Information|Informação de Agendamento Anterior| Last Call: |Última Chamada:| -CallBack: |Rechamada:| +CallBack: |Agendamento:| Agent: |Agente:| Comments: |Comentários:| ### BEGIN translation phrases for 2.0.2 release ### VOLUME|VOLUME| ### BEGIN translation phrases for 2.0.3 release ### -FAST DIAL|SELETOR RÁPIDO| -YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|VOCÊ DEVE DAR ENTRADA A um NÚMERO De TELEFONE E A um CÓDIGO DoSELETOR PARA USAR O SELETOR RÁPIDO| - SELECT A PAUSE CODE :| SELECIONE Um CÓDIGO Da PAUSA :| -ENTER A PAUSE CODE|DÊ ENTRADA A um CÓDIGO Da PAUSA| -YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-DIAL MODE|VOCÊ DEVE SER PAUSADO PARA DAR ENTRADA A um CÓDIGO Da PAUSA NaMODALIDADE De AUTO-DIAL| -Your session has been disabled|Sua sessão foi incapacitada| +FAST DIAL|DISCAGEM RÁPIDA| +YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|VOCÊ DEVE ENTRAR UM NÚMERO E O CÓDIGO DE ÁREA PARA USAR A DISCAGEM RÁPIDA| + SELECT A PAUSE CODE :| SELECIONE UM CÓDIGO DE PAUSA :| +ENTER A PAUSE CODE|DIGITE UM CÓDIGO DE PAUSA| +YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-DIAL MODE|VOCÊ DEVE ESTAR EM PAUSA PARA ENTRAR UM CÓDIGO DE PAUSA NO MODO AUTOMÁTICO| +Your session has been disabled|Sua sessão foi finalizada| ### BEGIN translation phrases for 2.0.5 release ### Gender: |Sexo:| Date of Birth: |Data de Nascimento:| -YOU MUST BE PAUSED TO CHANGE GROUPS|Você deve estar PAUSED PARA ALTERAR GRUPOS| -Calls in Queue:|Solicita, em fila:| - Timeclock|Timeclock| -The user and password you entered are not active in the system|O usuário ea senha que você digitou não são ativos no sistema| +YOU MUST BE PAUSED TO CHANGE GROUPS|VOCÊ DEVE ESTAR EM PAUSA PARA ALTERAR OS GRUPOS| +Calls in Queue:|Chamadas na fila:| + Timeclock| Relogio ponto| +The user and password you entered are not active in the system|O usuário e a senha que você digitou não estão ativos no sistema| Please try again|Por favor, tente novamente| -You cannot log in or out within 30 seconds of your last login or logout|Você não pode efetuar login ou para fora dentro de 30 segundos do seu último login ou logout| -You have now logged-out|Você tem agora autenticado-out| +You cannot log in or out within 30 seconds of your last login or logout|Você não pode entrar ou sair dentro de 30 segundos do seu último login ou logout| +You have now logged-out|Você efetuou logout| You logged out at |Você saiu em| -Amount of time you were logged-in: |Quantidade de tempo que foram registradas em:| -ERROR: timeclock log entry already made: |ERRO: timeclock entrada do log já realizados:| -BACK to Agent Login Screen|BACK TO Agent Login Screen| -BACK to Administration|Retornar para Administração| -BACK to Welcome Screen|ANTERIOR a tela Bem-vindo| -Time since you were last logged-in: |Vez desde que foi registrado em:| -You last logged-out at: |Você última autenticado-out em:| -Click LOGIN below to log-in|LOGIN Clique abaixo para log-in| -Amount of time you have been logged-in: |Quantidade de tempo que tem sido registrado em:| -You logged-in at:|Você autenticado-nos em:| -Click LOGOUT below to log-out|LOGOUT Clique abaixo para log-out| -Undefined|Undefined| -This phone number is not in the campaign lists|Esse número de telefone não está na campanha listas| -Unspecified error|Unspecified error| -Extended Alt Phone Information: |Extensão Alt Telefone Informação:| -ALT DIAL NUMBER:|ALT PROGR.SELEC NÚMERO:| -Phone Code and Number:|Telefone Código e Número:| +Amount of time you were logged-in: |Quantidade de tempo que ficou logado:| +ERROR: timeclock log entry already made: |ERRO: relogio ponto já registrado:| +BACK to Agent Login Screen|VOLTAR para tela de login do Agente| +BACK to Administration|VOLTAR para Administração| +BACK to Welcome Screen|VOLTAR para Tela Inicial| +Time since you were last logged-in: |Tempo desde o último login:| +You last logged-out at: |Você saiu pela última vez em:| +Click LOGIN below to log-in|Clique LOGIN abaixo para entrar| +Amount of time you have been logged-in: |Tempo total desde que entrou no sistema:| +You logged-in at:|Você entrou em:| +Click LOGOUT below to log-out|Clique LOGOUT abaixo para sair| +Undefined|Indefinido| +This phone number is not in the campaign lists|Esse número de telefone não está na lista da campanha| +Unspecified error|Erro não especificado| +Extended Alt Phone Information: |Informações Complementares do Fone Alt.:| +ALT DIAL NUMBER:|NÚMERO DE DISC. ALT.:| +Phone Code and Number:|Código de área e número:| Notes: |Notas:| Active: |Ativa:| -Alt Count: |Alt Count:| -Change this phone number to INACTIVE|Altere este número de telefone para INATIVO| -Change this phone number to ACTIVE|Altere este número de telefone para ACTIVAS| -YOU MUST LOG IN TO THE TIMECLOCK FIRST|É necessário efetuar login AO PRIMEIRO TIMECLOCK| -There is a time synchronization problem with your system, please tell your system administrator|Há um tempo sincronização problema com o seu sistema, por favor informe o seu administrador de sistema| -Preview Call|Preview Call| -SELECT A GROUP ALIAS|Selecionar um grupo ALIÁS| -Group Alias Selection|Grupo Alias Selecção| -Click Here to Choose a Group Alias|Clique aqui para escolher um grupo Alias| -Group Alias|Grupo Alias| -ERROR: There are no Shifts enabled for your user group|ERRO: Não existem Shifts activado para o Grupo de Usuários| -ERROR: You are not allowed to log in outside of your shift|ERRO: Você não tem permissão para iniciar sessão no para fora do seu turno| -MANAGER OVERRIDE|GERENTE Override| -Your Shift is over or has changed, you have been logged out of your session|Seu Shift é mais ou mudou, você foi desconectado da sua sessão| +Alt Count: |Contagem de Alt:| +Change this phone number to INACTIVE|Alterar número de telefone para INATIVO| +Change this phone number to ACTIVE|Alterar número de telefone para ATIVO| +YOU MUST LOG IN TO THE TIMECLOCK FIRST|É necessário efetuar login no Relógio Ponto primeiro| +There is a time synchronization problem with your system, please tell your system administrator|Há um problema de sincronização no seu sistema, por favor informe o seu administrador de sistemas| +Preview Call|Chamada Preview| +SELECT A GROUP ALIAS|SELEC. UM APELIDO DE GRUPO| +Group Alias Selection|Seleção de Apelido de Grupo| +Click Here to Choose a Group Alias|Clique aqui para escolher um apelido de grupo| +Group Alias|Apelido de Grupo| +ERROR: There are no Shifts enabled for your user group|ERRO: Não existem turnos ativos para seu Grupo de Usuários| +ERROR: You are not allowed to log in outside of your shift|ERRO: Você não tem permissão para iniciar sessão fora do seu turno| +MANAGER OVERRIDE|SOBREPOR GERENTE| +Your Shift is over or has changed, you have been logged out of your session|Seu turno acabou ou foi alterado, você foi desconectado da sua sessão| ### START translations for 2.2.0 release ### You are not allowed to dial into other agent sessions|Você não tem permissão para discar para sessões de outro agente| QUICK TRANSFER|RÁPIDA TRANSFERÊNCIA| diff --git a/agc_2-X/trunk/translations/br_language_admin.txt b/agc_2-X/trunk/translations/br_language_admin.txt new file mode 100644 index 00000000..0eb178f6 --- /dev/null +++ b/agc_2-X/trunk/translations/br_language_admin.txt @@ -0,0 +1,2490 @@ +# br_language_admin.txt - this file is for the internationalization of the astGUIclient +# admin web pages. The associated install.pl file will take the language as an +# argument and alter the php scripts to the language typed in the command line: +# example: ./install.pl --language=es +# current languages in the file: +# - English - (en) no alterations +# - Brazilian Portuguese - (br) first column +***LANGUAGES*** +en-English|br-Brazilian| +***FILES*** +vicidial|admin.php|0 +vicidial|dbconnect.php|1 +vicidial|AST_VICIDIAL_hopperlist.php|0 +vicidial|AST_agent_time_sheet.php|0 +vicidial|user_status.php|0 +vicidial|server_stats.php|0 +vicidial|AST_VDADstats.php|0 +vicidial|AST_timeonVDAD.php|0 +vicidial|AST_timeonVDAD_closer.php|0 +vicidial|AST_timeonVDADall.php|0 +vicidial|AST_timeoncall.php|0 +vicidial|AST_timeonpark.php|0 +vicidial|listloader.php|0 +vicidial|listloaderMAIN.php|0 +vicidial|new_listloader_superL.php|0 +vicidial|count.htm|1 +vicidial|help.gif|1 +vicidial|listloader.pl|1 +vicidial|listloader_rowdisplay.pl|1 +vicidial|listloader_super.pl|1 +vicidial|user_stats.php|0 +vicidial|remote_dispo.php|0 +vicidial|group_hourly_stats.php|0 +vicidial|admin_search_lead.php|0 +vicidial|admin_modify_lead.php|0 +vicidial|AST_CLOSERstats.php|0 +vicidial|vdremote.php|0 +vicidial|AST_agent_performance_detail.php|0 +vicidial|AST_agent_performance.php|0 +vicidial|AST_server_performance.php|0 +vicidial|AST_admin_log_display.php|0 +vicidial|AST_timeonVDADallSUMMARY.php|0 +vicidial|inbound_popup.php|0 +vicidial|AST_inboundEXTstats.php|0 +vicidial|welcome.php|0 +vicidial|admin_header.php|0 +vicidial|vicidial_sales_viewer.php|0 +vicidial|user_group_bulk_change.php|0 +vicidial|AST_agent_status_detail.php|0 +vicidial|AST_agent_days_detail.php|0 +vicidial|AST_CLOSER_service_level.php|0 +vicidial|AST_IVRfilter.php|0 +vicidial|AST_IVRstats.php|0 +vicidial|call_report_export.php|0 +vicidial|fcstats.php|0 +vicidial|list_download.php|0 +vicidial|non_agent_api.php|1 +vicidial|timeclock_edit.php|0 +vicidial|timeclock_report.php|0 +vicidial|timeclock_status.php|0 +vicidial|vtiger_search.php|1 +vicidial|vtiger_user.php|1 +vicidial|welcome_demo.php|1 +vicidial|welcome_languages.php|1 +vicidial|vicidial_admin_web_logo.gif|1 +vicidial|vicidial_admin_web_logo_small.gif|1 +vicidial|user_territories.php|1 +vicidial|audio_store.php|1 +vicidial|AST_agent_time_detail.php|1 +vicidial|AST_agent_timeclock_detail.php|1 +vicidial|AST_OUTBOUNDsummary_interval.php|1 +vicidial|call_report_export.php|1 +vicidial|AST_CLOSERsummary_hourly.php|1 +vicidial|functions.php|1 +***TRANSLATIONS***|||| +### special translations that should stay at the top of the file ### +BORDER|Border| +VALUE=SUBMIT|VALUE=SUBMIT| +TYPE=SUBMIT|TYPE=Submit| +\.\/images\/|../agc/images/| +help.gif|help.gif| +### BEGIN translation phrases through 1.1.11 release ### +English|Ingles| +Spanish|Espanol| +French|Frances| +German|Aleman| +Italian|Italiano| +You have now logged out. Thank you|Voce efetuou logout. Obrigado| +Invalid Username\/Password|Nome ou Senha inválidos| +ASTERISK ADMIN: Administration|ASTERISK ADMIN: Administração| +PHONES TABLE|TABELA DE RAMAIS| +Phone extension -<\/B> This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP\/test101 the Phone extension would be test101. Also, for IAX2 phones make sure you use the full phones name: IAX2\/IAXphone1@IAXphone1 would be IAXphone1@IAXphone1. For Zap phones make sure you put the full channel: Zap\/25-1 would be 25-1. Another note, make sure you set the Protocol below correctly for your type of phone.|Número do Ramal - Este campo é onde você coloca o número do ramal conforme aparece no Asterisk sem incluir o protocolo ou a barra no começo. Por exemplo: para o ramal SIP\/test101 o número do ramal seria test101. Também, para os ramais IAX2 tenha certeza de usar o nome completo: IAX2/IAXphone1@IAXphone1 seria IAXphone1@IAXphone1. Para Zap tenha certeza que você usa o canal completo: Zap/25-1 seria 25-1. Outro aviso, tenha certeza que você configura o protocolo abaixo corretamente para seu tipo de telefone.| +Dial Plan Number -<\/B> This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server|Numero do plano de discagem - Este campo é para o número que você disca para tocar o ramal. Esse número é definido no arquivo extensions.conf do seu servidor Asterisk| +Voicemail Box -<\/B> This field is for the voicemail box that the messages go to for the user of this phone. We use this to check for voicemail messages and for the user to be able to use the VOICEMAIL button on astGUIclient app|Caixa Postal - Este campo é para a caixa postal de voz para onde vao as menssagens para o usuário deste ramal. Utilizamos isto para verificar as mensagens e para o usuário utilizar o botão VOICEMAIL no aplicativo astGUIclient| +Outbound CallerID -<\/B> This field is where you would enter the callerID number that you would like to appear on outbound calls placed form the astguiclient web-client. This does not work on RBS, non-PRI, T1\/E1s|Identificador de Saída - Este campo é onde deve ser colocado o número que você quer que saia no identificador para as ligações de saída feitas pelo astguiclient. Isto não funciona em linhas RTB(non-PRI) T1/E1| +Phone IP address -<\/B> This field is for the phone's IP address if it is a VOIP phone. This is an optional field|Endereço IP do ramal - Este campo é para o endereço IP do ramal se for um ramal VOIP. Este campo é opcional| +Computer IP address -<\/B> This field is for the user's computer IP address. This is an optional field|Endereço IP do computador - Este campo é para o endereço IP do computador do usuário. Este campo é opcional| +Server IP -<\/B> This menu is where you select which server the phone is active on|IP do Servidor - Este menu é onde você escolhe em qual servidor está o ramal ativo| +Login -<\/B> The login used for the phone user to get to admin functions|Login - O login usado para o usuário do ramal conseguir permissões de admin| +Password -<\/B> The password used for the phone user to get to admin functions|Senha - A senha usada para o usuário do ramal conseguir permissões de admin| +Status -<\/B> The status of the phone in the system, ACTIVE and ADMIN allow for GUI clients to work. ADMIN allows access to this administrative web site. All other statuses do not allow GUI or Admin web access|Status - O status do ramal no sistema, ATIVO e ADMIN permiten que os clientes GUI trabalhem. ADMIN permite o acceso ao Website de administração. Os outros status não permitem o acceso ao GUI ou ao Website de Admin| +Active Account -<\/B> Whether the phone is active to put it in the list in the GUI client|Conta ativa - Se o ramal está ativado será incluído na lista do cliente GUI| +Phone Type -<\/B> Purely for administrative notes|Tipo de Ramal - Somente para informação administrativa| +Full Name -<\/B> Used by the GUIclient in the list of active phones|Nome Completo - Usado pelo GUIclient na lista de ramais ativos| +Company -<\/B> Purely for administrative notes|Empresa - Somente para informação administrativa| +Picture -<\/B> Not yet Implemented|Foto - Ainda não implementado| +New Messages -<\/B> Number of new voicemail messages for this phone on the Asterisk server|Novas Mensagens - Número de mensagens novas na conta de correio de voz para esse ramal no servidor Asterisk| +Old Messages -<\/B> Number of old voicemail messages for this phone on the Asterisk server|Mensagens Antigas - |Número de mensagens antigas na conta de correio de voz para esse ramal no servidor Asterisk +Client Protocol -<\/B> The protocol that the phone uses to connect to the Asterisk server: SIP, IAX2, Zap . Also, there is EXTERNAL for remote dial numbers or speed dial numbers that you want to list as phones|Protocolo Client - O protocolo que o ramal utiliza para se conectar com o servidor Asterisk: SIP, IAX2, Zap. Também, para os números Externos ou número de discagem rápida que você deseja listar como ramais| +Local GMT -<\/B> The difference from Greenwich Mean time, or ZULU time where the phone is located. DO NOT ADJUST FOR DAYLIGHT SAVINGS TIME. This is used by the VICIDIAL campaign to accurately display the time and customer time|GMT Local - A diferença a partir do horário de Greenwich, ou Horário ZULU para o local onde o ramal está localizado. NÃO AJUSTE PARA O HORÁRIO DE VERÃO. É usado pela campanha do VICIDIAL para demonstrar corretamente o horário local e o horário do cliente.| +Manager Login -<\/B> This is the login that the GUI clients for this phone will use to access the Database where the server data resides|Login de Gerenciamento- Este é o login que o client GUI para esse ramal usará para acessar o Banco de Dados onde os dados do servidor residem | +Manager Secret -<\/B> This is the password that the GUI clients for this phone will use to access the Database where the server data resides|Senha de Gerenciamento - Esta é a senha que o client GUI para esse ramal usará para acessar o Banco de Dados onde os dados do servidor residem| +VICIDIAL Default User -<\/B> This is to place a default value in the VICIDIAL user field whenever this phone user opens the astVICIDIAL client app. Leave blank for no user|Usuário padrão do VICIDIAL - O valor desse campo será colocado no campo de usuário quando esse ramal entrar no aplicativo astVICIDIAL | +VICIDIAL Default Pass -<\/B> This is to place a default value in the VICIDIAL password field whenever this phone user opens the astVICIDIAL client app. Leave blank for no pass|Senha padrão VICIDIAL - Este valor de senha será preenchido no campo da senha do usuário quando esse ramal entrar no aplicativo astVICIDIAL | +VICIDIAL Default Campaign -<\/B> This is to place a default value in the VICIDIAL campaign field whenever this phone user opens the astVICIDIAL client app. Leave blank for no campaign|Campanha padrão do VICIDIAL - Este campo deve ser preenchido com o valor padrão para o campo da campanha quando este ramal abrir o aplicativo astVICIDIAL. Deixe em branco para nenhuma campanha| +Park Exten -<\/B> This is the default Parking extension for the client apps. Verify that a different one works before you change this|Park Exten - Esta é a extensão de estacionamento padrao para o aplicativo client. Verifique se a extensão funciona antes de alterar.| +Conf Exten -<\/B> This is the default Conference park extension for the client apps. Verify that a different one works before you change this|Conf Exten - Esta é a extensão padrao para estacionamento da conferência para o aplicativo client. Verifique se a extensão funciona antes de alterar| +VICIDIAL Park Exten -<\/B> This is the default Parking extension for VICIDIAL client app. Verify that a different one works before you change this|VICIDIAL Park Exten - Esta é a extensão de estacionamento para o aplicativo client VICIDIAL. Verifique se a extensão funciona antes de alterar| +VICIDIAL Park File -<\/B> This is the default VICIDIAL park extension file name for the client apps. Verify that a different one works before you change this. limited to 10 characters|Arquivo do VICIDIAL Park - Este é o nome do arquivo padrao para a extensão de estacionamento do VICIDIAL usado pelo aplicativo cliente. Verifique se um arquivo diferente funciona antes de alterar. Limitado a 10 caracteres| +Monitor Prefix -<\/B> This is the dial plan prefix for monitoring of Zap channels automatically within the astGUIclient app. Only change according to the extensions.conf ZapBarge extensions records|Prefixo do monitor - Este é o prefixo do plano de discagem para monitorar canais automaticamente dentro do aplicativo astGUIclient. Só altere de acordo com os registros de ZapBarge do arquivo extensions.conf| +Recording Exten -<\/B> This is the dial plan extension for the recording extension that is used to drop into meetme conferences to record them. It usually lasts upto one hour if not stopped. verify with extensions.conf file before changing|Exten de Gravação - Esta é a extensão do plano de discagem que irá entrar na sala de conferências e gravar a conversa. Normalmente dura por volta de uma hora se nao for cancelada. Verifique no arquivo extensions.conf antes de alterar| +VMAIL Main Exten -<\/B> This is the dial plan extension going to check your voicemail. verify with extensions.conf file before changing|Exten principal de VMAIL- Esta é a extensão do plano de discagem que acessa o voicemail. Verifique o arquivo extensions.conf antes de alterar| +VMAIL Dump Exten -<\/B> This is the dial plan prefix used to send calls directly to a user's voicemail from a live call in the astGUIclient app. verify with extensions.conf file before changing|Descarga Exten de VMAIL - Esta é a extensão do plano de discagem usada para deixar mensagens no correio de voz| +Exten Context -<\/B> This is the dial plan context that this phone primarily uses. It is assumed that all numbers dialed by the client apps are using this context so it is a good idea to make sure this is the most wide context possible. verify with extensions.conf file before changing|Contexto do Exten - Este é o contexto do plano de discagem usado pelo ramal. Será assumido que todos os numeros discados por esse ramal estão usando esse contexto, portanto é uma boa ideia que esse contexto é o mais amplo possível. Verifique o arquivo extensions.conf antes de alterar| +DTMF send Channel -<\/B> This is the channel string used to send DTMF sounds into meetme conferences from the client apps. Verify the exten and context with the extensions.conf file|Canal de envio de DTMF - Este é canal usado para enviar tons DTMF nas conferencias meetme do aplicativo client. Verifique a exten e o contexto no arquivo extensions.conf| +Outbound Call Group -<\/B> This is the channel group that outbound calls from this phone are placed out of. There are a couple routines in the client apps that use this. For Zap channels you want to use something like Zap\/g2 , for IAX2 trunks you would want to use the full IAX prefix like IAX2\/VICItest1:secret@10.10.10.15:4569. Verify the trunks with the extensions.conf file, it is usually what you have defined as the TRUNK global variable at the top of the file|Grupo de Saída - Este é o grupo de canais em que as chamadas saintes são feitas. Existem algumas rotinas no aplicativo cliente que usam isso. Para canais Zap você deve fazer algo como Zap/g2, para trunks IAX2 voce deve usar o prefixo completo como: IAX2/VICItest1:secret@10.10.10.15:4569. Verifique os trunks no arquivo extensions.conf, normalmente é o que voce definiu na variavel global TRUNK no inicio do arquivo| +Browser Location -<\/B> This is applicable to only UNIX\/LINUX clients, the absolute path to Mozilla or Firefox browser on the machine. verify this by launching it manually|Local do Browser - Isto se aplica apenas a clientes UNIX/LINUX, é o caminho absoluto para os browsers Mozilla ou Firefox na maquina. Verifique isso executando-o manualmente| +Install Directory -<\/B> This is the place where the astGUIclient and astVICIDIAL scripts are located on your machine. For Win32 it should be something like C:\\AST_VICI and for UNIX it should be something like \/usr\/local\/perl_TK. verify this manually|Diretório de Instalação - Este é o local onde os scripts do astGUIclient e astVICIDIAL estão localizados na sua maquina. Para Win32 deve ser algo como: C:\\AST_VICI e para UNIX deve ser algo como /usr/local/perl_TK. Verifique isso manualmente| +CallerID URL -<\/B> This is the web address of the page used to do custom callerID lookups. default testing address is: http:\/\/astguiclient.sf.net\/test_callerid_output.php|URL do Identificador - | Este é o endereço da pagina que é usada para customizar pesquisas do identificador de chamadas. O endereço default para teste é: http://astguiclient.sf.net/test_callerid_output.php| +VICIDIAL Default URL -<\/B> This is the web address of the page used to do custom VICIDIAL Web Form queries. default testing address is: http:\/\/astguiclient.sf.net\/test_VICIDIAL_output.php|URL default do VICIDIAL - Este é o endereço da página usada para customizar pesquisas do VICIDIAL. O endereço padrão de testes é: htpp://astguiclient.sf.net/test_VICIDIAL_output.php| +Call Logging -<\/B> This is set to true if the call_log.agi file is in place in the extensions.conf file for all outbound and hang up 'h' extensions to log all calls. This should always be 1 because it is manditory for many astGUIclient and VICIDIAL features to work properly|Registro de chamada - Esta configuração terá valor true se o arquivo call_log.agi estiver no arquivo extensions.conf para todas as extensões de saida e de desligamento (hangup). Isso deve sempre estar true pois é obrigado para que muitas funcionalidades do astGUIclient e do VICIDIAL funcionem corretamente| +User Switching -<\/B> Set to true to allow user to switch to another user account. NOTE: If user switches they can initiate recording on the new user's phone conversation|Conmutación del usuario - fije para verdad para permitir que el usuario cambie a otra cuenta del usuario. NOTA: Si los interruptores del usuario ellos pueden iniciar la grabación en la conversación de teléfono del nuevo usuario| +Conferencing -<\/B> Set to true to allow user to start conference calls with upto six external lines|Conferencias - Configurado como true, permite o usuário iniciar conferências de até seis telefones externos| +Admin Hang Up -<\/B> Set to true to allow user to be able to hang up any line at will through astGUIclient. Good idea only to enable this for Admin users|Hangup do Admin - Configurado como true permite que o usuário desligue qualquer linha através do astGUIclient. Uma boa ideia é somente permitir isso para usuários Admin| +Admin Hijack -<\/B> Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers|Sequestro do Admin - Configure como true para permitir que o usuário consiga pegar qualquer linha e transferir para seu ramal através do astGUIclient. Uma boa ideia é permitir somente para o usuário Admin. Mas é muito útil para gerentes| +Admin Monitor -<\/B> Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers and as a training tool|Monitoramento Admin - Configure como true para permitir que o usuário consiga pegar qualquer linha e transferir para seu ramal através do astGUIclient. Uma boa ideia é permitir somente para o usuário Admin. Mas é muito útil para gerentes| +Call Park -<\/B> Set to true to allow user to be able to park calls on astGUIclient hold to be picked up by any other astGUIclient user on the system. Calls stay on hold for upto a half hour then hang up. Usually enabled for all|Estacionamento de chamadas - Se configurado como true permite o usuário estacionar as chamadas pelo astGUIclient para que sejam capturadas por outros usuários do sistema. Chamadas ficam estacionadas por até meia hora e depois são desligadas. Normalmente é habilitado para todos| +Updater Check -<\/B> Set to true to display a popup warning that the updater time has not changed in 20 seconds. Useful for Admin users|Verif. de Updater - Se configurado como true, mostra um aviso em popup que o tempo do atualizador nao mudou em 20 segundos. Útil para usuários Admin| +AF Logging -<\/B> Set to true to log many actions of astGUIclient usage to a text file on the user's computer|Registro AF - Se configurado como true, grava várias ações do uso do astGUIclient para um arquivo texto no computador do usuário| +Queue Enabled -<\/B> Set to true to have client apps use the Asterisk Central Queue system. Required for VICIDIAL and recommended for all users|Habilitar Fila - Configure como true para que os aplicativos cliente usem o controle central de Filas do Asterisk. Requerido e recomendado para todos os usuários| +CallerID Popup -<\/B> Set to true to allow for numbers defined in the extensions.conf file to send CallerID popup screens to astGUIclient users|CallerID Popup - Configurado como true permite que números configurados no arquivo extensions.conf enviem telas popup de Identificação (CallerID) para os usuários| +VMail Button -<\/B> Set to true to display the VOICEMAIL button and the messages count display on astGUIclient|Botão do VMail - Configurado como true irá mostrar o botao do VOICEMAIL (correio de voz) e o contador de mensagens no astGUIclient| +Fast Refresh -<\/B> Set to true to enable a new rate of refresh of call information for the astGUIclient. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number|Atualização Rápida - Configure como true para habilitar uma nova velocidade de atualização das informações sobre a chamada no astGUIclient. A velocidade padrão quando desabilitado é de 1000ms ou 1 segundo. Pode aumentar a carga no sistema se esse tempo for reduzido| +Fast Refresh Rate -<\/B> in milliseconds. Only used if Fast Refresh is enabled. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number|Tempo de Atualização Rápida - em milisegundos. Só é usado se a opção "Atualização Rápida" estiver habilitada. O valor padrão desabilitado é 1000ms, 1 segundo. Pode aumentar a carga do sistema se esse valor for reduzido| +Persistant MySQL -<\/B> If enabled the astGUIclient connection will remain connected instead of connecting every second. Useful if you have a fast refresh rate set. It will increase the number of connections on your MySQL machine|MySQL Permanente- Se estiver habilitada, a conexão do astGUIclient permanecerá ativa ao invés de conectar a cada segundo. Útil se você tiver um tempo de atualização curto. Pode aumentar a quantidade de conexões no servidor MySQL| +Auto Dial Next Number -<\/B> If enabled the VICIDIAL client will dial the next number on the list automatically upon disposition of a call unless they selected to "Stop Dialing" on the disposition screen|Discar próximo número automaticamente- Se habilitado o aplicativo client do VICIDIAL irá discar o próximo número automaticamente no desligamento de uma chamada, a não ser que o usuário selecione "Parar Discagem" na tela de finalização da chamada| +Stop Rec after each call -<\/B> If enabled the VICIDIAL client will stop whatever recording is going on after each call has been dispositioned. Useful if you are doing a lot of recording or you are using a web form to trigger recording|Parar gravação após cada chamada- Se habilitado o client do VICIDIAL irá parar de gravar após o final de cada chamada. Útil se você está fazendo muitas gravações ou se está usando o formulário web para acionar a gravação| +DBX Server -<\/B> The MySQL database server that this user should be connecting to|Servidor DBX - O servidor de banco de dados que este usuário deve se conectar| +DBX Database -<\/B> The MySQL database that this user should be connecting to. Default is asterisk|Base de dados DBX - A base de dados MySQL que o usuário deve se conectar. Padrão é asterisk| +DBX User -<\/B> The MySQL user login that this user should be using when connecting. Default is cron|Usuário do DBX - O login de usuário do MySQL que esse usuário deve usar para conectar. Default é cron| +DBX Pass -<\/B> The MySQL user password that this user should be using when connecting. Default is 1234|Senha do DBX - Senha do usuário de conexão do MySQL. Padrão é 1234| +DBX Port -<\/B> The MySQL TCP port that this user should be using when connecting. Default is 3306|Porta DBX - A porta TCP de conexão com o MySQL que o usuário deve usar para conectar. Padrão é 3306| +DBY Server -<\/B> The MySQL database server that this user should be connecting to|Servidor DBY - O servidor de banco de dados que este usuário deve se conectar| +DBY Database -<\/B> The MySQL database that this user should be connecting to. Default is asterisk|Base de dados DBY - A base de dados MySQL que o usuário deve se conectar. Padrão é asterisk| +DBY User -<\/B> The MySQL user login that this user should be using when connecting. Default is cron|Usuário do DBY - O login de usuário do MySQL que esse usuário deve usar para conectar. Default é cron| +DBY Pass -<\/B> The MySQL user password that this user should be using when connecting. Default is 1234|Senha do DBY - Senha do usuário de conexão do MySQL. Padrao é 1234| +DBY Port -<\/B> The MySQL TCP port that this user should be using when connecting. Default is 3306|Porta DBY - A porta TCP de conexão com o MySQL que o usuário deve usar para conectar. Padrao é 3306| +Redirect command sent for channel|Comando de redirecionar enviado ao canal| +Look up this customer in Customer Service System|Procurar esse cliente no sistema de Serviço ao Consumidor| +Redirect command FAILED for channel|Redirecionar o comando FALHA para o canal| +PLEASE SELECT A NUMBER AND DATE ABOVE AND CLICK SUBMIT|POR FAVOR SELECIONE UM NÚMERO E UMA DATA ACIMA E CLIQUE EM ENVIAR| +Total Calls That came into this number|Total de chamadas que entraram por esse número| +Average Call Length(seconds) for all Calls|Tempo médio das chamadas(segundos) para todas as chamadas| +Total DROP Calls: (less than 10 seconds)|Total de chamadas derrubadas: (em menos de 10 segundos)| +Average Call Length(seconds) for DROP Calls|Tempo médio das chamadas derrubadas(segundos)| +GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS|GRÁFICO TOTAL DE CHAMADAS A CADA 15 MINUTOS| +Click on the channel below that you would like to have directed to your phone|Clique no canal abaixo que gostaría de direcionar para seu ramal| +LAST 1000 CALLS FOR DATE RANGE|ULTIMAS 1000 CHAMADAS NO PERÍODO| +Click here to see what leads are in the hopper right now|Clique aqui para ver quais registros estão no hopper agora| +CUSTOM STATUSES WITHIN THIS CAMPAIGN|STATUS CUSTOMIZADOS PARA ESSA CAMPANHA| +PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT|POR FAVOR SELECIONE UMA CAMPANHA ACIMA E CLIQUE EM ENVIAR| +PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT|POR FAVOR SELECIONE UMA CAMPANHA E UMA DATA ACIMA E CLIQUE EM ENVIAR| +GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN|GRÁFICO DO TOTAL DE CHAMADAS FEITAS POR ESSA CAMPANHA A CADA 15 MINUTOS| +ERROR: The file does not have the required number of fields to process it|ERRO: O arquivo não possui a quantidade de campos requerida para continuar| +ERROR: File exceeds the 8MB limit|ERRO: O arquivo excede o limite máximo de 8MB| +Please enter the group you want to get hourly stats for|Por favor entre com o grupo que deseja visualizar estatísticas horárias| +The search variables you entered are not active in the system|As variáveis de pesquisa digitadas não estão ativas no sistema| +Please go back and double check the information you entered and submit again|Por favor volte e verifique as informações digitadas, então envie novamente| +Click here to see the Lead Details|Clique aqui para ver detalhes do registro| +SERVERS TABLE|TABELA DOS SERVIDORES| +Server ID -<\/B> This field is where you put the Asterisk servers name, doesnt have to be an official domain sub, just a nickname to identify the server to Admin users|ID do Servidor - Este campo é onde você configura o nome dos servidores Asterisk, nao precisa ser o domínio oficial, apenas um apelido para identificar o servidor para usuários Admin| +Server Description -<\/B> The field where you use a small phrase to describe the Asterisk server|Descrição do Servidor - O campo onde você usa uma pequena descrição para o servidor Asterisk| +Server IP Address -<\/B> The field where you put the Network IP address of the Asterisk server|Endereço IP do Servidor - O campo onde você configura o endereço IP do servidor Asterisk| +Active -<\/B> Set whether the Asterisk server is active or inactive|Ativo - Configure se o servidor está ativo ou não| +Asterisk Version -<\/B> Set the version of Asterisk that you have installed on this server. Examples: '1.2', '1.0.8', '1.0.7', 'CVS_HEAD', 'REALLY OLD', etc... This is used because versions 1.0.8 and 1.0.9 have a different method of dealing with Local\/ channels, a bug that has been fixed in CVS v1.0, and need to be treated differently when handling their Local\/ channels. Also, current CVS_HEAD and the 1.2 release tree uses different manager and command output so it must be treated differently as well|Versão do Asterisk - Configure a versão do Asterisk que está instalada no servidor. Exemplos: '1.2', '1.0.8', '1.0.7', 'CVS_HEAD', 'REALLY OLD', etc... Isto é necessário pois as versões 1.0.8 e 1.0.9 tem metodos diferentes de controlar canais Local, um erro foi arrumado na CVS v1.0, e precisa ser tratado de forma diferente quando usamos os canais "Local". Também, a versão atual CVS_HEAD e a 1.2 usam managers diferentes e os resultados dos comandos devem ser tratados de forma diferente| +Max VICIDIAL Trunks -<\/B> This field will determine the maximum number of lines that the VICIDIAL auto-dialer will attempt to call on this server. If you want to dedicate two full PRI T1s to VICIDIALing on a server then you would set this to 46. Default is 96|Qtd máxima de trunks VICIDIAL - Este campo determina o número máximo de linhas que o discador automático do VICIDIAL irá usar para chamar esse servidor. Se você quer dedicar dois canais E1 para discagem automática do VICIDIAL nesse servidor, entao você deve configurar como 60. O valor padrão é 96| +Telnet Host -<\/B> This is the address or name of the Asterisk server and is how the manager applications connect to it from where they are running. If they are running on the Asterisk server, then the default of 'localhost' is fine|Host Telnet - Este é o endereço ou nome do servidor Asterisk e é como os aplicativos de gerenciamento se conectam a ele. Se os aplicativos de gerenciamento estiverem sendo executados no próprio servidor Asterisk, então 'localhost' está correto| +Telnet Port -<\/B> This is the port of the Asterisk server Manager connection and is how the manager applications connect to it from where they are running. The default of '5038' is fine for a standard install|Porta Telnet - Esta é a porta para conexão com o Manager do servidor Asterisk e é como os aplicativos de gerenciamento se conectam a ele. A porta padrão é '5038' e funciona normalmente com a instalação padrão| +Manager User -<\/B> The username or login used to connect genericly to the Asterisk server manager. Default is 'cron'|Usuário do Manager - O nome do usuário (login) usado para conectar genericamente ao serviço do Manager do Asterisk. O padrão é 'cron'| +Manager Secret -<\/B> The secret or password used to connect genericly to the Asterisk server manager. Default is '1234'|Senha do Manager - A senha usada para a conexão com o serviço do Manager do Asterisk. O padrão é '1234'| +Manager Update User -<\/B> The username or login used to connect to the Asterisk server manager optimized for the Update scripts. Default is 'updatecron' and assumes the same secret as the generic user|Usuário de atualização do Manager -O nome do usuário (login) otimizado para atualizações, para se conectar ao serviço do Manager do Asterisk. O padrão é 'updatecron' e asume que a senha é a mesma do usuário genérico| +Manager Listen User -<\/B> The username or login used to connect to the Asterisk server manager optimized for scripts that only listen for output. Default is 'listencron' and assumes the same secret as the generic user|Usuário de Escuta do Manager - O nome de usuário (login) otimizado para escutar eventos de saída, usado para conectar ao serviço de Manager do Asterisk. Padrão é 'listencron' e assume que a senha é a mesma do usuário genérico| +Manager Send User -<\/B> The username or login used to connect to the Asterisk server manager optimized for scripts that only send Actions to the manager. Default is 'sendcron' and assumes the same secret as the generic user|Usuário de envio do Manager - O nome de usuário (login) otimizado para enviar Ações para o manager, para se conectar ao serviço do Manager do Asterisk. O Valor padrão é 'sendcron' e assume que a senha é a mesma do usuário genérico| +Server GMT offset -<\/B> The difference in hours from GMT time not adjusted for Daylight-Savings-Time of the server. Default is '-5'|Diferença GMT do Servidor- A diferença em horas a partir do horário GMT de onde se encontra o servidor, nao ajustada para o horário de verão. O padrão é '-5'| +VMail Dump Exten -<\/B> The extension prefix used on this server to send calls directly through agc to a specific voicemail box. Default is '85026666666666'|Exten de descarga de Voicemail - É o prefixo de exten usado neste servidor para enviar chamadas diretamente pelo agc para uma caixa postal específica. O padrão é '85026666666666'| +VICIDIAL AD extension -<\/B> The default extension if none is present in the campaign to send calls to for VICIDIAL auto dialing. Default is '8365'|Exten DA do Vicidial - A extensão padrão caso não haja nenhuma na campanha para enviar chamadas do Discador Automático VICIDIAL. Valor Padrão é '8365'| +Default Context -<\/B> The default dial plan context used for scripts that operate for this server. Default is 'default'|Contexto Padrão - O contexto padrão usado para scripts que operam nesse servidor. O valor padrão é 'default'| +User ID -<\/B> This field is where you put the VICIDIAL users ID number, can be up to 8 digits in length, Must be at least 2 characters in length|ID de Usuário - Este campo é onde deve ser colocado o ID de usuário do VICIDIAL, pode ter até 8 caracteres de comprimento, Deve ter pelo menos 2 caracteres de comprimento| +Password -<\/B> This field is where you put the VICIDIAL users password. Must be at least 2 characters in length|Senha - Este campo é onde deve ser configurada a senha do usuário do VICIDIAL. Deve ter pelo menos 2 caracteres de comprimento| +Full Name -<\/B> This field is where you put the VICIDIAL users full name. Must be at least 2 characters in length|Nome completo - Neste campo é configurado o Nome completo do usuário do VICIDIAL. Deve ter no mínimo 2 caracteres de comprimento| +User Level -<\/B> This menu is where you select the VICIDIAL users user level. Must be a level of 1 to log into VICIDIAL, Must be level greater than 2 to log in as a closer, Must be user level 8 or greater to get into admin web section|Nível de usuário - Neste menu deve ser selecionado o nível do usuário do VICIDIAL. Deve ser pelo menos 1 para acessar o VICIDIAL, deve ser maior que 2 para acessar como finalizador, deve ser nível 8 ou maior para acessar a tela de admin| +User Group -<\/B> This menu is where you select the VICIDIAL users group that this user will belong to. This does not have any restrictions at this time, this is just to subdivide users and allow for future features based upon it|Grupo de usuário - Este menu é onde você seleciona o grupo de usuários do VICIDIAL ao qual esse usuário pertence. Isto ainda não faz restrições, é usado somente para subdividir usuários e permitir futuras funcionalidades baseadas nele| +Phone Login -<\/B> Here is where you can set a default phone login value for when the user logs into vicidial.php. This value will populate the phone_login automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen|Login do Ramal - Aqui é onde você pode configurar um valor padrão para o login do ramal, usado quando o usuário loga no vicidial.php. Este valor será colocado no campo de login do ramal automaticamente quando o usuário loga na campanha no vicidial pela tela do vicidial.php| +Phone Pass -<\/B> Here is where you can set a default phone pass value for when the user logs into vicidial.php. This value will populate the phone_pass automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen|Senha do Ramal- Aqui é onde fica configurada a senha padrão para o ramal quando o usuário loga no vicidial.php. Este valor será colocado automaticamente no campo da senha, quando o usuário faz logon na campanha pela tela vicidial.php| +Delete Users -<\/B> This option if set to 1 allows the user to delete other users of equal or lesser user level from the system|Apagar Usuários - Esta opção quando habilitada permite que o usuário apaga outros usuários de igual ou menor nível do sistema| +Delete User Groups -<\/B> This option if set to 1 allows the user to delete user groups from the system|Apagar Grupos de Usuários - Esta opção, quando habilitada, permite que este usuário apague grupos de usuário do sistema| +Delete Lists -<\/B> This option if set to 1 allows the user to delete vicidial lists from the system|Apagar Listas - Esta opção, quando habilitada, permite ao usuário apagar listas do vicidial| +Delete Campaigns -<\/B> This option if set to 1 allows the user to delete vicidial campaigns from the system|Apagar Campanhas - Esta opção, quando habilitada, permite ao usuário apagar campanhas do vicidial| +Delete In-Groups -<\/B> This option if set to 1 allows the user to delete vicidial In-Groups from the system|Apagar Grupos de Entrada- Esta opção, quando habilitada, permite ao usuário apagar Grupos de entrada do sistema| +Delete Remote Agents -<\/B> This option if set to 1 allows the user to delete vicidial remote agents from the system|Apagar Agentes Remotos - Esta opção quando comfigurada como 1, permite ao usuário apagar agentes remotos do sistema| +Load Leads -<\/B> This option if set to 1 allows the user to load vicidial leads into the vicidial_list table by way of the web based lead loader|Carregar Registros - Esta opção, quando configurada como 1, permite ao usuário carregar novos registros de clientes na tabela vicidial_list atravéz do carregador de arquivos no client web| +Campaign Detail -<\/B> This option if set to 1 allows the user to view and modify the campaign detail screen elements|Detalhes da Campanha- Esta opção, quando configurada como 1, permite ao usuário ver e modificar os detalhes da campanha | +AGC Admin Access -<\/B> This option if set to 1 allows the user to login to the astGUIclient admin pages|Acesso AGC Admin- Esta opção, quando configurada como 1, permite o usuário efetuar logon nas páginas de admin do astGUIclient| +AGC Delete Phones -<\/B> This option if set to 1 allows the user to delete phone entries in the astGUIclient admin pages|Apagar Fones no AGC- Esta opção, quando configurada como 1, permite ao usuário apagar registros de fone nas paginas de admin do astGUIclient| +Delete Scripts -<\/B> This option if set to 1 allows the user to delete Campaign scripts in the script modification screen|Apagar Scripts - Esta opção, quando configurada como 1, permite o usuário apagar scripts de campanha na tela de configuração do script| +Script ID -<\/B> This is the short name of a Vicidial Script. This needs to be a unique identifier. Try not to use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters|ID do Script - Este é o nome curto do script Vicidial. É necessário que seja uma identificação única. Tente não usar espaços ou caracteres especias para este campo. Máximo de 10 caracteres, mínimo de 2 caracteres| +Script Name -<\/B> This is the title of a Vicidial Script. This is a short summary of the script. max 50 characters, minimum of 2 characters. There should be no spaces or punctuation of any kind in theis field|Nome do Script - Este é o título do script Vicidial. Este é um resumo curto do script. Máximo de 50 caracteres, mínimo de 2 caracteres. Não devem ser usados espaços ou caracteres especiais de qualquer forma neste campo| +Script Comments -<\/B> This is where you can place comments for a Vicidial Script such as -changed to free upgrade on Sept 23-. max 255 characters, minimum of 2 characters|Comentários do Script - Aqui é onde você pode colocar comentários para um Script Vicidial como: -alterado em 23 de Set.-. Máximo 255 caracteres, mínimo de 2 caracteres| +Script Text -<\/B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using --A--field--B-- where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?|Texto do Script - Aqui é onde deve ser colocado o conteúdo do Script Vicidial. Mínimo de 2 caracteres. Você pode ter as informações do cliente populadas neste script usando "--A--campo--B--" onde o "campo" é um dos seguintes nomes de campo: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments. Por exemplo, este texto vai imprimir o nome da pessoa nele ----

Olá, posso falar com --A--first_name--B-- --A--last_name--B-- por favor? Olá --A--title--B-- --A--last_name--B-- como vai?

Isto vai aparecer como ----

Olá, posso falar com João da Silva por favor? Olá Sr. da Silva como vai?| +Active -<\/B> This determines whether this script can be selected to be used by a campaign|Ativo - Isto determina se o script pode ser selecionado para ser usado na campanha| +Campaign ID -<\/B> This is the short name of the campaign, it is not editable after initial submission, cannot contain spaces and must be between 2 and 8 characters in lengt|ID da Campanha - Este é o nome curto para a campanha, não é editável após cadastrado, não pode conter espaços e deve ter entre 2 e 8 caracteres de comprimento| +Campaign Name -<\/B> This is the description of the campaign, it must be between 6 and 40 characters in length|Nome da Campanha- Esta é a descrição da campanha, deve ter entre 6 e 40 caracteres de comprimento| +Active -<\/B> This is where you set the campaign to Active or Inactive. If Inactive, noone can log into it|Ativo - Aqui é onde você configura a campanha coma Ativa ou Inativa. Se Inativa, ninguem pode entrar nela| +Park Extension -<\/B> This is where you can customize the on-hold music for VICIDIAL. Make sure the extension is in place in the extensions.conf and that it points to the filename below|Exten do Estacionamento - Aqui é onde você pode customizar a musica em espera para o VICIDIAL. Tenha certeza que a extensão existe no extensions.conf e que aponta para o nome de arquivo abaixo| +Park File Name -<\/B> This is where you can customize the on-hold music for VICIDIAL. Make sure the filename is 10 characters in length or less and that the file is in place in the /var/lib/asterisk/sounds directory|Nome do arquivo de Estacionamento - Aqui é onde você pode customizar a musica em espera para o VICIDIAL. Tenha certeza que o nome do arquivo tem 10 ou menos caracteres de comprimento e que o arquivo está na pasta /var/lib/asterisk/sounds | +Web Form -<\/B> This is where you can set the custom web page that will be opened when the user clicks on the WEB FORM button|Formulário Web - Aqui é onde você configura a página web customizada que é aberta quando o usuário clica no botão WEB FORM| +Allow Closers -<\/B> This is where you can set whether the users of this campaign will have the option to send the call to a closer|Permitir Finalizadores - Aqui é onde você pode configurar se os usuários dessa campanha poderão ter a opção de enviar a chamada para um finalizador| +Dial Status -<\/B> This is where you set the statuses that you are wanting to dial on within the lists that are active for the campaign below|Status da Discagem - Aqui é onde você configura os status que você deseja discar nas listas ativas para a campanha abaixo| +List Order - This menu is where you select how the leads that match the statuses selected above will be put in the lead hopper|Ordem da Lista - Este menu é onde você seleciona como os registros nos status selecionados acima serão colocados no hopper| +select the first leads loaded into the vicidial_list table|selecione o primeiro registro carregado na tabela vicidial_list| +select the last leads loaded into the vicidial_list table|selecione o último registro carregado na tabela vicidial_list| +select the highest phone number and works its way down|seleciona o número de telefone mais alto e desce até o fim| +select the lowest phone number and works its way up|seleciona o telefone mais baixo e sube até o topo| +starts with last names starting with Z and works its way down|inicia com sobrenomes iniciando em Z e desce até o fim| +starts with last names starting with A and works its way up|inicia com sobrenomes iniciando em A e sobe até o inicio| +starts with most called leads and works its way down|inicia com registros mais chamados e vai até o fim| +starts with least called leads and works its way up inserting a NEW lead in every other lead - Must NOT have NEW selected in the dial statuses|inicia com registros menos chamados e vai até o começo inserindo registros NOVOS intercalados - Não deve ter selecionado NOVOS nos status de discagem| +starts with least called leads and works its way up inserting a NEW lead in every third lead - Must NOT have NEW selected in the dial statuses|inicia com registros menos chamados e vai até o começo inserindo um registro NOVO a cada três registros - Não deve ter NOVOS selecionado nos status de discagem| +starts with least called leads and works its way up inserting a NEW lead in every forth lead - Must NOT have NEW selected in the dial statuses|inicia com registros menos chamados e vai até o começo inserindo um registro novo a cada quatro registros - Não deve ter NOVOS selecionado nos status de discagem| +starts with least called leads and works its way up|inicia com registros menos chamados e vai até o começo| +Hopper Level -<\/B> This is how many leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute|Nível de Hopper - Aqui é onde fica configurado quantos registros o VDhopper mantém na tabela vicidial_hopper para esta campanha. Se estiver rodando VDhopper a cada minuto, tenha a garantia que é acima do número de registros discados por minuto| +Force Reset of Hopper -<\/B> This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs|Força Limpeza do Hopper - Isto permite que você limpe o conteúdo do hopper a partir do comando enviar da página. O hopper deve ser preenchido assim que o script do VDhopper for executado| +Auto Dial Level -<\/B> This is where you set how many lines VICIDIAL should use per active agent. zero 0 means auto dialing is off and the agents will click to dial each number. Otherwise VICIDIAL will keep dialing lines equal to active agents multiplied by the dial level to arrive at how many lines this campaign on each server should allow|Nível de Discagem Automática - Aqui deve ser configurado quantas linhas o VICIDIAL deve usar por agente ativo. Zero(0) significa que o discador automático está desligado e os agentes devem clicar para discar cada número. Caso contrário o VICIDIAL irá manter discando na quantidade de linhas igual ao número de agentes livres multiplicado pelo valor deste campo| +Next Agent Call -<\/B> This determines which agent receives the next call that is available|Próximo Agente - Isto determina qual agente recebe a próxima chamada disponível| +orders by the random update value in the vicidial_live_agents table|ordena por um número randômico de atualizações na tabela vicidial_live_agents | +orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall|ordena pela última vez que um agente recebeu uma chamada. Resulta nos agentes recebendo uma média igual de chamadas| +orders by the last time an agent finished a call. AKA agent waiting longest receives first call|ordena pela última vez que um agente finalizou uma chamada. Também conhecido como agente que está mais tempo esperando cliente, recebe a primeira chamada| +Local Call Time -<\/B> This is where you set during which hours you would like to dial, as determined by the local time in the are in which you are calling. This is controlled by area code and is adjusted for Daylight Savings time if applicable. General Guidelines in the USA for Business to Business is 9am to 5pm and Business to Consumer calls is 9am to 9pm|Horário de chamada local - Aqui é onde se configura o horário que se deseja discar, conforme determinação do horário no local para o qual está se discando. Isto é controlado por código de área e é ajustado para o horário de verão caso esteja em vigor. A recomendação para os EUA é de empresa para empresa, das 9:00 as 17:00 e da empresa para consumidor, das 9:00 as 21:00| +Voicemail -<\/B> If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message|Correio de Voz - Se configurado, as chamadas que normalmente seriam derrubadas por falta de agente, serão transferidas para esse Correio de Voz, irão ouvir uma mensagem e poderão gravar um recado| +Dial Timeout -<\/B> If defined, calls that would normally hang up after the timeout defined in extensions.conf would instead timeout at this amount of seconds if it is less than the extensions.conf timeout. This allows for quickly changing dial timeouts from server to server and limiting the effects to a single campaign. If you are having a lot of Answering Machine or Voicemail calls you may want to try changing this value to between 21-26 and see if results improve|Tempo excedido de discagem - Se configurado, as chamadas que normalmente seriam desligadas após o tempo definido no extensions.conf serão desligadas no tempo configurado aqui, caso este valor seja menor do que o do extensions.conf. Isso permite que rapidamente sejam alterados os timeouts por campanha e que a configuração seja igual para todos os servidores. Se você está recebendo muitas chamadas de secretária eletrônica ou correio de voz, pode tentar mudar esse valor para valores entre 21 e 26 e verifique se melhora| +Dial Prefix -<\/B> This field allows for more easily changing a path of dialing to go out through a different method without doing a reload in Asterisk. Default is 9 based upon a 91NXXNXXXXXX in the dial plan - extensions.conf|Prefixo de Discagem - Este campo permite que facilmente configuremos o caminho de discagem sem precisar alteração de configurações de servidor e sem precisar recarregar o Asterisk. O padrão é 9 baseado em 91NXXNXXXXXX no plano de discagem - extensions.conf| +Campaign CallerID -<\/B> This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service -RBS- circuits. This will also work through most VOIP -SIP or IAX trunks- providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID|CallerID da Campanha- Este campo permite que seja enviado um número customizado de CallerID nas chamadas saintes. Este número irá ser mostrado no Identificador da pessoa que você está chamando. O padrão é UNKNOWN. Se você está usando T1 ou E1 para discar esta opção está disponível apenas se estiver usando PRIs - ISDN T1 ou E1 - que tenham o recurso de customizar o callerID habilitados, isso nao irá funcionar em circuitos RBS (Robbed-bit Service). Isto também funciona na maioria dos provedores SIP ou IAX que permitem customizar callerID. O callerID customizado se aplica apenas a chamadas feitas por campanhas VICIDIAL diretamente, qualquer chamadas de terceiros ou transferências nao receberá o callerID customizado. ATENÇÃO: algumas vezes colocando-se UNKNOWN ou PRIVATE neste campo pode causar que seja enviado o callerID da sua operadora. Você pode testar isso colocando 00000000000 no campo callerid se você nao quer enviar seu CallerID | +Campaign VDAD extension -<\/B> This field allows for a custom VDAD transfer extension. This allows you to use different VDADtransfer...agi scripts depending upon your campaign. The default transfer AGI - exten 8365 agi-VDADtransfer.agi - just immediately sends the calls on to agents as soon as they are picked up. An additional sample political survey AGI is also now included - 8366 agi-VDADtransferSURVEY.agi - that plays a message to the called person and allows them to make a choice by pressing buttons - effectively pre-screening the lead - . Please note that except for surveys, political calls and charities this form of calling is illegal in the United States|Extensão da campanha VDAD - Este campo permite uma customização na extensão de transferencia. Isso permite que você configure scripts VDADtransfer...agi diferentes dependendo da campanha. A extensão padrão de transferência AGI - 8365 - apenas envia imediatamente as chamadas para os agentes assim que elas são atendidas. Um exemplo adicional de pesquisa política agora também incluída - 8366 agi-VDADtransferSURVEY.agi - que toca uma mensagem para a pessoa chamada e permite que ele faça uma escolha pressionando botões - fazendo uma pre-filtragem no registro -. Atenção: com exceção de pesquisas, propaganda política e de caridade, este tipo de chamada é ilegal nos EUA. Verifique a legalidade no seu país| +Campaign Rec extension -<\/B> This field allows for a custom recording extension to be used with VICIDIAL. This allows you to use different extensions depending upon how long you want to allow a maximum recording and what type of codec you want to record in. The default exten is 8309 which if you follow the SCRATCH_INSTALL examples will record in the WAV format for upto one hour. Another option included in the examples is 8310 which will record in GSM format for upto one hour|Extensão de Gravação - Este campo permite que se use uma extensão de gravação customizada com o VICIDIAL. Isto permite que sejas usadas extensões diferentes dependendo de quanto tempo máximo você quer permitir uma gravação e que tipo de codec você quer usar. A extensão padrão é 8309 a qual, se você seguiu os exemplos do SCRATCH_INSTALL irá gravar as chamadas no formato WAV até uma hora. Outra opção incluida nos exemplos é 8310 que irá gravar no formato GSM até uma hora| +Campaign Recording -<\/B> This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent|Gravação da Campanha - Este menu permite selecionar qual o nível de gravação é permitido nesta campanha. NEVER irá desabilitar a gravação pele client. ONDEMAND é o padrão e permite que o agente inicie e pare a gravação conforme for preciso. ALLCALLS inicia a gravação pelo client quando uma chamada é enviada para o agente| +Campaign Rec Filename -<\/B> This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212|Nome do Arquivo de Gravação - Este campo permite que seja customizado o nome do arquivo de gravação quando a configuração de gravação da campanha esteja em ONDEMAND ou ALLCALLS. As variáveis permitidas sao CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. O padrão é FULLDATE_AGENT e se parece assim: 20051020-103108-6666. Outro exemplo é CAMPAIGN_TINYDATE_CUSTPHONE que se parece assim: TESTCAMP_51020103108_312551212| +Campaign Script -<\/B> This menu allows you to choose the script that will appear on the agents screen for this campaign. Select NONE to show no script for this campaign|Script da Campanha - Este menu permite que seja escolhido um script que irá aparecer na tela do agente para essa campanha. Selecione NONE para não mostrar scripts para esta campanha| +Get Call Launch -<\/B> This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign|Abrir com Chamada - Este menu permite que seja escolhido se você deseja abrir automaticamente a pagina web em uma janela separada, abrir a aba SCRIPT ou nao fazer nada quando uma chamada é enviada ao agente para esta campanha| +Answering Machine Message -<\/B> This field is for entering in an extension to blind transfer calls to when the agent gets an answering machine and clicks on the Answering Machine Message button in the transfer conference frame. You must set this exten up in the dial plan - extensions.conf - and make sure it plays an audio file then hangs up|Mensagem da Secretária Eletrônica - Este campo é para ser digitado uma extensão para onde deverão ser transferidas as chamadas que caem em secretárias eletrônicas e que o Agente clica no botão Answering Machine Message no frame de transferência/Conferência. Você deve configurar esta extensão no plano de discagem - extensions.conf - e ter certeza que ele toca um arquivo de audio e então desliga| +List ID -<\/B> This is the numerical name of the list, it is not editable after initial submission, must contain only numbers and must be between 2 and 8 characters in length|ID da Lista - Este é o nome numérico da lista, não é editável após a confirmação do cadastro, deve conter somente numeros e deve ter entre 2 e 8 caracteres de comprimento| +List Name -<\/B> This is the description of the list, it must be between 2 and 20 characters in length|Nome da Lista - Esta é a descrição da lista, deve ter entre 2 e 20 caracteres de comprimento| +Campaign -<\/B> This is the campaign that this list belongs to. A list can only be dialed on a single campaign at one time|Campanha - Este é a campanha que esta lista pertence. Uma lista só pode ser discada por uma campanha de cada vez| +Active -<\/B> This defines whether the list is to be dialed on or not|Ativo - Indica se a lista é para ser discada ou não| +Reset Lead-Called-Status for this list -<\/B> This resets all leads in this list to N for \"not called since last reset\" and means that any lead can now be called if it is the right status as defined in the campaign screen|Zerar Status de chamada dos registros desta lista - Zera todos os registros desta lista colocando N para \"not called since last reset"\ e significa que qualquer registro pode ser discado agora se for do status conforme configurado na tela da campanha| +Group ID -<\/B> This is the short name of the inbound group, it is not editable after initial submission, must not contain any spaces and must be between 2 and 20 characters in length|ID do Grupo - Nome curto do grupo de entrada, não é editável após confirmação, não deve conter qualquer espaços e deve ter entre 2 e 20 caracteres de comprimento| +Group Name -<\/B> This is the description of the group, it must be between 2 and 30 characters in length. Cannot include dashes, plusses or spaces|Nome do Grupo - Descrição do grupo, deve ter entre 2 e 30 caracteres de comprimento. Não pode incluir os caracteres - + ou espaço| +Group Color -<\/B> This is the color that displays in the VICIDIAL client app when a call comes in on this group. It must be between 2 and 7 characters long. If this is a hex color definition you must remember to put a # at the beginning of the string or VICIDIAL will not work properly|Cor do Grupo - Cor mostrada no aplicativo client do VICIDIAL quando uma chamada entra para este grupo. Deve ser entre 2 e 7 caracteres de comprimento. Se for uma definição de cor em hexadecimal, você deve lembrar de colocar o # no começo ou o VICIDIAL não vai funcionar corretamente| +Active -<\/B> This determines whether this group show up in the selection box when a VICIDIAL agent logs in|Ativo - Indica se o grupo será mostrado na caixa de seleção quando o agente do VICIDIAL efetua logon | +Web Form -<\/B> This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this group|Formulário Web - Endereço customizado para o qual o botão WEB FORM no VICIDIAL leva quando clicado, nas chamadas que entram para este grupo| +Voicemail -<\/B> If defined, this is the Voicemail box that calls will go to instead of being dropped if no agents are available after the hold time is up|Correio de Voz - Se definido, este é o endereço do Correio de Voz para o qual as chamadas são direcionadas ao invés de serem derrubadas quando não existem agentes livres após o tempo de espera| +Fronter Display -<\/B> This field determines whether the inbound VICIDIAL agent would have the fronter name - if there is one - displayed in the Status field when the call comes to the agent|Exibição do Primário - Este campo determina se uma chamada entrante para o agente VICIDIAL deve ter o nome do agente primário, se existir, exibido no campo status da tela quando uma chamada é transferida para o agente| +User ID Start -<\/B> This is the starting User ID that is used when the remote agent entries are inserted into the system. If the Number of Lines is set higher than 1, this number is incremented by one until each line has an entry. Make sure you create a new VICIDIAL user account with a user level of 4 or great if you want them to be able to use the vdremote.php page for remote web access of this account|Início do ID do usuário - Esta é a ID inicial que será usada quando um agente remoto for cadastrado no sistema. Se o número de linhas estiver configurado maior que 1, este número é incrementado por um até cada linha ter sua entrada. Tenha certeza que você criou uma nova conta de usuário VICIDIAL com nível 4 ou superior se você quer que eles sejam capazes de usar a página vdremote.php para acesso remoto a esta conta| +Number of Lines -<\/B> This defines how many remote agent entries the system creates, and determines how many lines it thinks it can safely send to the number below|Número de Linhas - Define quantas entradas de usuários remotos o sistema deve criar, e determina quantas linhas podem ser enviadas com segurança para o número abaixo| +Server IP -<\/B> A remote agent entry is only good for one specific server, here is where you select which server you want|IP do Servidor - Um cadastro de agente remoto só funciona em um servidor, aqui é onde você seleciona qual servidor| +External Extension -<\/B> This is the number that you want the calls forwarded to. Make sure that it is a full dial plan number and that if you need a 9 at the beginning you put it in here. Test by dialing this number from a phone on the system|Extensão Externa - Este é o número para o qual você quer que as chamadas sejam direcionadas. Tenha certeza que é um número completo do plano de discagem e que se você precisa de um 9 no começo, você o coloca aqui. Teste discando o número de um fone no sistema| +Status -<\/B> Here is where you turn the remote agent on and off. As soon as the agent is Active the system assumes that it can send calls to it. It may take up to 30 seconds once you change the status to Inactive to stop receiving calls|Status - Aqui é onde você desliga ou liga o agente remoto. Assim que o agente está ativo, o sistema entende que ele pode receber chamadas. Pode demorar até 30 segundos após a mudança do status para Inactive para parar de receber chamadas| +Campaign -<\/B> Here is where you select the campaign that these remote agents will be logged into. Inbound needs to use the CLOSER campaign and select the inbound campaigns below that you want to receive calls from|Campanha - Aqui é onde você escolhe a campanha que este agente remoto deve ser logado. Chamadas entrantes precisam usar uma campanha CLOSER e selecionar uma campanha entrante abaixo para que você receba chamadas| +Inbound Groups -<\/B> Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign|Grupos de entrada - Aqui é selecionado o grupo de entrada do qual você quer receber chamadas se você selecionou uma campanha CLOSER(finalização)| +The lists within this campaign are listed here, whether they are active is denoted by the Y or N and you can go to the list screen by clicking on the list ID in the first column|As listas dentro desta campanha são listadas aqui, estando ativas ou desativadas será demonstrado por Y ou N e você pode ir para a tela de cadastro de listas clicando no Id na primeira coluna| +Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition|Através do uso de status de campanha customizados, você pode ter status que somente existem para uma campanha específica. Os Status devem ter entre 1 e 8 caracteres de comprimento, a descrição deve ter entre 2-30 caracteres de comprimento e "Selectable" determina se será mostrado no VICIDIAL como um resultado| +Through the use of custom campaign hot keys, agents that use the vicidial web-client can hang up and disposition calls just by pressing a single key on their keyboard|Através do uso de atalhos de teclado customizados por campanha, agentes que usam o web-client do vicidial podem desligar e classificar uma chamada pressionando uma tecla do teclado| +User Group -<\/B> This is the short name of a Vicidial User group, try not to use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters|Grupo de usuário - É o nome curto do grupo de usuários do Vicidial, tente não usar espaços ou caracteres especias neste campo. Máximo de 20 caracteres e mínimo de 2| +Group Name -<\/B> This is the description of the vicidial user group max of 40 characters|Nome do Grupo - Esta é a descrição do grupo de usuários do vicidial, máximo de 40 caracteres| +Xfer-Conf DTMF -<\/B> These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed|Xfer-Conf DTMF - Estes quatro campos permitem que se tenha dois conjuntos de Transferência/Conferência e DTMF pré gravados. Quando uma chamada ou campanha é carregada, o vicidial.php irá mostrar dois botoes de transferência-conferência e preencher os campos number-to-dial e send-dtmf quando pressionados| +AMD send to vm exten -<\/B> This menu allows you to define whether a message is left on an answering machine when it is detected. the call will be immediately forwarded to the Answering-Machine-Message extension if AMD is active and it is determined that the call is an answering machine|AMD envia para exten correio de voz- Este menu permite definir se uma mensagem deve ser deixada na secretária eletrônica quando é detectada. A chamada irá imediatamente ser direcionada para a extensão se o AMD estiver ativo e determinar que é uma secretária eletrônica| +Modify Leads -<\/B> This option if set to 1 allows the user to modify leads in the admin section lead search results page|Modificar Registros - Esta opção quando configurada permite ao usuário modificar registros na página de pesquisa do site admin| +Hot Keys Active -<\/B> This option if set to 1 allows the user to use the Hot Keys quick-dispositioning function in|Atalhos Ativos - Esta opção quando configurada, permite ao usuário usar atalhos de teclado para classificação da chamada| +Change Agent Campaign -<\/B> This option if set to 1 allows the user to alter the campaign that an agent is logged into while they are logged into it|Trocar Campanha do Agente - Esta opção quando configurada, permite ao usuário trocar a campanha em que um agente está logado no sistema sem que haja necessidade de sair do sistema| +Agent Choose Ingroups -<\/B> This option if set to 1 allows the user to choose the ingroups that they will receive calls from when they login to a CLOSER or INBOUND campaign. Otherwise the Manager will need to set this in their user detail screen of the admin page|Agente Escolhe Grupos de Entrada - Esta opção com valor 1, permite ao usuário escolher os grupos de entrada que quer receber chamadas quando fazem sogon em uma campanha CLOSER ou INBOUND. Caso contrário, o Gerente vai precisar configurar isto na tela de detalhes do cadastro de usuários no site admin| +Lead Filter -<\/B> This is a method of filtering your leads using a fragment of a SQL query. Use this feature with caution, it is easy to stop dialing accidentally with the slightest alteration to the SQL statement. Default is NONE|Filtro de Registros - Este é um método de filtrar os registros usando um fragmento de uma query SQL. Use este recurso com cuidado, é fácil parar de discar acidentalmente com uma pequena alteração no comando SQL. O padrão é NONE| +Filter ID -<\/B> This is the short name of a Vicidial Lead Filter. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters|ID do filtro - É o nome curto para o filtro de registros. Precisa ser um identificador único. Não use espaços ou caracteres especiais para este campo. Máximo de 10 caracteres e mínimo de 2 caracteres| +Filter Name -<\/B> This is a more descriptive name of the Filter. This is a short summary of the filter. max 30 characters, minimum of 2 characters|Nome do Filtro - É um nome mais descritivo para o filtro. É um resumo da função do filtro. Máximo de 30 caracteres, mínimo de 2 caracteres| +Filter Comments -<\/B> This is where you can place comments for a Vicidial Filter such as -calls all California leads-. max 255 characters, minimum of 2 characters|Comentários do Filtro - Aqui é onde são colocados comentários para um Filtro Vicidial como por exemplo -liga para todos os registros da California-. Máximo de 255 caracteres, mínimo de 2 caracteres| +Filter SQL -<\/B> This is where you place the SQL query fragment that you want to filter by. do not begin or end with an AND, that will be added by the hopper cron script automatically. an example SQL query that would work here is- called_count \> 4 and called_count \< 8 -|Filtro SQL - É onde colocamos o fragmento da consulta SQL que você deseja usar para filtrar. Não inicie nem termine com AND, isso será adicionado pelo script do hopper automaticamente. Um exemplo de consulta SQL que funcionaría é: called_count \> 4 and called_count \<8 | +Agent Alt Num Dialing -<\/B> This option allows an agent to manually dial the alternate phone number or address3 field after the main number has been called|Discagem para Número Alt. - Permite que um agente manualmente disque para o telefone alternativo ou campo address3 após o número principal tenha sido discado| +Scheduled Callbacks -<\/B> This option allows an agent to disposition a call as CALLBK and choose the data and time at which the lead will be re-activated|Chamadas Agendadas - Permite um agente classificar uma chamada como CALLBK e escolher uma data e hora na qual deseja que o registro seja discado| +Agent-Only Callbacks -<\/B> This option allows an agent to set a callback so that they are the only Agent that can call the customer back. This also allows the agent to see their callback listings and call them back any time they want to|Chamada Agendada por Agente - Permite que um agente configure uma chamada agendada com fidelização, assim ela retorna somente para ele. Isso também permite ao agente ver a sua lista de agendamentos e os chamar qualquer hora que desejem| +Agent Call Manual -<\/B> This option allows an agent to manually enter a new lead into the system and call them. This also allows the calling of any phone number from their vicidial screen and puts that call into their session. Use this option with caution|Agente com Chamada Manual- Permite que um agente manualmente adicione um novo registro ao sistema e comande a discagem. Isso também permite que seja comandado a discagem de qualquer número na tela do vicidial e a coloque na sua sessão. Use esta opção com cautela| +Vicidial Recording -<\/B> This option can prevent an agent from doing any recordings after they log in to vicidial. This option must be on for vicidial to follow the campaign recording session|Gravação do Vicidial - Esta opção previne um agente de fazer qualquer gravação após ter entrado no vicidial. Esta opção deve estar ligada para que o vicidial grave as chamadas da campanha | +Vicidial Transfers -<\/B> This option can prevent an agent from opening the transfer - conference session of vicidial. If this is disabled, the agent cannot third party call or blind transfer any calls|Transferências Vicidial - Esta opção pode previnir que um agente abra a sessão de transferência/conferência do vicidial. Se estiver desabilitada, o agente não poderá transferir ou incluir um terceiro na chamada| +Delete Filters -<\/B> This option allows the user to be able to delete vicidial lead filters from the system|Apagar Filtros - Esta opção permite que o usuário possa apagar filtros de registro no sistema vicidial| +Alter Agent Interface Options -<\/B> This option if set to 1 allows the administrative user to modify the Agents interface options in admin.php|Alterar Opções da Interface do Agente - Esta opção quando configurada como 1 permite ao usuário administrativo modificar a interface do agente no admin.php| +Closer Default Blended -<\/B> This option simply defaults the Blended checkbox on a CLOSER login screen|Padrão Mesclado para Finalizador - Esta opção simplesmente marca ou nao o checkbox de Mesclado(blended) no login da campanha Finalizador (closer)| +FILTER NOT ADDED - there is already a filter entry with this ID|FILTRO NÃO ADICIONADO - já existe um filtro com esse ID| +Filter ID, name and SQL must be at least 2 characters in length|ID do Filtro, nome e SQL devem ter pelo menos 2 caracteres de comprimento| +Filter ID must be at least 2 characters in length|ID do filtro deve ter pelo menos 2 caracteres de comprimento| +Please go back and look at the data you entered|Por favor, volte e verifique os dados digitados| +CLICK HERE TO GO TO THE SUPER LEAD LOADER|CLIQUE AQUI PARA IR PARA O SUPER CARREGADOR DE REGISTROS| +BACK TO ADMIN|VOLTAR PARA ADMIN| +File layout to use|Layout do arquivo a usar| +Standard VICIDIAL|Padrão VICIDIAL| +Custom layout|Layout Customizado| +CLICK HERE TO GO TO THE BASIC LEAD LOADER|CLIQUE AQUI PARA IR PARA O CARREGADOR BÁSICO DE REGISTROS| +SUPER LIST LOADER|SUPER CARREGADOR DE LISTA| +OK TO PROCESS|OK PARA PROCESSAR| +File data|Dados do arquivo| +short description of the filter|descrição simples do filtro| +Alter Agent Interface Options: |Alterar opções da Interface do Agente:| +Click here to delete filter |Clique aqui para apagar o filtro| +FILTER DELETION COMPLETED:|REMOÇÃO DO FILTRO COMPLETADA| +ADMIN INTERFACE OPTIONS:|OPÇÕES DA INTERFACE ADMIN:| +AGENT INTERFACE OPTIONS:|OPÇÕES DA INTERFACE DO AGENTE:| +Closer Default Blended:|Finalizador Padrão como Mesclado:| +Agent Alt Num Dialing:|Discagem do Número Alternativo pelo Agente:| +Scheduled Callbacks:|Agendamento de Chamadas:| +Agent-Only Callbacks:|Agendamento de Chamadas com Fidelização:| +New Filter Addition|Novo Filtro| +LEAD FILTER LISTINGS:|Listagem de Filtros de Registro:| +FILTER NOT MODIFIED|FILTRO NÃO ALTERADO| +FILTER NOT DELETED|FILTRO NÃO REMOVIDO| +DELETE THIS FILTER|APAGAR ESTE FILTRO| +FILTER NOT ADDED|FILTRO NAO ADICIONADO| +Filter Comments: |Comentários do filtro: | +FILTER MODIFIED|FILTRO ALTERADO| +MODIFY A FILTER|ALTERAR FILTRO| +ADD NEW FILTER|INCLUIR NOVO FILTRO| +Add New Filter|Incluir Novo Filtro| +Modify Filter|Alterar Filtro| +Delete Filter|Apagar Filtro| +Filter Name: |Nome do Filtro:| +FILTER ADDED:|FILTRO CRIADO:| +VIEW FILTERS|LISTAR FILTROS| +Lead Filter:|Filtrar Registros:| +Filter SQL:|Filtro SQL:| +Users List|Lista de Usuários| +Filter ID: |ID do Filtro:| +Filters|Filtros| +Agent Call Manual|Agente Manual| +Vicidial Recording|Gravação do Vicidial| +Vicidial Transfers|Transferências do Vicidial| +Click here for user time sheet|Clique aqui para a planilha de tempo do usuário| +Click here for user status|Clique aqui para o status do usuário| +Click here for user CallBack Holds|Clique aqui para os registros de Chamada Agendada do usuário| +Lead Filter|Filtro de registros| +Click here to see all CallBack Holds in this campaign|Clique aqui para visualizar todos os registros de Chamada Agendada para esta campanha| +STATUS NAME|NOME DO STATUS| +Script ID|ID do Script| +Script Name|Nome do Script| +Script Comments|Comentários do Script| +Script Text|Texto do Script| +ADD FILTER|INCLUIR FILTRO| +overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls|overall_user_level: ordena pelo nível do usuário do agente conforme definido na tabela vicidial_users, um valor mais alto irá receber mais chamadas| +VICIDIAL LIST LOADER FUNCTIONALITY|FUNCIONALIDADE DE CARREGADOR DE LISTA DO VICIDIAL| +The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. There is also a new beta version super lead loader that allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation or check for duplicates in itself or other lists, so that is something you need to do before you load the leads. Also, make sure that you have created the list that these leads are to be under so that you can use them. There is also the matter of time-zone-coding these leads. You may want to increase the frequency that the ADMIN_adjust_GMTnow_on_leads.pl is being run in the cron on your Asterisk server so that any loaded leads can be coded faster. Here is a list of the fields in their proper order for the lead files|O carregador de registros baseado em web do VICIDIAL foi projetado simplesmente para carregar um arquivo, de até 8MB, delimitado por tab ou pipe e carregar na tabela vicidial_list. Existe tambéma uma nova versão beta do super carregador de registros que permite escolher campos e os formatos TXT - Texto simples, CSV - Valores Separados por Vírgula, e XLS - Excel. O carregador de registros não valida dados e não verifica duplicidades no próprio arquivo ou em outras listas, isso é algo que deve ser feito antes de carregar os registros. Também tenha certeza que você criou a lista na qual esses registros vão ser carregados para que possa usá-los. Existe também um fator de fuso horário dos registros. Você pode ajustar a frequencia em que o script ADMIN_adjust_GMTnow_on_leads.ps é executado no cron do seu servidor Asterisk para que os registros possam ser codificados com o fuso horário mais rapidamente. Aqui está a lista de campos e sua ordem para os campos do arquivo de registro| +NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /home/cron/AST_SERVER_conf.pl file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file|AVISO: A funcionalidade de carregar arquivos Excel é habilitada por uma série de scripts perl e precisa ser configurada de forma correta no arquivo /home/cron/AST_SERVER_conf.pl do servidor. Também, alguns módulos perl devem ser carregados para que funcione corretamente, OLE-Storage_Lite e Spreadsheet-ParseExcel. Você pode verificar erros de execução deles no arquivo de log de erros do apache | +Vendor Lead Code - shows up in the Vendor ID field of the GUI|Código do Vendedor no Registro - é mostrado no campo Vendor ID na tela do agente| +Source Code - internal use only for admins and DBAs|Código Fonte - uso interno, somente para admins e DBAs| +List ID - the list number that these leads will show up under|ID da Lista - número da lista em que esses registros vão ser carregados| +Phone Code - the prefix for the phone number - 1 for US, 01144 for UK, 01161 for AUS, etc|Código do Telefone - prefixo do número do telefone - 1 para EUA, 01144 para Reino Unido, 01161 para Australia, 55 para Brasil, etc| +Phone Number - must be at least 8 digits long|Número do telefone - deve ter pelo menos 8 digitos| +Title - title of the customer - Mr. Ms. Mrs, etc...|Título - título do cliente(Sr. Sra. Srta., etc...)| +NOTE: It can take up to 30 seconds for changes submitted on this screen to go live|AVISO: Pode demorar até 30 segundos para que as alterações enviadas por essa tela se tornem ativas| +USER NOT ADDED - there is already a user in the system with this user number|USUÁRIO NÃO ADICIONADO - já existe um usuário no sistema com esse número| +USER NOT ADDED - Please go back and look at the data you entered|USUÁRIO NÃO ADICIONADO - Por favor volte e verifique os dados digitados| +user id must be between 2 and 8 characters long|A ID do usuário deve ter entre 2 e 8 caracteres de comprimento| +full name and password must be at least 2 characters long|nome completo e senha devem ter pelo menos 2 caracteres de comprimento| +CAMPAIGN NOT ADDED - there is already a campaign in the system with this ID|CAMPANHA NÃO ADICIONADA - já existe uma campanha com esse ID no sistema| +CAMPAIGN NOT ADDED - Please go back and look at the data you entered|CAMPANHA NÃO ADICIONADA - Por favor volte e verifique os dados digitados| +campaign ID must be between 2 and 8 characters in length|ID da campanha deve ter entre 2 e 8 caracteres de comprimento| +campaign name must be between 6 and 40 characters in length|o nome da campanha deve ter entre 6 e 40 caracteres de comprimento| +CAMPAIGN STATUS NOT ADDED - there is already a campaign-status in the system with this name|STATUS DE CAMPANHA NAO ADICIONADO - já existe um status/campanha no sistema com esse nome| +CAMPAIGN STATUS NOT ADDED - there is already a global-status in the system with this name|STATUS DE CAMPANHA NÃO ADICIONADO - já existe um status global do sistema com esse nome| +CAMPAIGN STATUS NOT ADDED - Please go back and look at the data you entered|STATUS DE CAMPANHA NÃO ADICIONADO- Por favor volte e verifique os dados digitados| +status must be between 1 and 8 characters in length|status deve ter entre 1 e 8 caracteres de comprimento| +status name must be between 2 and 30 characters in length|nome do status deve ter entre 2 e 30 caracteres de comprimento| +CAMPAIGN HOT KEY NOT ADDED - there is already a campaign hot key in the system with this hot key|TECLA DE ATALHO DA CAMPANHA NÃO ADICIONADA - já existe uma tecla de atalho no sistema com a mesma tecla| +CAMPAIGN HOT KEY NOT ADDED - Please go back and look at the data you entered|TECLA DE ATALHO DA CAMPANHA NÃO ADICIONADA - Por favor volte e verifique os dados digitados| +hot key must be a single character between 1 and 9|a tecla de atalho deve ser um caracter entre 1 e 9| +LIST NOT ADDED - there is already a list in the system with this ID|LISTA NÃO ADICIONADA - já existe uma lista no sistema com essa ID| +LIST NOT ADDED - Please go back and look at the data you entered|LISTA NÃO ADICIONADA - por favor volte e verifique os dados digitados| +List ID must be between 2 and 8 characters in length|A ID da lista deve ter entre 2 e 8 caracteres de comprimento| +List name must be at least 2 characters in length|O Nome da Lista deve ter até 2 caracteres de comprimento| +GROUP NOT ADDED - there is already a group in the system with this ID|GRUPO NÃO ADICIONADO - já existe um grupo com essa ID no sistema| +GROUP NOT ADDED - Please go back and look at the data you entered|GRUPO NÃO ADICIONADO - por favor volte e verifique os dados digitados| +Group ID must be between 2 and 20 characters in length and contain no|A ID do grupo deve ter entre 2 e 20 caracteres de comprimento| +Group name and group color must be at least 2 characters in length|O nome e a cor do grupo devem ter pelo menos 2 caracteres de comprimento| +REMOTE AGENTS NOT ADDED - there is already a remote agents entry starting with this userID|AGENTES REMOTOS NÃO ADICIONADOS - já existe um usuário remoto com esse ID no sistema| +REMOTE AGENTS NOT ADDED - Please go back and look at the data you entered|AGENTES REMOTOS NÃO ADICIONADOS - Por favor volte e verifique os dados digitados| +User ID start and external extension must be at least 2 characters in length|Início da ID e extensão externa devem ter no mínimo 2 caracteres de comprimento| +USER GROUP NOT ADDED - there is already a user group entry with this name|GRUPO DE USUÁRIO NÃO ADICIONADO - já existe um grupo de usuários com este nome| +USER GROUP NOT ADDED - Please go back and look at the data you entered|GRUPO DE USUÁRIOS NÃO ADICIONADO - Por favor volte e verifique os dados digitados| +Group name and description must be at least 2 characters in length|Nome e descrição do grupo devem ter pelo menos 2 caracteres de comprimento| +USER NOT MODIFIED - Please go back and look at the data you entered|USUÁRIO NÃO ALTERADO - Por favor volte e verifique os dados digitados| +Password and Full Name each need ot be at least 2 characters in length|Senha e Nome Completo devem ter no mínimo 2 caracteres de comprimento| +RESETTING CAMPAIGN LEAD HOPPER|REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA| +CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered|CAMPANHA NÃO ALTERADA - Por favor volte e verifique os dados digitados| +the campaign name needs to be at least 6 characters in length|o nome da campanha precisa ter no mínimo 6 caracteres de comprimento| +Wait 1 minute before dialing next number|Aguarde 1 minuto antes de discar o próximo número| +CAMPAIGN STATUS NOT MODIFIED - Please go back and look at the data you entered|STATUS DA CAMPANHA NÃO ALTERADO - Por favor retorne e verifique os dados digitados| +the campaign id needs to be at least 2 characters in length|o id da campanha precisa ter no mínimo 2 caracteres de comprimento| +the campaign status needs to be at least 1 characters in length|o status da campanha precisa ter no mínimo 1 caracter de comprimento| +CUSTOM CAMPAIGN STATUS DELETED|STATUS CUSTOMIZADO DA CAMPANHA REMOVIDO| +CAMPAIGN HOT KEY NOT MODIFIED - Please go back and look at the data you entered|ATALHO DE TECLADO DA CAMPANHA NÃO ALTERADO - Por favor volte e verifique os dados digitados| +the campaign hot key needs to be at least 1 characters in length|o atalho de teclado da campanha precisa ter no mínimo 1 caracter de comprimento| +CUSTOM CAMPAIGN HOT KEY DELETED|ATALHO DE TECLADO DA CAMPANHA REMOVIDO| +CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered|CAMPANHA NÃO ALTERADA - Por favor volte e verifique os dados digitados| +the campaign name needs to be at least 6 characters in length|o nome da campanha precisa ter no mínimo 6 caracteres de comprimento| +LIST NOT MODIFIED - Please go back and look at the data you entered|LISTA NÃO ALTERADA - Por favor volte e verifique os dados digitados| +list name must be at least 2 characters in length|o nome da lista precisa ter no mínimo 2 caracteres de comprimento| +REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER|REMOVENDO REGISTROS HOPPERS DO HOPPER DA CAMPANHA ANTIGA| +GROUP NOT MODIFIED - Please go back and look at the data you entered|GRUPO NÃO ALTERADO - Por favor volte e verifique os dados digitados| +group name and group color must be at least 2 characters in length|a cor e o nome do grupo deve ter pelo menos 2 carcteres| +REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered|AGENTES REMOTOS NÃO ALTERADOS - Por favor volte e verifique os dados digitados| +User ID Start and External Extension must be at least 2 characters in length|O início do ID e a Extensão Externa deve ter pelo menos 2 caracteres de comprimento| +REMOTE AGENTS MODIFIED|AGENTES REMOTOS ALTERADOS| +USER GROUP NOT MODIFIED - Please go back and look at the data you entered|GRUPO DE USUÁRIOS NÃO MODIFICADO - Por favor volte e verifique os dados digitados| +Group name and description must be at least 2 characters in length|O nome e a descrição do grupo devem ter pelo menos 2 caracteres de comprimento| +MODIFY A USERS RECORD|ALTERAR REGISTRO DE USUÁRIO| +Click here for user stats|Clique aqui para ver o status do usuário| +MODIFY A CAMPAIGNS RECORD|MODIFICAR REGISTRO DE CAMPANHA| +CONFERENCES TABLE|TABELA DE CONFERÊNCIAS| +Conference Number -<\/B> This field is where you put the meetme conference dialpna number. It is also recommended that the meetme number in meetme.conf matches this number for each entry. This is for the conferences in astGUIclient and is used for leave-3way-call functionality in VICIDIAL|Número da Conferência - Este é o campo onde deve ser colocado o número do plano de discagem da conferência. Também é recomendado que o número da conferência esteja também no arquivo meetme.conf. É usado para as conferências do astGUIclient e para funcionalidade de chamada a três no VICIDIAL| +Server IP -<\/B> The menu where you select the Asterisk server that this conference will be on|IP do Servidor - Deve ser selecionado qual servidor Asterisk esta conferência está configurada| +PHONE NOT ADDED - there is already a Phone in the system with this extension\/server|RAMAL NÃO ADICIONADO - já existe um Ramal no sistema com essa extensão\/servidor| +PHONE NOT ADDED - Please go back and look at the data you entered|RAMAL NÃO ADICIONADO - Por favor volte e verifique os dados digitados| +PHONE ADDED|RAMAL ADICIONADO| +SERVER NOT ADDED - there is already a server in the system with this ID|SERVIDOR NÃO ADICIONADO - já existe um servidor no sistema com essa ID| +SERVER NOT ADDED - Please go back and look at the data you entered|SERVIDOR NÃO ADICIONADO - por favor volte e verifique os dados digitados| +SERVER ADDED|SERVIDOR ADICIONADO| +CONFERENCE NOT ADDED - there is already a conference in the system with this ID and server|CONFERÊNCIA NÃO ADICIONADA - já existe no sistema uma conferência com este ID e servidor| +CONFERENCE NOT ADDED - Please go back and look at the data you entered|CONFERÊNCIA NÃO ADICIONADA - Por favor volte e verifique os dados digitados| +CONFERENCE ADDED|CONFERÊNCIA ADICIONADA| +PHONE NOT MODIFIED - there is already a Phone in the system with this extension\/server|RAMAL NÃO MODIFICADO - já existe no sistema um ramal com esta extensão e servidor| +PHONE NOT MODIFIED - Please go back and look at the data you entered|RAMAL NÃO MODIFICADO - Por favor volte e verifique os dados digitados| +PHONE MODIFIED|RAMAL ALTERADO| +SERVER NOT MODIFIED - there is already a server in the system with this server_ip|SERVIDOR NÃO ALTERADO - já existe no sistema um servidor com este IP| +SERVER NOT MODIFIED - Please go back and look at the data you entered|SERVIDOR NÃO ALTERADO - Por favor volte e verifique os dados digitados| +SERVER MODIFIED|SERVIDOR MODIFICADO| +CONFERENCE NOT MODIFIED - there is already a Conference in the system with this extension-server|CONFERÊNCIA NÃO ALTERADA - já existe no sistema uma conferência com esta extensão e servidor| +CONFERENCE NOT MODIFIED - Please go back and look at the data you entered|CONFERÊNCIA NÃO ALTERADA - Por favor volte e verifique os dados digitados| +You do not have permissions to modify this user|Você não tem permissão de alterar este usuário| +Click here to delete user|Clique aqui para apagar o usuário| +Please go back and look at the data you entered|Por favor volte e verifique os dados digitados| +Click here to delete campaign|Clique aqui para apagar a campanha| +Click here to delete list and all of its leads|Clique aqui para apagar a lista e todos os seus registros| +REMOVING LIST LEADS FROM VICIDIAL_LIST TABLE|REMOVENDO REGISTROS DA LISTA DA TABELA VICIDIAL_LIST| +Click here to delete in-group|Clique aqui para apagar este grupo de entrada| +Click here to delete remote agent|Clique aqui para apagar este usuário remoto| +Click here to delete user group|Clique aqui para apagar este grupo de usuários| +Click here to delete phone|Clique aqui para apagar este ramal| +there is already a script entry with this name|já existe um script com este nome no sistema| +Script name, description and text must be at least 2 characters in length|Nome do script, descrição e texto devem ter no mínimo 2 caracteres de comprimento| +Click here to delete script|Clique aqui para apagar o script| +Phone Login|Login do Ramal| +Phone Pass|Senha do Ramal| +Delete Users|Apagar Usuários| +Delete User Groups|Apagar Grupos de Usuários| +Delete Lists|Apagar Listas| +Delete Campaigns|Apagar Campanhas| +Delete In-Groups|Apagar Grupos de Entrada| +Delete Remote Agents|Apagar Usuários Remotos| +Delete Script|Apagar Scripts| +Load Leads|Carregar Registros| +Campaign Detail|Detalhes da Campanha| +AGC Admin Access|Acesso Admin ao AGC| +AGC Delete Phones|Apagar Ramais do AGC| +SCRIPT NOT ADDED|SCRIPT NÃO ADICIONADO| +SCRIPT ADDED|SCRIPT ADICIONADO| +SCRIPT NOT MODIFIED|SCRIPT NÃO ALTERADO| +SCRIPT MODIFIED|SCRIPT ALTERADO| +DELETE THIS USER|APAGAR ESTE USUÁRIO| +DELETE THIS CAMPAIGN|APAGAR ESTA CAMPANHA| +DELETE THIS LIST|APAGAR ESTA LISTA| +DELETE THIS IN-GROUP|APAGAR ESTE GRUPO DE ENTRADA| +DELETE THIS REMOTE AGENT|APAGAR ESTE USUÁRIO REMOTO| +DELETE THIS USER GROUP|APAGAR ESTE GRUPO DE USUÁRIOS| +DELETE THIS PHONE|APAGAR ESTE RAMAL| +DELETE THIS SCRIPT|APAGAR ESTE SCRIPT| +USER NOT DELETED|USUÁRIO NÃO APAGADO| +CAMPAIGN NOT DELETED|CAMPANHA NÃO APAGADA| +LIST NOT DELETED|LISTA NÃO APAGADA| +IN-GROUP NOT DELETED|GRUPO DE ENTRADA NÃO APAGADO| +REMOTE AGENT NOT DELETED|AGENTE REMOTO NÃO APAGADO| +USER GROUP NOT DELETED|GRUPO DE USUÁRIOS NÃO APAGADO| +PHONE NOT DELETED|RAMAL NÃO APAGADO| +SCRIPT NOT DELETED|SCRIPT NÃO APAGADO| +USER DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DO USUÁRIO| +USER DELETION COMPLETED|REMOÇÃO DO USUÁRIO CONCLUÍDA| +CAMPAIGN DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DA CAMPANHA| +CAMPAIGN DELETION COMPLETED|REMOÇÃO DA CAMPANHA CONCLUÍDA| +Logout Agents|Efetuar Saída dos Agentes| +AGENTS NOT LOGGED OUT OF CAMPAIGN|AGENTES NÃO DESLIGADOS DA CAMPANHA| +AGENT LOGOUT CONFIRMATION|CONFIRMAÇÃO DE SAÍDA FORÇADA DOS AGENTES| +Click here to log all agents out of|Clique aqui para desconectar todos os agentes| +AGENT LOGOUT COMPLETED|DESCONEXÃO DE AGENTES CONCLUÍDA| +LOG ALL AGENTS OUT OF THIS CAMPAIGN|DESCONECTAR TODOS OS AGENTES DESTA CAMPANHA| +LIST DELETION CONFIRMATION|COMFIRMAÇÃO DE REMOÇÃO DA LISTA| +LIST DELETION COMPLETED|REMOÇÃO DA LISTA CONCLUÍDA| +IN-GROUP DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE GRUPO DE ENTRADA| +IN-GROUP DELETION COMPLETED|REMOÇÃO DE GRUPO DE ENTRADA CONCLUÍDA| +REMOTE AGENT DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE AGENTE REMOTO| +REMOTE AGENT DELETION COMPLETED|REMOÇÃO DE AGENTE REMOTO CONCLUÍDA| +USER GROUP DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE GRUPO DE USUÁRIO| +USER GROUP DELETION COMPLETED|REMOÇÃO DE GRUPO DE USUÁRIOS CONCLUÍDA| +PHONE DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE RAMAL| +PHONE DELETION COMPLETED|REMOÇÃO DE RAMAL CONCLUÍDA| +SCRIPT DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE SCRIPT| +SCRIPT DELETION COMPLETED|REMOÇÃO DE SCRIPT CONCLUÍDA| +Preview Script|Pré-Visualizar Script| +MODIFY A SCRIPT|ALTERAR SCRIPT| +title of the script|título do script| +CONFERENCE MODIFIED|CONFERÊNCIA ALTERADA| +MODIFY A PHONE RECORD|ALTERAR UM REGISTRO DE RAMAL| +THE END|FIM| +LIST ALL PHONES|LISTAR TODOS RAMAIS| +ADD A NEW PHONE|INCLUIR RAMAL| +SEARCH FOR A PHONE|PROCURAR RAMAL| +ADD A SERVER|INCLUIR SERVIDOR| +LIST ALL SERVERS|LISTAR TODOS SERVIDORES| +SHOW ALL CONFERENCES|MOSTRAR TODAS CONFERÊNCIAS| +ADD A NEW CONFERENCE|INCLUIR CONFERÊNCIA| +AMD Send to VM exten|Extensão para enviar AMD| +Transfer-Conf DTMF|Transfer-Conf DTMF| +Transfer-Conf Number|Número Transfer-Conf| +Hot Keys Active|Atalhos Ativos| +Modify Leads|Alterar Registros| +Change Agent Campaign|Alterar a Campanha do Agente| +Agent Choose Ingroups|Agente pode escolher Grupos de Entrada| +CallBacks Within Campaign|Chamadas Agendadas nesta Campanha| +CallBacks Within List|Chamadas Agendadas nesta Lista| +CallBacks Within Agent|Chamadas Agendadas deste Agente| +Phone extension|Extensão do Ramal| +Dial Plan Number|Número no Plano de Discagem| +digits only|somente dígitos| +Voicemail Box|Correio de Voz| +Outbound CallerID|CallerID de Saída| +Phone IP address|Endereço IP do Ramal| +Computer IP address|Endereço IP do Computador| +Server IP Address|Endereço IP do Servidor| +Server IP|IP do Servidor| +Login: |Login: | +Password: |Senha: | +Status: |Status: | +Active Account|Conta Ativa| +Phone Type|Tipo de Ramal| +Full Name|Nome Completo| +Company: |Empresa: | +Picture: |Foto: | +Client Protocol|Protocolo do Cliente| +Local GMT|GMT Local| +Do NOT Adjust for DST|NÃO ajuste para o horário de verão| +VALUE=SUBMIT|VALUE=ENVIAR| +ADD A NEW SERVER|INCLUIR SERVIDOR| +Server ID|ID do Servidor| +Server Description|Descrição do Servidor| +Active: |Ativo: | +Asterisk Version|Versão do Asterisk| +Conference Number|Número da Conferência| +New Messages|Mensagens Novas| +Old Messages|Mensagens Antigas| +Manager Login|Login do Gerente| +Manager Secret|Senha do Gerente| +VICIDIAL Default User|Usuário padrão do VICIDIAL| +VICIDIAL Default Pass|Senha padrão do VICIDIAL| +VICIDIAL Default Campaign|Campanha padrão do VICIDIAL| +Park Extension|Extensão de Estacionamento| +Park Exten|Exten de Estacionamento| +Conf Extension|Extensão de Conferência| +Conf Exten|Exten de Conferência| +VICIDIAL Park Exten|Extensão de estacionamento do VICIDIAL| +VICIDIAL Park File|Arquivo de estacionamento do VICIDIAL| +Monitor Prefix|Prefixo de Monitoramento| +Recording Exten|Exten de Gravação| +VMailMain Exten|Exten de Correio de Voz Principal| +VMailDump Exten|Exten de Correio de Voz| +Exten Context|Contexto do Exten| +DTMFSend Channel|Canal de envio do DTMF| +Outbound Call Group|Grupo de Saída de Chamadas| +Browser Location|Localização do Navegador| +Install Directory|Caminho de Instalação| +CallerID URL|URL do CallerID| +VICIDIAL Default URL|URL Padrão do VICIDIAL| +Call Logging|Call Logging| +User Switching|Troca de Usuário| +Conferencing|Conferências| +Admin Hang Up|Hang Up do Admin| +Admin Hijack|Captura do Admin| +Admin Monitor|Monitoramento do Admin| +Call Park|Estacionamento de Chamada| +Updater Check|Verificar Atualizador| +AF Logging|AF Logging| +Queue Enabled|Permitir Filas| +CallerID Popup|Popup do CallerID| +VMail Button|Botão CxPostal | +Fast Refresh|Atualizar Rápido| +Fast Refresh Rate|Taxa da Atualização Rápida| +Persistant MySQL|Persistant MySQL| +Auto Dial Next Number|Auto Discar próximo número| +Stop Rec after each call|Parar de gravar após cada chamada| +Primary |Primário | +Secondary |Secundário | +DBX Server|Servidor do DBX| +DBX Database|Base de dados do DBX| +DBX User|Usuário do DBX| +DBX Pass|Senha do DBX| +DBX Port|Porta do DBX| +DBY Server|Servidor do DBY| +DBY Database|Base de dados do DBY| +DBY User|Usuário do DBY| +DBY Pass|Senha do DBY| +DBY Port|Porta do DBY| +MODIFY A SERVER RECORD|ALTERAR O REGISTRO DO SERVIDOR| +Max VICIDIAL Trunks|Máx. Trunks no VICIDIAL| +Telnet Host|Host Telnet| +Telnet Port|Porta Telnet| +Manager User|Usuário do Manager (AMI)| +Manager Update User|Usuário do Atualizador do Manager| +Manager Listen User|Usuário de Listen do Manager| +Manager Send User|Usuário de Send do Manager| +VMail Dump Exten|Extensão para descarregar Voicemail | +VICIDIAL AD extension|Extensão do AD do VICIDIAL| +Default Context|Contexto Padrão| +PHONES WITHIN THIS SERVER|RAMAIS DESTE SERVIDOR| +>EXTENSION<|>EXTENSÃO<| +>NAME<|>NOME<| +>ACTIVE<|>ATIVO<| +>MODIFY<|>ALTERAR<| +This server has|Este servidor tem| +active phones and|ramais ativos e| +inactive phones|ramais inativos| +MODIFY A CONFERENCE RECORD|ALTERAR O REGISTRO DA CONFERÊNCIA| +Conference: |Conferência: | +Current Extension|Extensão Atual| +extension: |Extensão: | +SEARCH RESULTS|RESULTADOS DA PESQUISA| +PHONE LISTINGS|LISTA DE RAMAIS| +SERVER LISTINGS|LISTA DE SERVIDORES| +CONFERENCE LISTINGS|LISTA DE CONFERÊNCIAS| +script runtime|Script runtime| +ADD NEW PHONE|NOVO RAMAL| +ADD NEW SERVER|NOVO SERVIDOR| +ADD NEW CONFERENCE|NOVA CONFERÊNCIA| +ADD SCRIPT|INCLUIR SCRIPT| +VIEW SCRIPTS|VISUALIZAR SCRIPTS| +SCRIPTS LISTINGS|LISTA DE SCRIPTS| +ADDING NEW PHONE|INCLUINDO RAMAL| +ADDING NEW SERVER|ADICIONANDO SERVIDOR| +ADDING NEW CONFERENCE|ADICIONANDO CONFERÊNCIA| +MODIFY PHONE|ALTERAR RAMAL| +MODIFY SERVER|ALTERAR SERVIDOR| +MODIFY CONFERENCE|ALTERAR CONFERÊNCIA| +MODIFYING PHONE|ALTERANDO RAMAL| +MODIFYING SERVER|ALTERANDO SERVIDOR| +MODIFYING CONFERENCE|ALTERANDO CONFERÊNCIA| +SEARCH PHONES|PESQUISAR RAMAIS| +SEARCH PHONES RESULTS|RESULTADO DA PESQUISA DE RAMAIS| +PHONE LIST|LISTA DE RAMAIS| +SERVER LIST|LISTA DE SERVIDORES| +CONFERENCE LIST|LISTA DE CONFERÊNCIAS| +HELP|AJUDA| +Click here for phone stats|Clique aqui para statísticas do ramal| +REMOTE INBOUND: Main|ENTRANTES REMOTOS: Principal| +REMOTE INBOUND: Popup|ENTRANTES REMOTOS: Popup| +CALLS SENT TO|CHAMADAS ENVIADAS PARA| +Phone Stats|Estatísticas do ramal| +CALL TIME AND CHANNELS|HORÁRIO E CANAL DA CHAMADA| +CHANNEL GROUP|GRUPO DE CANAIS| +HOURS:MINUTES|HORAS:MINUTOS| +TOTAL CALLS|TOTAL DE CHAMADAS| +>NUMBER|>NÚMERO| + DATE<| DATA<| +Close this window|Fechar esta janéla| +Inbound Calls Stats|Estatística das chamadas entrantes| +Add New User|Incluir Usuário| +Add New Campaign|Incluir Campanha| +Add New List|Incluir Lista| +Add New In-Group|Incluir Grupo de Entrada| +Add New Remote Agents|Incluir Usuário Remoto| +Add New Users Group|Incluir Grupo de Usuários| +Add New Script|Incluir Script| +New User Addition|Novo usuário| +New Campaign Addition|Nova Campanha| +New Campaign Status Addition|Novo Status de Campanha| +New Campaign Hot Key Addition|Novo Atalho da Campanha| +New List Addition|Nova Lista| +New In-Group Addition|Novo Grupo de Entrada| +New Remote Agents Addition|Novo Agente Remoto| +New Users Group Addition|Novo Grupo de Usuários| +New Script Addition|Novo Script| +Modify User|Alterar Usuário| +Modify Campaign - Basic View|Alterar Campanha - Visão Básica| +Modify Campaign|Alterar Campanha| +Modify List|Alterar Lista| +Modify In-Group|Alterar Groupo de Entrada| +Modify Remote Agents|Alterar Agentes Remotos| +Modify Users Groups|Alterar Grupos de Usuários| +Modify Script|Alterar Script| +Welcome|Bem vindo| +Campaigns|Campanhas| +Lists|Listas| +In-Groups|Groupos de Entrada| +Remote Agents|Agentes Remotos| +User Groups|Grupos de Usuário| +Search Form|Formulário de Pesquisa| +Search Results|RESULTADOS DA PESQUISA| +VICIDIAL ADMIN|VICIDIAL ADMIN| + TABLE| TABELA| +First Name|Nome| +Middle Initial|Inicial do Meio| +Last Name|Sobrenome| +Address Line 1|Endereço, linha 1| +Address Line 2|Endereço, linha 2| +Address Line 3|Endereço, linha 3| +City|Cidade| +State - limited to 2 characters|Estado - limitado a 2 caracteres| +Province|Província| +Postal Code|CEP| +Country|País| +Gender|Sexo| +Date of Birth|Data de Nascimento| +Alternate Phone Number|Número Alternativo| +Email Address|Endereço de Email| +Security Phrase|Frase de Segurança| +Comments|Comentários| +THE END|FIM| +Logout|Sair| +LIST USERS|LISTAR USUÁRIOS| +ADD A NEW USER|INCLUIR USUÁRIO| +SEARCH FOR A USER|PESQUISAR USUÁRIO| +ADD USER GROUP|NOVO GRUPO DE USUÁRIO| +LIST USER GROUPS|LISTAR GRUPOS DE USUÁRIO| +ADD CAMPAIGN|NOVA CAMPANHA| +LIST CAMPAIGNS|LISTAR CAMPANHAS| +SHOW LISTS|MOSTRAR LISTAS| +ADD NEW LIST|NOVA LISTA| +LOAD NEW LEADS|CARREGAR REGISTROS| +SHOW IN-GROUPS|LISTAR GRUPOS DE ENTRADA| +ADD NEW IN-GROUP|NOVO GRUPO DE ENTRADA| +SHOW REMOTE AGENTS|LISTAR AGENTES REMOTOS| +ADD NEW REMOTE AGENTS|NOVO AGENTE REMOTO| +SERVER STATS|ESTATÍSTICAS DO SERVIDOR| +PARK REPORT|RELATÓRIO DE ESTACIONAMENTO| +VDAD REPORT|RELATÓRIO VDAD| +CLOSER REPORT|RELATÓRIO DE FINALIZADOR(CLOSER)| +SEARCH FOR A LEAD|PESQUISAR UM REGISTRO| +GROUP HOURLY|AGRUPAR POR HORA| +User Number|Número do usuário| +Full Name|Nome Completo| +User Level|Nível do Usuário| +User Group|Grupo do Usuário| +ADD A NEW CAMPAIGN|NOVA CAMPANHA| +ADD A NEW INBOUND GROUP|NOVO GRUPO DE ENTRADA| +ADD NEW USERS GROUP|NOVO GRUPO DE USUÁRIOS| +Campaign ID|ID da Campanha| +Campaign Name|Nome da Campanha| +Park Extension|Extensão de Estacionamento| +Park Filename|Nome do arquivo de Estacionamento| +Web Form|Formulário Web| +Allow Closers|Permitir Finalizadores (Closers)| +Hopper Level|Nível do Hopper| +Auto Dial Level|Nível de Discagem Automática| +Next Agent Call|Próximo Agente a chamar| +Local Call Time|Horário Local da Chamada| +Voicemail|Correio de Voz| +SUBMIT|ENVIAR| +List ID|ID da Lista| +List Name|Nome da Lista| +Campaign|Campanha| +Group ID|ID do Grupo| +Group Name|Nome do Grupo| +Group Color|Cor do Grupo| +Fronter Display|Mostrar Fronter| +User ID Start|Início do ID do Usuário| +Number of Lines|Número de linhas| +External Extension|Extensão Externa| +Inbound Groups|Grupos de Entrada| +Group: |Grupo: | +Description: |Descrição: | +USER ADDED|USUÁRIO ADICIONADO| +CAMPAIGN ADDED|CAMPANHA ADICIONADA| +CAMPAIGN STATUS ADDED|STATUS DE CAMPANHA ADICIONADO| +CAMPAIGN HOT KEY ADDED|ATALHO DA CAMPANHA ADICIONADO| +LIST ADDED|LISTA ADICIONADA| +GROUP ADDED|GRUPO ADICIONADO| +REMOTE AGENTS ADDED|AGENTES REMOTOS ADICIONADOS| +USER GROUP ADDED|GRUPO DE USUÁRIOS ADICIONADOS| +USER MODIFIED|USUÁRIO ALTERADO| +CAMPAIGN MODIFIED|CAMPANHA ALTERADA| +GROUP MODIFIED|GRUPO ALTERADO| +CAMPAIGN MODIFIED|CAMPANHA ALTERADA| +LIST MODIFIED|LISTA ALTERADA| +USER GROUP MODIFIED|GRUPO DE USUÁRIOS ALTERADO| +RESETTING LIST-CALLED-STATUS|ZERANDO O STATUS DE CHAMADA DA LISTA| +Dial status |Status de Discagem| +List Order|Ordem da Lista| +Hopper Level|Nível do Hopper| +Force Reset of Hopper|Forçar Reset do Hopper| +Dial Timeout|Tempo de Espera da Discagem| +Dial Prefix|Prefixo de Discagem| +Campaign CallerID|CallerID da Campanha| +Campaign VDAD exten|Extensão VDAD da Campanha| +Campaign Rec exten|Extensão de Gravação da Campanha| +Campaign Recording|Gravação da Campanha| +Campaign Rec Filename|Nome do Arquivo de Gravação da Campanha| +LISTS WITHIN THIS CAMPAIGN|LISTAS DESTA CAMPANHA| +LIST ID|ID DA LISTA| +LIST NAME|NOME DA LISTA| +>ACTIVE<|>ATIVO<| +This campaign has |Esta campanha tem| +active lists and |listas ativas e| +inactive lists|listas inativas| +leads to be dialed in those lists|registros para serem discados nessas listas| +leads in the dial hopper|registros no hopper| +>STATUS<|>STATUS<| +>DESCRIPTION<|>DESCRIÇÃO<| +>SELECTABLE<|>SELECIONÁVEL<| +>DELETE<|>APAGAR<| +ADD NEW CUSTOM CAMPAIGN STATUS|INCLUIR NOVO STATUS DE CAMPANHA| +Selectable: |Selecionável: | +value=ADD|value=ADD| +CUSTOM HOT KEYS WITHIN THIS CAMPAIGN|ATALHOS DE TECLADO DESTA CAMPANHA| +>HOT KEY<|>ATALHO<| +ADD NEW CUSTOM CAMPAIGN HOT KEY|INCLUIR NOVO ATALHO DE TECLADO DA CAMPANHA| +Hot key: |Atalho:| +Basic View|Visão Básica| +Detail View|Visão Detalhada| +MODIFY A LISTS RECORD|ALTERAR REGISTRO DA LISTA| +Reset Lead-Called-Status for this list|Reiniciar Status dos registros de chamada para esta Lista| +STATUSES WITHIN THIS LIST|STATUS DESTA LISTA| +>CALLED<|>CHAMADO<| +>NOT CALLED<|>NÃO CHAMADO<| +>SUBTOTALS<|>SUBTOTAIS<| +>SUBTOTAL<|>SUBTOTAL<| +TIME ZONES WITHIN THIS LIST|FUSOS HORÁRIOS DESTA CAMPANHA| +GMT OFFSET NOW|DIFERENÇA PARA GMT AGORA| +local time|horário local| +>TOTAL<|>TOTAL<| +CALLED COUNTS WITHIN THIS LIST|CHAMADAS EFETUADAS DESTA LISTA| +MODIFY A GROUPS RECORD|ALTERAR REGISTRO DE GRUPOS| +MODIFY A REMOTE AGENTS ENTRY|ALTERAR AGENTES REMOTOS| +numbers only|somente números| +dial plan number dialed to reach agents|número do plano de discagem para ligar para agentes| +MODIFY A USERS GROUP ENTRY|ALTERAR O REGISTRO DE GRUPO DE USUÁRIOS| +no spaces or punctuation|sem espaços ou pontos| +description of group|descrição do grupo| +SEARCH FOR A USER|PESQUISAR UM USUÁRIO| +SEARCH RESULTS|RESULTADO DA PESQUISA| +>STATS<|>ESTATÍSTICAS<| +USER LISTINGS|LISTA DE USUÁRIOS| +CAMPAIGN LISTINGS|LISTA DE CAMPANHAS| +LIST LISTINGS|LISTAS| +INBOUND GROUP LISTINGS|LISTA DE GRUPOS DE ENTRADA| +REMOTE AGENTS LISTINGS|LISTA DE AGENTES REMOTOS| +USER GROUPS LISTINGS|GRUPOS DE USUÁRIOS| +script runtime|Script runtime| +Hopper List|Lista De Hopper| +Live Current Hopper List|Lista Online do Hopper| +Total leads in hopper right now|Total de registros no hopper agora| +Server Stats|Estatísticas do Servidor| +Total Calls placed from this Campaign: |Total de chamadas desta campanha: | +Average Call Length for all Calls in seconds:|Tempo médio das chamadas (seg): | +Total DROP Calls: |Total de chamadas derrubadas: | +Average Length for DROP Calls in seconds: |Tempo médio das chamadas derrubadas: | +Total NA calls -Busy,Disconnect,BTvoicemail: |Total de chamadas sem contato(ocupadas, disconectadas, correio de voz)| +Average Call Length for NA Calls in seconds: |Tempo médio das chamadas sem contato: | +---------- DROPS|---------- DERRUBADAS| + AUTO-DIAL NO ANSWERS| AUTO-DIAL SEM RESPOSTA| +---------- USER STATS|---------- ESTATÍSTICAS DE USUÁRIO| +---------- TIME STATS|---------- ESTATÍSTICAS DE TEMPO| +USER |USUÁRIO | +Agents Time On Calls |Tempo dos Agentes nas Chamadas| +agents logged in on server|agentes conectados ao servidor| +Paused agents|Agentes em pausa| +5 minutes or more on call|Acima de 5 minutos em chamada| +Over 10 minutes on call|Acima de 10 minutos em chamada| + NO AGENTS ON CALLS |AGENTES SEM CHAMADAS| +calls being placed on server|chamadas sendo efetuadas| +LIVE CALL WAITING|CHAMADAS EM ESPERA| + NO LIVE CALLS WAITING |SEM CHAMADAS EM ESPERA| +START OVER|REINICIAR| +Lead Loader Module|Módulo de Carregar Registros| +Current file status|Status do arquivo atual| +Load leads from this file|Carregar registros do arquivo| +Answering Machine Message|Mensagem na Secretária Eletrônica| +Processing |Procesando| +TALK TIME AND STATUS|TEMPO E STATUS DA CHAMADA| +>COUNT<|>QUANTIDADE<| +>HOURS:MINUTES<|>HORAS:MINUTOS<| +TOTAL CALLS |TOTAL DE CHAMADAS | +LOGIN/LOGOUT TIME|HORÁRIO DE LOGIN/LOGOUT| +>EVENT <|>EVENTO<| +> CAMPAIGN<|> CAMPANHA<| +CAMPAIGN: |CAMPANHA: | +LAST 50 CALLS|ÚLTIMAS 50 CHAMADAS| +VICIDIAL REMOTE: Call Disposition|VICIDIAL REMOTO: Finaliz. de chamada| +Call has been dispositioned|Chamada finalizada| +Close This Window|Fechar a Janela| +Call information|Informações da Chamada| +lead lookup FAILED for lead_id|procura de registro FALHOU para este lead_id| +DISPO CALL|FINAL. CHAM.| +>Address |>Endereço | +>City |>Cidade | +>State:|>Estado:| + Postal Code:| CEP:| +>Province |>Província| +>Country |>País | +>Alt Phone |>Tel. Alt. | +>Email |>Email | +>Security |>Segurança| +>Comments |>Comentários | +>Disposition:|>Finalização:| +Group Hourly Stats|Estatísticas Horárias do Grupo| +TSR HOUR COUNTS|CONTAGEM DE HORAS TSR| +Lead Search|Pesquisar Registro| +Lead Lookup|Pesquisa de Registro| +Please enter a:|Por favor, digite um:| +a Home Phone Number:|um Número Residencial:| +vendor lead code|código do fornecedor| +a lead ID:|ID do Registro:| +>NEW SEARCH<|>NOVA PESQUISA<| +Lead record modification|Registro Alterado| +information modified|Informação Alterada| +CALLS TO THIS LEAD|CHAMADAS PARA ESSE REGISTRO| +VDAD Closer Stats|Estatísticas para Finalizador VDAD| +Auto-dial Closer Stats|Estatísticas para Finalizador Auto-dial| +VICIDIAL REMOTE AGENTS|AGENTES REMOTOS VICIDIAL| +INBOUND STATS|ESTATÍSTICAS DE ENTRADA| +REMOTE AGENTS ERROR - Please go back and look at the data you entered|ERRO DE AGENTES REMOTOS – Por favor volte e verifique os dados digitados | + - WAITING - |- AGUARDANDO -| +Remote Agent inbound stats |Estatísticas de entrada para Agentes Remotos| +Total calls taken |Chamadas totais atendidas | +Total talk time on |Tempo total de conversação | +Call list for |Lista de chamadas para | + NO CALLS ON THIS DAY |NENHUMA CHAMADA HOJE| +Scripts|Scripts| +Script:|Script:| +Get Call Launch|Pegar lançamento da chamada| +not used currently|não utilizado atualmente| +VERSION|VERSÃO| +BUILD|BUILD| +REPORTS|RELATÓRIOS| +USERS|USUÁRIOS| + CAMPAIGNS| CAMPANHAS| +LISTS|LISTAS| +SCRIPTS|SCRIPTS| +FILTERS|FILTROS| +IN-GROUPS|GRUPOS DE ENTR.| +USER GROUPS|GRUPOS DE USUÁRIOS| +REMOTE AGENTS|AGENTES REMOTOS| +Column|Coluna| + PERFORMANCE| PERFORMANCE| +AGENT |AGENTE | +SERVER |SERVIDOR | +### END translation phrases through 1.1.11 release ### +Drop Call Seconds -<\/B> The number of seconds from the time the customer line is picked up until the call is considered a DROP, only applies to outbound calls|Segundos para derrubar chamada - Número de segundos entre o atendimento pelo cliente até a chamada ser considerada um DROP (derrubada), só se aplica a chamadas saintes| +Safe Harbor Message -<\/B> If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y|Mensagem do Porto Seguro - Se configurado como Y irá tocar uma mensagem para o cliente após os segundos de drop terem se passado e a chamada não foi transferida para um agente. Esta configuração vai sobrepor a de enviar mensagem para secretária eletrônica quando configurada como Y| +Safe Harbor Exten -<\/B> This is the dial plan extension that the desired Safe Harbor audio file is located at on your server|Exten do Porto Seguro - Esta é a extensão do plano de discagem designada para o porto seguro, deve tocar o arquivo de mensagem localizado no seu servidor| +Drop Message -<\/B> If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y|Mensagem de DROP - Se configurado como Y irá tocar uma mensagem para o cliente após o tempo em segundos de DROP ter expirado sem que a chamada tenha sido transferida para um agente. esta configuração irá sobrepor a de enviar mensagem para secretária eletrônica| +Drop Exten -<\/B> This is the dial plan extension that the desired Dropped call audio file is located at on your server|Exten de Drop - É o extensão a ser discada na qual existe o comando para tocar o arquivo de audio localizado no seu servidor| +Call Time ID -<\/B> This is the short name of a Vicidial Call Time Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters|ID de Horário de Chamada - Este é o nome curto para a definição do tempo de discagem do Vicidial. Precisa ser um identificador único. Não use espaços ou pontos para este campo. Máximo de 10 caracteres e mínimo de 2 caracteres| +Call Time Name -<\/B> This is a more descriptive name of the Call Time Definition. This is a short summary of the Call Time definition. max 30 characters, minimum of 2 characters|Nome do Horário de Chamada - Nome mais descritivo da definição de Horário de Chamada. É um resumo do Horário de Chamada. Máximo de 30 caracteres e mínimo de 2 caracteres| +Call Time Comments -<\/B> This is where you can place comments for a Vicidial Call Time Definition such as -10am to 4pm with extra call state restrictions-. max 255 characters|Comentários do Horário de Chamada - Aqui devem ser colocados os comentários para a definição de Horários de chamada, por ex: "10:00 as 16:00 com chamadas restritas". Máximo de 255 caracteres | +Default Start and Stop Times -<\/B> This is the default time that calling will be allowed to be started or stopped within this call time definition if the day-of-the-week start time is not defined. 0 is midnight. To prevent calling completely set this field to 2400 and set the Default Stop time to 2400. To allow calling 24 hours a day set the start time to 0 and the stop time to 2400|Horário de Início e Fim Padrão - Este é o padrão de horário no qual chamadas são permitidas se o dia de início na semana não estiver definido. 0 é meia noite. Para evitar chamadas a qualquer horário, coloque 2400 no início e 2400 no fim. Para permitir chamadas nas 24 horas do dia, coloque 0 e 2400 nestes campos| +Weekday Start and Stop Times -<\/B> These are the custom times per day that can be set for the call time definition. same rules apply as with the Default start and stop times|Horários de Início e Fim em dias Úteis - Estes são os horários por dia que podem ser configurados para chamada. As mesmas regras se aplicam conforme os horários de início e fim| +State Call Time Definitions -<\/B> This is the list of State specific call time definitions that are followed in this Call Time Definition|Definição de Horários por Estado - Esta é a lista de horários específica por Estado que deve ser seguida por esta definição de horário| +State Call Time State -<\/B> This is the two letter code for the state that this calling time definition is for. For this to be in effect the local call time that is set in the campaign must have this state call time record in it as well as all of the leads having two letter state codes in them|Estado da definição de horário - Código de duas letras para o estado ao qual esta definição foi configurada. Para que funcione corretamente o horário local da campanha deve ter selecionado o horário local deste estado e os registros de clientes devem ter as mesmas letras de estado| +Delete Call Times -<\/B> This option allows the user to be able to delete vicidial call times records and vicidial state call times records from the system|Remover Horários de Chamada - Esta opção permite ao usuário apagar registros de horários de chamada e chamadas por estado do sistema| +Modify Call Times -<\/B> This option allows the user to view and modify the call times and state call times records. A user doesn't need this option enabled if they only need to change the call times option on the campaigns screen|Alterar Horários de Chamada - Esta opção permite ao usuário visualizar e alterar os registros de horários e estados de ligação. O usuário não precisa desta opção habilitada se for somente alterar as opções de horário na tela de configuração de campanha| +Wrap Up Seconds -<\/B> The number of seconds to force an agent to wait before allowing them to receive or dial another call. The timer begins as soon as an agent hangs up on their customer - or in the case of alternate number dialing when the agent finishes the lead - Default is 0 seconds. If the timer runs out before the agent has dispositioned the call, the agent still will NOT move on to the next call until they select a disposition|Segundos de Pós Atendimento - Quantidade de segundos para forçar o agente esperar antes de permitir que ele receba ou faça outra chamada. O timer inicia assim que o agente desliga a chamada com o cliente, ou em caso de chamada a número alternativo, quando termina o trabalho com um registro. Valor padrão é 0 segundos. Se o timer acabar antes que o agente tenha finalizado a chamada, o agente não receberá novo registro até que finalize o atual| +Wrap Up Message -<\/B> This is a campaign-specific message to be displayed on the wrap up screen if wrap up seconds is set|Mensagem de Pós Atendimento - É uma mensagem específica da campanha a ser mostrada na tela de pós atendimento se o tempo de pós atendimento for configurado| +You are not authorized to view this page. Please go back|Você não esta autorizado a visualizar esta página. Por favor retorne| +Day and time options will appear once you have created the Call Time Definition|Opções de dia e hora irão aparecer assim que você crie definições de Horário de Chamada| +State Call Time ID, name and state must be at least 2 characters in length|ID da configuração de chamada por estado, nome e estado devem ter no mínimo 2 caracteres de comprimento| +Call Time ID and name must be at least 2 characters in length|ID e nome do Horário de Chamada deve ter pelo menos 2 caracteres de comprimento| +Active State Call Time Definitions for this Record|Configuração de Horário de Chamada por estado para este Registro| +there is already a call time entry with this ID|já existe uma entrada de Horário para este ID| +CALL TIMES USING THIS STATE CALL TIME|TEMPOS DE CHAMADA USANDO HORÁRIOS DE CHAMADA POR ESTADO| +STATE CALL TIME DEFINITION NOT ADDED|CONFIGURAÇÃO DO HORÁRIO DE CHAMADA POR ESTADO NAO ADICIONADA| +DELETE THIS STATE CALL TIME DEFINITION|APAGAR ESTE HORÁRIO DE CHAMADA POR ESTADO| +Modify Call Time State Definitions List|Alterar as configurações de horário de chamada por estado| +CALL TIME DEFINITION NOT ADDED|CONFIGURAÇÃO DE HORÁRIO DE CHAMADA NAO INCLUÍDO| +DELETE THIS CALL TIME DEFINITION|APAGAR ESTA CONFIGURAÇÃO DE HORÁRIO DE CHAMADA| +short description of the call time|descrição curta do horário de chamada| +CAMPAIGNS USING THIS CALL TIME|CAMPANHAS QUE USAM ESTE HORÁRIO DE CHAMADA| +STATE CALL TIME NOT MODIFIED|HORÁRIO DE CHAMADA POR ESTADO NÃO ALTERADO| +CALL TIME NOT MODIFIED|HORÁRIO DE CHAMADA NÃO ALTERADO| +STATE CALL TIME MODIFIED|HORÁRIO DE CHAMADA POR ESTADO ALTERADO| +CALL TIME MODIFIED|HORÁRIO DE CHAMADA ALTERADO| +Default Start:|Padrão de Início:| +Default Stop:|Padrão de Fim:| +Sunday Start:|Início no Domingo:| +Sunday Stop:|Fim no Domingo:| +Monday Start:|Início na Segunda:| +Monday Stop:|Fim na Segunda:| +Tuesday Start:|Início na Terça:| +Tuesday Stop:|Fim na Terça:| +Wednesday Start:|Início na Quarta:| +Wednesday Stop:|Fim na Quarta:| +Thursday Start:|Início na Quinta:| +Thursday Stop:|Fim na Quinta:| +Friday Start:|Início na Sexta:| +Friday Stop:|Fim na Sexta:| +Saturday Start:|Início no Sábado:| +Saturday Stop:|Fim no Sábado:| +State Rule Added|Regra de Estado Adicionada| +State Rule Removed|Regra de Estado Removida| +STATE CALL TIME LISTINGS|LISTAGEM DE HORÁRIOS DE CHAMADA POR ESTADO| +CALL TIME LISTINGS|LISTAGEM DE HORÁRIOS DE CHAMADA| +STATE CALL TIME ADDED|HORÁRIO DE CHAMADA POR ESTADO ADICIONADA| +CALL TIME ADDED|HORÁRIO DE CHAMADA ADICIONADA| +Drop Call Seconds|Tempo até derrubar(DROP)| +Use Safe Harbor Message|Usar Mensagem de Porto Seguro| +Safe Harbor Exten|Extensão do Porto Seguro| +Use Drop Message|Usar mensagem ao derrubar (drop)| +Drop Exten|Exten de Drop| +SIP Listen Version|Versão de escuta SIP| +Add New Call Time|Novo Horário de Cham.| +Add New State Call Time|Novo Horário de Cham. por Estado| +New Call Time Addition|Nova Inclusão de Horário de Cham.| +New State Call Time Addition|Nova Inclusão de Hor. de Cham. por Estado| +Modify Call Time|Alterar um Hor. de Cham.| +MODIFY A CALL TIME|ALTERAR UM HOR. DE CHAM.| +Modify State Call Time|Alterar um horário de chamada por estado| +MODIFY A STATE CALL TIME| ALTERAR HOR. CHAM. P/ ESTADO| +Delete State Call Time|Apagar Hor. de Cham. por Estado| +State Call Times|Horários de Chamada por Estado| +State Call Time ID|ID do horário de chamada por estado| +State Call Time Name|Nome do horário de chamada por estado| +State Call Time Comments|Comentários do horário de chamada por estado| +STATE CALL TIME NOT DELETED|HORÁRIO DE CHAM. POR ESTADO NÃO REMOVIDO| +CALL TIME DELETION COMPLETED|HORÁRIO DE CHAM. REMOVIDO| +STATE CALL TIME DELETION COMPLETED|REMOÇÃO DO HORÁRIO DE CHAM. POR ESTADO FINALIZADA| +CALL TIME NOT DELETED|HORÁRIO DE CHAMADA NÃO REMOVIDO| +Call Time ID must be at least 2 characters in length|ID do horário de cham. deve ter pelo menos 2 caracteres| +STATE CALL TIME DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DO HORÁRIO DE CHAM. POR ESTADO| +CALL TIME DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DO HORÁRIO DE CHAMADAS| +Call Times|Horários de Cham.| +CALL TIMES|HORÁRIOS DE CHAMADA| +SHOW CALL TIMES|MOSTRAR HORÁRIOS DE CHAMADA| +ADD NEW CALL TIME|NOVO HORÁRIO DE CHAM.| +SHOW STATE CALL TIMES|MOSTRAR HORÁRIOS DE CHAM. POR ESTADO| +ADD NEW STATE CALL TIME|NOVO HORÁRIO DE CHAM. POR ESTADO| +Call Time ID|ID do Horário de Cham.| +Call Time Name|Nome do Horário de Cham.| +Call Time Comments|Comentários do Horário de cham.| +short description of the call time|descrição curta do horário de chamadas| +HIDE|ESCONDER| +SHOW|MOSTRAR| +Show Dialable Leads Count|Mostrar Quantidade de Registros Discáveis| +Dialable Lead Count|Total de Registros Discáveis| +TEST ON CAMPAIGN|TESTAR A CAMPANHA| +Wrap Up Seconds:|Tempo de pós atendimento:| +Wrap Up Message:|Mensagem de pós atendimento:| +Alt Number Dialing|Discagem para número alternativo| +no active lists selected for this campaign|nenhuma lista ativa para esta campanha| +Real-Time Screen|Tela de Tempo Real| +Allowable Inbound Groups -<\/B> For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound-outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups|Grupos de Entrada Permitidos - Apenas para campanhas tipo CLOSER. Aqui é onde selecionamos os grupos de entrada que você quer que os agentes dessa campanha sejam capazes de ligar. É importante para campanhas de entrada/saida (BLENDED) somente selecionar grupos de entrada que serão usados por agentes desta campanha. As chamadas que entram nos grupos de entrada selecionados aqui, serão contadas como chamadas ativas para a campanha blended mesmo que os agentes dessa campanha não estejam logados como receptivo em qualquer grupo de entrada selecionado| +Allowed Inbound Groups|Grupos De entrada Permitidos| +ADD NUMBER TO DNC|INCLUIR NÚMERO AO BLOQUEIO| +ADD A NUMBER TO THE DNC LIST|INCLUIR UM NÚMERO A LISTA DE BLOQUEIO| +Add New DNC|Novo Bloqueio| +Phone Number|Número do Telefone| +VICIDIAL DNC List -<\/B> This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add a number to this list so that it will not be called by campaigns that use the internal DNC list|Lista de Bloqueio - Esta lista de bloqueio contém cada registro que foi configurado com status de DNC (não chamar) no sistema. Através da opção LISTAS - ADICIONAR BLOQUEIO você pode manualmente incluir um número para esta lista e dessa forma este número não será chamado por campanhas que usam essa lista| +DNC NOT ADDED - This phone number is already in the Do Not Call List|Bloqueio não Cadastrado - Este número já existe na lista de bloqueio| +DNC ADDED|Bloqueio Adicionado| +Use Internal DNC List -<\/B> This defines whether this campaign is to filter leads against the Internal DNC list. If it is set to Y, the hopper will look for each phone number in the DNC list before placing it in the hopper. If it is in the DNC list then it will change that lead status to DNCL so it cannot be dialed. Default is N|Usar Lista de Bloqueio Interna - Define se esta campanha deve filtrar registros levando em conta a lista de bloqueio interna. Se estiver configurada como Y, o hopper irá procurar cada número na lista de bloqueio antes de carregar. Se o número estiver na lista de bloqueio, o registro de chamada será alterado para o status DNCL assim não será chamado. Padrão é N| +Use Internal DNC List|Usar lista de bloqueio interna| +Campaign CallerID -<\/B> This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service(RBS) circuits. This will also work through most VOIP(SIP or IAX trunks) providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID|CallerID da Campanha- Este campo permite enviar um callerID customizado nas chamadas de saída. Este é o número que aparece no callerID da pessoa que você está chamando. O padrão é UNKNOWN. Se você está usando T1 ou E1 para discagem esta opção está apenas disponível quando é usado PRI, ISDN em T1 ou E1, que tenham habilitada a função de callerID customizado, isso não funciona em serviços de circuito Robbed-bit (RBS). Isso também é permitido na maioria dos provedores VOIP (SIP ou IAX) que permitem callerID dinâmico de saída. O CallerID customizado só se aplica a chamadas feitas diretamente por uma campanha VICIDIAL, qualquer chamada de terceiros ou transferências não irão mandar callerID customizado. ATENÇÃO: algumas vezes colocando UNKNOWN ou PRIVATE no campo irá causar o envio do número da sua operadora nas chamadas. Você pode querer testar e colocar 0000000000 no campo callerID ao invés do número se você não quer enviar CallerID| +Login -<\/B> The login used for the phone user to login to the client applications|Login - O login usado pelo usuário do ramal para logar no aplicativo client| +Password -<\/B> The password used for the phone user to login to the client applications|Senha - A senha usada pelo usuário do ramal para entrar no aplicativo client| +New Campaign Lead Recycle Addition|Nova Reciclagem de registros| +Modify Campaign Lead Recycle|Alterar Reciclagem de registros| +Through the use of lead recycling, you can call specific statuses of leads again at a specified interval without resetting the entire list. Lead recycling is campaign-specific and does not have to be a selected dialable status in your campaign. The attempt delay field is the number of seconds until the lead can be placed back in the hopper, this number must be at least 120 seconds. The attempt maximum field is the maximum number of times that a lead of this status can be attempted before the list needs to be reset, this number can be from 1 to 10. You can activate and deactivate a lead recycle entry with the provided links. This feature only works in auto-dial mode, where dial level is greater than 0|Com o uso de reciclagem de registros, você pode chamar status de registros específicos novamente em intervalos específicos sem resetar a lista toda. Reciclagem de Registros é específico de uma campanha e não precisa ser um status selecionável da sua campanha. O tempo de tentativa é o número em segundos até que o registro seja novamente colocado no hopper, este número deve ter pelo menos 120 segundos. O campo de tentativas máximas é a quantidade de vezes que um registro com esse status pode ser tentado antes que a lista precise ser resetada, este número pode ser entre 1 e 10. Você pode ativar ou desativar uma reciclagem de registros com os links. Este recurso só funciona no modo auto-dial, onde o nível de discagem é maior que 0| +CAMPAIGN LEAD RECYCLE NOT ADDED - there is already a lead-recycle for this campaign with this status|RECICLAGEM DE REGISTROS DA CAMPANHA NÃO ADICIONADO - já existe um registro de reciclagem nessa campanha para esse status| +status must be between 1 and 6 characters in length|status deve ter entre 1 e 6 caracteres| +attempt delay must be at least 120 seconds|tempo de tentativa deve ter pelo menos 120 segundos| +maximum attempts must be from 1 to 10|quantidade máxima de tentativas deve ser entre 1 e 10| +CAMPAIGN LEAD RECYCLE ADDED|RECICLAGEM DE REGISTROS DA CAMPANHA ADICIONADO| +CAMPAIGN LEAD RECYCLE NOT DELETED|RECICLAGEM DE REGISTROS DA CAMPANHA NÃO REMOVIDO| +CAMPAIGN LEAD RECYCLE DELETED|RECICLAGEM DE REGISTROS DA CAMPANHA REMOVIDO| +Delete Lead Recycle|Remover Reciclagem de Registros| +LEAD RECYCLING WITHIN THIS CAMPAIGN|RECICLAGEM DE REGISTROS DESTA CAMPANHA| +ATTEMPT DELAY|TEMPO DE TENTATIVA| +ATTEMPT MAXIMUM|QUANTIDADE MÁXIMA DE TENTATIVAS| +ADD NEW CAMPAIGN LEAD RECYCLE|INCLUIR RECICLAGEM DE REGISTROS DA CAMPANHA| +Attempt Delay|Tempo de Tentativa| +Attempt Maximum|Quantidade Máxima de Tentativas| +If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dial string will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field|Se você quer permitir Transferências de Consulta, de um Atendente Primário para um Finalizador, você pode colocar CXFER como um dos números para discar predefinidos e um comando será enviado para fazer uma Transferência de Consulta, então o agente pode sair da conferência e seguir para próxima chamada. Se você que permitir transferências sem consulta para um script AGI de log ou para uma URA, entao coloque AXFER no número para discar. Você também pode especificar uma extensão customizada após AXFER ou CXFER, por exemplo se você quer fazer transferências internas de consulta ao invés de Local você colocaria CXFER90009 no campo número a discar| +System Performance -<\/B> Setting this option to Y will enable logging of system performance stats for the server machine including system load, system processes and Asterisk channels in use. Default is N|Performance do Sistema - Configurar esta opção como Y irá habilitar a gravação de log de estatísticas de performance do sistema para o servidor, processos do sistema e canais em uso no Asterisk. O padrão é N| +Server Logs -<\/B> Setting this option to Y will enable logging of all VICIDIAL related scripts to their text log files. Setting this to N will stop writing logs to files for these processes, also the screen logging of asterisk will be disabled if this is set to N when Asterisk is started. Default is Y|Logs do Servidor - Configurando esta opção como Y irá habilitar a gravação de log de todos os scripts do VICIDIAL em arquivos texto. Configurando como N irá parar de escrever logs para os arquivos desses processos, também a gravação de log do Asterisk estará desabilitada se estiver configurada como N quando o Asterisk iniciar. O padrão é Y | +AGI Output -<\/B> Setting this option to NONE will disable output from all VICIDIAL related AGI scripts. Setting this to STDERR will send the AGI output to the Asterisk CLI. Setting this to FILE will send the output to a file in the logs directory. Setting this to BOTH will send output to both the Asterisk CLI and a log file. Default is FILE|Saída AGI - Configurando esta opção como NONE irá desabilitar a saída de todos os scripts AGI do VICIDIAL. Configurando como STDERR irá enviar a saída do AGI para a CLI do Asterisk. Configurando como FILE irá enviar a saída para um arquivo no diretório de log. Configurando como BOTH irá enviar a saída para ambos CLI e o arquivo de log. O padrão é FILE| +Recording Delay -<\/B> For ALLCALLS and ALLFORCE recording only. This setting will delay the starting of the recording on all calls for the number of seconds specified in this field. Default is 0|Atraso de Gravação - Somente para gravações ALLCALLS e ALLFORCE. Esta configuração irá atrasar a gravação da chamada o tempo em segundos especificado no campo. O padrão é 0| +Omit Phone Code -<\/B> This field allows you to leave out the phone_code field while dialing within VICIDIAL. For instance if you are dialing in the UK from the UK you would have 44 in as your phone_code field for all leads, but you just want to dial 10 digits in your dial plan extensions.conf to place calls instead of 44 then 10 digits. Default is N|Omitir o Código do Telefone - Este campo permite que você deixe o campo código do telefone de fora quando discando pelo VICIDIAL. Por exemplo se você estiver discando dentro do Reino Unido você teria 44 como seu código do telefone nos registros, mas você só quer discar 10 digitos no seu plano de discagem para fazer a chamada, ao invés de 44 mais 10 digitos. Padrão é N| +Campaign Recording -<\/B> This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load|Gravação da Campanha - Este menu permite que você escolha o nível de gravação permitido para esta campanha. NEVER irá desabilitar a gravação no client. ONDEMAND é o padrão e permite ao agente iniciar e parar a gravação conforme necessário. ALLCALLS irá iniciar a gravação assim que uma chamada for enviada para o client. ALLFORCE irá iniciar gravação no client assim que uma chamada for enviada ao agente e não dando opção ao agente de parar a gravação. Para ALLCALLS e ALLFORCE existe uma opção para usar o atraso de gravação para evitar gravações curtas e reduzir carga no servidor| +Dial Method -<\/B> This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Dial Method is changed. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift -as defined by call_time selected for campaign- and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. You cannot change the Auto Dial Level if you are in any of the ADAPT dial methods. Only the Dialer can change the dial level when in predictive dialing mode|Método de discagem - Esta é a definição de como a discagem deve ser feita. Se MANUAL então o níver de discagem automática ficará travado em 0 a não ser que o método seja alterado. Se RATIO então a discagem será feita baseada na quantidade de agentes livres. ADAPT_HARD_LIMIT irá discar preditivamente até o nível de chamadas derrubadas e não discará agressivamente após o nível ter sido alcançado até que abaixe novamente. ADAPT_TAPERED permite se passar do nível de derrubadas na primeira metade do turno, conforme definido no horário de campanha, e fica menos agressivo conforme o turno avança. ADAPT_AVERAGE tenta manter uma média no percentual de derrubadas não impondo limites e não sendo tão agressivo como os outros dois métodos. Você não pode mudar o nível de discagem automática se você usar alguns dos métodos ADAPT. Somente o Discador pode mudar o nível no modo preditivo| +Available Only Tally -<\/B> This field if set to Y will leave out INCALL and QUEUE status agents when calculating the number of calls to dial when not in MANUAL dial mode. Default is N|Somente Lista Autom. - Este campo quando configurado como Y não considera a quantidade de chamadas entrantes nem em fila de espera para calcular a quantidade de chamadas para discagem automática. O padrão é N| +Drop Percentage Limit -<\/B> This field is where you set the limit of the percentage of dropped calls you would like while using an adaptive-predictive dial method, not MANUAL or RATIO|Percentual Limite de Derrubadas (drop) - Este campo é onde você configura o limite em percentual das chamadas derrubadas quando usamos um dos métodos preditivos(ADAPT), não válido para métodos MANUAL ou RATIO| +Maximum Adapt Dial Level -<\/B> This field is where you set the limit of the limit to the numbr of lines you would like dialed per agent while using an adaptive-predictive dial method, not MANUAL or RATIO. This number can be higher than the Auto Dial Level if your hardware will support it. Value must be a positive number greater than one and can have decimal places Default 3.0|Nível Máximo de Adapt - Este campo é onde você configura o limite máximo da quantidade de linhas a usar por usuário quando usando um método preditivo (ADAPT), não válido para MANUAL ou RATIO. Este número pode ser maior que o nível de discagem automática se o seu hardware permitir. O valor deve ser um número positivo maior que 1 e pode ter casas decimáis. O padrão é 3.0| +Latest Server Time -<\/B> This field is only used by the ADAPT_TAPERED dial method. You should enter in the hour and minute that you will stop calling on this campaign, 2100 would mean that you will stop dialing this campaign at 9PM server time. This allows the Tapered algorithm to decide how aggressively to dial by how long you have until you will be finished calling|Horário Final do Servidor - Este campo só é usado pelo método ADAPT_TAPERED. Você deve entrar com a hora e o minuto em que vai parar de fazer chamadas para esta campanha, 2100 significa que você vai parar de discar esta campanha as 21 horas. Isto permite ao algoritmo do método Tapered decidir quanto agressivo deve ser e quanto tempo tem até o horário de parar| +Adapt Intensity Modifier -<\/B> This field is used to adjust the predictive intensity either higher or lower. The higher a positive number you select, the greater the dialer will increase the call pacing when it goes up and the slower the dialer will decrease the call pacing when it goes down. The lower the negative number you select here, the slower the dialer will increase the call pacing and the faster the dialer will lower the call pacing when it goes down. Default is 0. This field is not used by the MANUAL or RATIO dial methods|Modificador de Intensidade - Este campo é usado para ajustar a intensidade preditiva para cima ou para baixo. Quanto mais alto(positivo) o valor selecionado, mais o discador vai aumentar o ritmo de chamadas quando aumentar a velocidade e mais lento será para o discador diminuir a velocidade. Quanto mais negativo for o número que você selecionou, mais devagar o discador irá aumentar o ritmo quando precisar, e mais rápido diminuirá a velocidade quando precisar diminuir o ritmo. O padrão é 0. Este campo não é usado pelos métodos MANUAL ou RATIO. | +Dial Level Difference Target -<\/B> This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or RATIO dial methods|Alvo da Diferença de Nível - Este campo é usado para definir se você quer alcançar um número específico de agentes esperando chamadas ou chamadas esperando agentes. Por exemplo: se você gostaria de sempre ter em média um agente livre para receber chamadas imediatamente, você configura como -1, se você gostaria que sempre houvesse uma chamada esperando por agente, você configura como 1. O padrão é 0. Este campo não é usado pelos métodos MANUAL e RATIO| +System Performance|Performance do Sistema| +Server Logs|Logs do Servidor| +AGI Output|Saída do AGI| +Recording Delay|Atraso de Gravação| +Omit Phone Code|Omitir Código de Telefone| +Campaign Recording|Gravação da Campanha| +Dial Method|Método de Discagem| +Available Only Tally|Somente Lista Autom.| +Drop Percentage Limit|Limite de Derrubadas (drop)| +Maximum Adapt Dial Level|Nível Máximo de Discagem| +Latest Server Time|Horário Final do Servidor| +Adapt Intensity Modifier|Modificador de Intensidade | +Dial Level Difference Target|Alvo de Diferença de Nível| +### START translations for 2.0.2 release ### +VICIDIAL Server Trunks allows you to restrict the outgoing lines that are used on this server for campaign dialing on a per-campaign basis. You have the option to reserve a specific number of lines to be used by only one campaign as well as allowing that campaign to run over its reserved lines into whatever lines remain open, as long at the total lines used by vicidial on this server is less than the Max VICIDIAL Trunks setting. Not having any of these records will allow the campaign that dials the line first to have as many lines as it can get under the Max VICIDIAL Trunks setting|Trunks do Servidor VICIDIAL permitem que você limite as linhas que são usadas para saída neste servidor para discagem de campanhas ou por cada campanha. Você tem a opção de reservar um número específico de linhas a serem usadas por apenas uma campanha assim como permitir que esta campanha rode nas linhas garantidas a ela e usar linhas que estão abertas, somente se a quantidade total de linhas usadas for menor que a configuração de máximo. Não havendo nenhuma dessas configurações irá permitir que a campanha que discar primeiro, ter quantas linhas ela puder pegar até a quantidade máxima configurada| +VICIDIAL Balance Dialing -<\/B> Setting this field to Y will allow the server to place balance calls for campaigns in VICIDIAL so that the defined dial level can be met even if there are no agents logged into that campaign on this server. Default is N|Discagem Balanceada - Se configurado como Y irá permitir que o servidor faça chamadas balanceadas para as campanhas do VICIDIAL de forma que o nível de chamadas do servidor possa ser alcançado mesmo que nao haja agentes logados nas campanhas deste servidor. Padrão é N| +VICIDIAL Balance Offlimits -<\/B> This setting defines the number of trunks to not allow VICIDIAL balance dialing to use. For example if you have 40 max vicidial trunks and balance offlimits is set to 10 you will only be able to use 30 trunk lines for VICIDIAL balance dialing. Default is 0|Limites de Balanceamento do VICIDIAL - Esta configuração define o número de trunks não disponíveis ao uso balanceado do VICIDIAL. Por exemplo, se você tem 40 trunks máximos e o limite de balanceamento for 10, você só poderá usar 30 linhas do trunk para balanceamento VICIDIAL. Padrão é 0| +Allowed Campaigns -<\/B> This is a selectable list of Campaigns to which members of this user group can log in to. The ALL-CAMPAIGNS option allows the users in this group to see and log in to any campaign on the system|Campanhas Permitidas - Esta é uma lista selecionável de campanhas nas quais os membros deste grupo podem se logar. A opção ALL-CAMPAIGNS permite aos usuários neste grupo ver e logar em qualquer campanha no sistema| +VICIDIAL SERVER TRUNK RECORD NOT ADDED|REGISTRO DE TRUNK VICIDIAL NÃO ADICIONADO| +there is already a server-trunk record for this campaign|já existe um registro de trunk para esta campanha| +the number of vicidial trunks is too high|o número de trunk vicidial é muito alto| +VICIDIAL SERVER TRUNK RECORD ADDED|REGISTRO DE TRUNK VICIDIAL INCLUÍDO| +VICIDIAL SERVER TRUNK RECORD NOT MODIFIED|REGISTRO DE TRUNK VICIDIAL NÃO INCLUÍDO| +VICIDIAL SERVER TRUNK RECORD MODIFIED|REGISTRO DE TRUNK VICIDIAL ALTERADO| +VICIDIAL SERVER TRUNK RECORD NOT DELETED|REGISTRO DE TRUNK VICIDIAL NAO REMOVIDO| +VICIDIAL SERVER TRUNK RECORD DELETED|REGISTRO DE TRUNK VICIDIAL REMOVIDO| +campaign must be between 3 and 8 characters in length|campanha deve ter entre 3 e 8 caracteres de comprimento| +server_ip delay must be at least 7 characters|delay do IP do servidor deve ser pelo menos 7 caracteres| +trunks must be a digit from 0 to 9999|trunks devem ter um digito entre 0 e 9999| +VICIDIAL Balance Dialing|Discagem Balanceada do VICIDIAL| +VICIDIAL Balance Offlimits|Limite de Balanceamento do VICIDIAL| +ADDING NEW SERVER VICIDIAL TRUNK RECORD|ADICIONANDO TRUNK DO SERVIDOR VICIDIAL| +ADD NEW SERVER VICIDIAL TRUNK RECORD|INCLUIR TRUNK DO SERVIDOR VICIDIAL| +MODIFY SERVER VICIDIAL TRUNK RECORD|ALTERAR TRUNK DO SERVIDOR VICIDIAL| +DELETE SERVER VICIDIAL TRUNK RECORD|REMOVER TRUNK DO SERVIDOR VICIDIAL| +VICIDIAL TRUNKS FOR THIS SERVER|TRUNKS DO VICIDIAL PARA ESTE SERVIDOR| + RESTRICTION | RESTRIÇÃO | + TRUNKS | TRUNKS | +Emergency VDAC Jam Clear|Limpador de emergência para VDAC| +VDAC NOT CLEARED FOR CAMPAIGN|VDAC NÃO LIMPO PARA CAMPANHA| +LAST VDAC RECORD CLEARED FOR CAMPAIGN|ÚLTIMO REGISTRO VDAC LIMPO PARA CAMPANHA| +VDAC CLEAR CONFIRMATION|CONFIRMAR LIMPEZA DO VDAC| +Click here to delete the oldest LIVE record in VDAC for|Clique aqui para apagar o registro mais velho do VDAC para| +Allowed Campaigns|Campanhas Permitidas| +USERS CAN VIEW ANY CAMPAIGN|USUÁRIOS PODEM VER QUALQUER CAMPANHA| +Campaign Not Allowed|Campanha não permitida| +### START translations for 2.0.3 release ### +ADAPT OVERRIDE|SOBREPOR ADAPT| +The ADAPT OVERRIDE checkbox allows you to force a new dial level even though the dial method is in an ADAPT mode. This is useful if there is a dramatic shift in the quality of leads and you want to drastically change the dial_level manually.|O checkbox SOBREPOR APAPT permite que você force um nível de discagem mesmo que o método seja um dos ADAPT. Isto é útil quando existe uma mudança grande na qualidade dos registros e você quer mudar manualmente o nível.| +There are two special HotKey options that you can use in conjunction with Alternate Phone number dialing, ALTPH2 - Alternate Phone Hot Dial and ADDR3-----Address3 Hot Dial allow an agent to use a hotkey to hang up their call, stay on the same lead, and dial another contact number from that lead|Existem duas opções de atalhos especiais que você pode usar em conjunto com discagem a Telefones Alternativos, ALTPH2 - Discar para o Tel. Alt. e ADDR3----Discagem rápida do endereço 3, permitem ao agente usar o atalho para desligar a chamada, permanecer no mesmo registro e discar outro telefone do mesmo registro| +Concurrent Transfers|Transferências Simultâneas| +Concurrent Transfers -<\/B> This setting is used to define the number of calls that can be sent to agents at the same time. It is recommended that this setting is left at AUTO. This field is not used by the MANUAL dial method|Transferências Simultâneas - Esta configuração é usada para definir o número de chamadas que podem ser enviadas para agentes ao mesmo tempo. É recomendado que esta configuração seja deixada em AUTO. Este campo não é usado pelo método MANUAL de discagem| +Auto Alt-Number Dialing -<\/B> This setting is used to automatically dial alternate number fields while dialing in the RATIO and ADAPT dial methods when there is no contact at the main phone number for a lead, the NA, B, DC and N statuses. This setting is not used by the MANUAL dial method|Auto Discar Alternativo - Esta configuração é usada para automaticamente discar números alternativos enquanto os métodos RATIO e ADAPT são usados e não há contato no telefone principal para um registro com status NA, B, DC e N. Esta configuração não é usada pelo método MANUAL de discagem| +Auto Alt-Number Dialing|Auto Discar Alternativo| +View Reports -<\/B> This option allows the user to view the VICIDIAL reports.|Visualizar Relatórios - Esta opção permite ao usuário visualizar os relatórios VICIDIAL.| +Modify Sections -<\/B> These options allow the user to view and modify each sections records. If set to 0, the user will be able to see the section list, but not the detail or modification screen of a record in that section|Alterar Sessões - Estas opções permitem ao usuário visualizar e alterar registros de cada sessão. Se configurado como 0, o usuário será capaz de ver a lista de sessões, mas não poderá ver os detalhes nem alterar os registros da sessão| +VICIDIAL AUTO ALT DIAL STATUSES|STATUS DE DISCAGEM ALT.| +If the Auto Alt-Number Dialing field is set, then the leads that are dispositioned under these auto alt dial statuses will have their alt_phone and-or address3 fields dialed after any of these no-answer statuses are set|Se o campo Auto Discar Alternativo estiver marcado, os registros que são finalizados sob estes status terão os números alternativos discados após qualquer um desses status de não atendidos| +AUTO ALT NUMBER DIALING FOR THIS CAMPAIGN|DISCAR NÚMERO ALT. NESTA CAMPANHA| +ADD NEW AUTO ALT NUMBER DIALING STATUS|INCLUIR NOVO STATUS PARA DISCAGEM DE NÚM. ALT.| +AUTO ALT DIAL STATUS NOT ADDED|STATUS DE DISCAGEM DE NÚM. ALT. NÃO INCLUÍDO| +there is already an entry for this campaign with this status|já existe uma entrada para esta campanha com este status| +AUTO ALT DIAL STATUS ADDED|STATUS DE DISCAGEM PARA NÚM. ALT. INCLUÍDO| +AUTO ALT DIAL STATUS NOT DELETED|STATUS DE DISCAGEM PARA NÚM. ALT. NÃO REMOVIDO| +AUTO ALT DIAL STATUS DELETED|STATUS DE DISC. PARA NÚMERO ALT. REMOVIDO| +this auto alt dial status is not in this campaign|este status de discagem do número alt. não está na campanha| +New Auto Alt Dial Status|Novo Status de Disc. Alt.| +Delete Auto Alt Dial Status|Remover Status de Disc. Alt.| + Users | Usuários | + Campaigns | Campanhas | + Lists | Listas | + Scripts | Scripts | + Filters | Filtros | + In-Groups | Grupos Entr. | + User Groups | Grupos de Usuário | + Remote Agents | Agentes Remotos | + Admin | Admin | + Reports | Relatórios | + Show Users | Mostrar Usuários | + Add A New User | Incluir Usuário | + Search For A User | Pesquisa de Usuário | + Show Campaigns | Mostrar Campanhas | + Add A New Campaign | Incluir Campanha | + Real-Time Campaigns Summary | Resumo de Campanhas Tempos-real | + Show Lists | Mostrar Listas | + Add A New List | Incluir Lista | + Search For A Lead | Pesquisar Registro | + Add Number To DNC | Incluir Bloqueio | + Load New Leads | Carregar Registros | + Show Scripts | Mostrar Scripts | + Add A New Script | Incluir Script | + Show Filters | Mostrar Filtros | + Add A New Filter | Incluir Filtro | + Show In-Groups | Mostrar Grupos Entr. | + Add A New In-Group | Incluir Grupo Entr. | + Show User Groups | Mostrar Grp. de Usuário | + Add A New User Group | Incluir Grp. de Usuário | + Group Hourly Report | Relat. de Grps por Hora | + Show Remote Agents | Mostrar Ag. Remotos | + Add New Remote Agents | Incluir Ag. Remoto | + Call Times | Horários de Cham. | + Phones | Ramais | + Conferences | Conferências | + Servers | Servidores | + Show Call Times | Mostrar Horários de Cham. | + Add A New Call Time | Incluir Horário de Cham. | + Show State Call Times | Mostrar Hor. de Cham. por Estado | + Add A New State Call Time | Incluir Hor. de Cham. por Estado | + Show Phones | Mostrar Ramais | + Add A New Phone | Incluir Ramal | + Show Conferences | Mostrar Conferências | + Add A New Conference | Incluir Conferência | + Show VICIDIAL Conferences | Mostrar Conferências VICIDIAL | + Add A New VICIDIAL Conference | Incluir Conferência VICIDIAL | + Show Servers | Mostrar Servidores | + Add A New Server | Incluir Servidor | +CallBacks Within User Group|Agendamentos do Grupo de Usuários| +USERS WITHIN THIS USER GROUP|USUÁRIOS DESTE GRUPO| +Modify Users: |Alterar Usuários: | +Modify Campaigns: |Alterar Campanhas: | +Modify Lists: |Alterar Listas: | +Modify Scripts: |Alterar Scripts: | +Modify Filters: |Alterar Filtros: | +Modify In-Groups: |Alterar Grupos de Ent.: | +Modify User Groups: |Alterar Grupos de Usuário: | +Modify Remote Agents: |Alterar Agentes Remotos: | +Modify Servers: |Alterar Servidor: | +View Reports: |Mostrar Relatórios: | +You do not have permission to view this page|Você não tem permissão para ver esta página| +Lead Time Zone Lookup: |Pesquisa do Fuso Horário do Registro:| +Lead Duplicate Check: |Verificação de Duplicidade de Registro:| +Agent Pause Codes Active -<\/B> Allows agents to select a pause code when they click on the PAUSE button in vicidial.php. Pause codes are definable per campaign at the bottom of the campaign view detail screen and they are stored in the vicidial_agent_log table. Default is N|Códigos de Pausa do Agente Ativos - Permite aos agentes selecionar códigos de pausa quando eles clicam o botão pausa no vicidial.php. Códigos de pausa são definidos por campanha no final da página de detalhes da campanha e são guardados na tabela vicidial_agent_log. O padrão é N| +AGENT PAUSE CODES|CÓDIGOS DE PAUSA DO AGENTE| +If the Agent Pause Codes Active field is set to active then the agents will be able to select from these pause codes when they click on the PAUSE button on their screens. This data is then stored in the vicidial agent log. The Pause code must contain only letters and numbers and be less than 7 characters long. The pause code name can be no longer than 30 characters.|Se o Código de Pausa do Agente estiver ativa então os agentes serão capazes de escolher entre esses códigos de pausa quando clicarem no botão PAUSA em suas telas. Esta informação será então gravada na tabela de log do agente. O código de pausa deve conter somente letras e números e deve ser menor que 7 caracteres. O nome do código de pausa não pode ser maior que 30 caracteres.| +AGENT PAUSE CODES FOR THIS CAMPAIGN|CÓDIGOS DE PAUSA PARA CAMPANHA| +PAUSE CODES|CÓDIGOS DE PAUSA| +BILLABLE|COBRÁVEL| +ADD NEW AGENT PAUSE CODE|NOVO CÓDIGO DE PAUSA| +Pause Code: |Código de Pausa: | +Pause Code Name: |Nome do Código de Pausa: | +Billable: |Cobrável: | +New Agent Pause Code|Novo Código de Pausa| +Modify Agent Pause Code|Alterar Código de Pausa| +Delete Agent Pause Code|Apagar Código de Pausa| +AGENT PAUSE CODE NOT ADDED|CÓDIGO DE PAUSA NAO INCLUÍDO| +there is already an entry for this campaign with this pause code|já existe uma entrada para esta campanha e este código de pausa| +AGENT PAUSE CODE ADDED|CÓDIGO DE PAUSA INCLUÍDO| +AGENT PAUSE CODE NOT MODIFIED|CÓDIGO DE PAUSA NÃO ALTERADO| +CAMPAIGN PAUSE CODE NOT DELETED|CÓDIGO DE PAUSA DA CAMPANHA NÃO REMOVIDO| +Campaign Description -<\/B> This is a memo field for the campaign, it is optional and can be a maximum of 255 characters in length|Descrição da Campanha - Este é um campo de texto para a campanha, é opicional e pode ter no máximo 255 caracteres de comprimento| +Campaign Change Date -<\/B> This is the last time that the settings for this campaign were modified in any way|Data de Alteração da Campanha - Esta é a última vez que a configuração desta campanha foi alterada| +Campaign Stats Refresh -<\/B> This checkbox will allow you to force a vicidial stats refresh, even if the campaign is not active|Atualizar Estat. da Campanha - Este checkbox irá permitir que você force uma atualizaão das estatísticas, mesmo se a campanha não estiver ativa| +Last Campaign Login Date -<\/B> This is the last time that an agent was logged into this campaign|Data do Último Login na Campanha - É a data da última vez que um agente logou nesta campanha| +List Description -<\/B> This is the memo field for the list, it is optional|Descrição da List - É um campo texto para descrião da lista, é opicional| +List Change Date -<\/B> This is the last time that the settings for this list were modified in any way|Data de Alteração da Lista - Esta é a última vez que as configurações da lista foram modificadas| +List Last Call Date -<\/B> This is the last time that lead was dialed from this list|Data da Última Chamada da Lista - É a data em que o último registro da lista foi discado| +List Description: |Descrição da Lista: | +List Change Date: |Data da Alteração: | +Campaign Description: |Descrição da Campanha: | +VICIDIAL Recording Override -<\/B> This option will override whatever the option is in the campaign for recording. DISABLED will not override the campaign recording setting. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load|Sobrepor Config. de Gravação do VICIDIAL - Esta opção irá sobrepor qualquer configuração de gravação que esteja na campanha. DISABLED não irá sobrepor a configuração da campanha. NEVER irá desabilitar a gravação no client. ONDEMAND é o padrão e permite ao agente iniciar e parar a gravação conforme necessário. ALLCALLS irá iniciar a gravação no client quando uma chamada é enviada ao agente. ALLFORCE irá iniciar a gravação no client quando uma chamada é enviada para o agente, sem dar a opção de parar a gravação, Para ALLCALLS e ALLFORCE existe uma opção para atrasar a gravação e evitar gravações curtas demais e evitar carga no sistema| +VICIDIAL Recording Override: |Sobrepor Conf. de Gravação no VICIDIAL:| +MODIFY VICIDIAL SYSTEM SETTINGS|ALTERAR CONFIG. DE SISTEMA DO VICIDIAL| + System Settings | Config. de Sistema | +VICIDIAL SYSTEM SETTINGS MODIFIED|CONFIGURAÇÕES DE SISTEMA ALTERADAS| +Version: |Versão: | +Use Non-Latin: |Uso Não-Latino: | +Webroot Writable: |Raiz Web Gravável: | +Enable QueueMetrics Logging: |Habilitar Log para o QueueMetrics: | +QueueMetrics Server IP: |IP do Servidor QueueMetrics: | +QueueMetrics DB Name: |Nome do BD do QueueMetrics: | +QueueMetrics DB Login: |Login do BD do QueueMetrics: | +QueueMetrics DB Password: |Senha do BD do QueueMetrics: | +Use Non-Latin -<\/B> This option allows you to default the web display script to use UTF8 characters and not do any latin-character-family regular expression filtering or display formatting. Default is 0|Uso Não-Latino - Esta opção permite configurar o padrão de visualização para usar caracteres UTF8 e não filtrar com expressões regulares os caracteres da família dos latinos ou mostrar formatação. Padrão é 0| +Webroot Writable -<\/B> This setting allows you to define whether temp files and authentication files should be placed in the webroot on your web server. Default is 1|Raiz Web Gravável - Esta configuração permite que você define se os arquivos temporários e de autenticação devem ser gravados na raiz do website ou do servidor web. Padrão é 1| +Enable QueueMetrics Logging -<\/B> This setting allows you to define whether VICIDIAL will insert log entries into the queue_log database table as Asterisk Queues activity does. QueueMetrics is a standalone, closed-source statistical analysis program. You must have QueueMetrics already installed and configured before enabling this feature. Default is 0|Habilitar Log para o QueueMetrics - Esta configuração permite que você defina se o VICIDIAL irá enviar registros de log para a base de dados queue_log conforme a atividade de Queues do Asterisk faz. QueueMetrics é um programa de fonte fechado para analise estatística. Você deve ter o QueueMetrics instalado e configurado antes de habilitar este recurso. O padrão é 0| +QueueMetrics Server IP -<\/B> This is the IP address of the database for your QueueMetrics installation|IP do servidor do QueueMetrics - É o IP do servidor do QueueMetrics| +QueueMetrics Database Name -<\/B> This is the database name for your QueueMetrics database|Nome do BD do QueueMetrics - É o nome do banco de Dados do QueueMetrics| +QueueMetrics Database Login -<\/B> This is the user name used to log in to your QueueMetrics database|Login do BD do QueueMetrics - éste es el nombre delusuario usado para abrirse una sesión a su base de datos deQueueMetrics| +QueueMetrics Database Password -<\/B> This is the password used to log in to your QueueMetrics database|Senha do BD do QueueMetrics - É a senha a ser usada para logar no DB do QueueMetrics| +QueueMetrics URL -<\/B> This is the URL or web site address used to get to your QueueMetrics installation|URL do QueueMetrics - É a URL ou endereço do site usado para entrar na sua instalação do QueueMetrics| +QueueMetrics Log ID -<\/B> This is the server ID that all VICIDIAL logs going into the QueueMetrics database will use as an identifier for each record|ID do Log do QueueMetrics - É o ID do servidor que o VICIDIAL coloca no BD do QueueMetrics para identificação de cada registro| +QueueMetrics Log ID: |ID do Log do QueueMetrics: | +Campaign Dial Status Added|Status de Discagem Adicionado| +Campaign Dial Status Removed|Status de Discagem Removido| +To add another status to dial, select it from the drop-down list and click ADD. To remove one of the dial statuses, click on the REMOVE link next to the status you want to remove|Para adicionar outro status de discagem, selecione-o na lista e clique ADD. Para remover um dos status, clique no link REMOVE ao lado do status que você quer remover| +CAMPAIGN DIAL STATUS NOT ADDED|STATUS DE DISCAGEM NÃO INCLUÍDO| +CAMPAIGN DIAL STATUS ADDED|STATUS DE DISCAGEM INCLUÍDO| +this dial status is not selected for this campaign|esse status de discagem não está selecionado para esta campanha| +CAMPAIGN DIAL STATUS NOT REMOVED|STATUS DE DISCAGEM NÃO REMOVIDO| +CAMPAIGN DIAL STATUS REMOVED|STATUS DE DISCAGEM REMOVIDO| +>REMOVE<|>REMOVER<| +Dial Status |Status de Discagem| +no dial statuses selected for this campaign|nenhum status de discagem selecionado para essa campanha| +QueueMetrics EnterQueue Prepend -<\/B> This field is used to allow for prepending of one of the vicidial_list data fields in front of the phone number of the customer for customized QueueMetrics reports. Default is NONE to not populate anything|Prefixo QueueMetrics EnterQueue - Este campo é usado para permitir prefixar um dos campos da tabela vicidial_list na frente do número do telefone do cliente para relatórios customizados no QueueMetrics. O padrão é NONE para não colocar nada| +QueueMetrics EnterQueue Prepend: |Prefixo QueueMetrics EnterQueue: | +VICIDIAL Agent Disable Display -<\/B> This field is used to select when to show an agent when their session has been disabled by the system, a manager action or by an external measure. The NOT_ACTIVE setting will disable the message on the agents screen. The LIVE_AGENT setting will only display the disabled message when the agents vicidial_auto_calls record has been removed, such as during a force logout or emergency logout|Mostrar Bloqueio ao Agente VICIDIAL - Este campo é usado para selecionar quando mostrar para um agente que sua sessão foi bloqueada pelo sistema, ação do gerente ou ocorrência externa. A configuração NOT_ACTIVE irá desabilitar a mensagem na tela do agente. A configuração LIVE_AGENT só irá mostrar a mensagem de bloqueio quando o registro da vicidial_auto_calls for removido, nas situações de logout forçado ou logout de emergência| +VICIDIAL Agent Disable Display: |Mostrar Bloqueio ao Agente VICIDIAL:| +Disable Alter Customer Data -<\/B> If set to Y, does not change any of the customer data record when an agent dispositions the call. Default is N|Desabilitar Alteração nos Dados do Cliente - Quando configurada como Y, não permite ao usuário alterar registros de cliente quando o Agente finaliza a chamada. O padrão é N| +Disable Alter Customer Data: |Desabilitar Alteração de Dados do Cliente:| +Agent Alter Customer Data Override -<\/B> This option will override whatever the option is in the campaign for altering of customer data. NOT_ACTIVE will use whatever setting is present for the campaign. ALLOW_ALTER will always allow for the agent to alter the customer data, no matter what the campaign setting is. Default is NOT_ACTIVE|Sobrepor Permissão de Alteração-<\/B> Esta opção irá sobrepor qualquer opção na campanha para alterar dados do cliente. NOT_ACTIVE irá usar qualquer configuração presente na campanha. ALLOW_ALTER irá sempre permitir alteração no registro do cliente, não importando a configuração da campanha. O padrão é NOT_ACTIVE| +Agent Alter Customer Data Override: |Sobrepor Permissão de Alteração| +Allow No-Hopper-Leads Logins -<\/B> If set to Y, allows agents to login to the campaign even if there are no leads loaded into the hopper for that campaign. This function is not needed in CLOSER-type campaigns. Default is N|Permitir Logar sem Registro no Hopper - Quando Y, permite agentes logarem na campanha mesmo que não existam registros carregados no hopper para esta campanha. Esta funcionalidade não é necessária em campanha de Finalização(CLOSER). O padrão é N| +Allow No-Hopper-Leads Logins: |Permitir Logar Sem Registros no Hopper: | +Enable SIPSAK Messages -<\/B> If enabled the server will send messages to the SIP phone to display on the phone LCD display when logged into VICIDIAL. Feature only works with SIP phones and requires sipsak application to be installed on the web server. Default is 0|Habilitar Mensagens SIPSAK - Se habilitado, o servidor irá mandar mensagens para o fone SIP mostrar no display quando logado no VICIDIAL. Este recurso só funciona com telefones SIP e requer o aplicativo sipsak instalado no servidor web. Padrão é 0| +Enable SIPSAK Messages: |Habilitar Mensagens SIPSAK: | +Allow SIPSAK Messages -<\/B> If set to 1, this will allow the phones table setting to work properly, the server will send messages to the SIP phone to display on the phone LCD display when logged into VICIDIAL. This feature only works with SIP phones and requires sipsak application to be installed on the web server. Default is 0|Permitir Mensagens SIPSAK - Se configurada como 1, irá permitir que a configuração da tabela de ramais funcione corretamente, o servidor irá enviar mensagens para o telefone SIP mostrar no Display LCD quando logado no VICIDIAL. Este recurso só funciona em telefones SIP e requer o aplicativo sipsak instalado no servidor web. O padrão é 0| +Allow SIPSAK Messages: |Permitir Mensagens SIPSAK| +Admin Home URL -<\/B> This is the URL or web site address that you will go to if you click on the HOME link at the top of the admin.php page|URL Home do Admin - É a URL do site que você irá se clicar no link HOME no topo da página admin.php| +Admin Home URL: |URL Home do Admin: | +>HOME<|>HOME<| + Welcome | Bemvindo | +### START translations for 2.0.4 release ### +CHECK FOR DUPLICATES BY PHONE IN ALL CAMPAIGN LISTS|VERIFICAR REGISTROS DUPLICADOS EM TODAS AS LISTAS DA CAMPANHA| +CHECK FOR DUPLICATES BY PHONE IN ENTIRE SYSTEM|VERIFICAR REGISTROS DUPLICADOS NO SISTEMA INTEIRO| +PHONE CODE OVERRIDE FOR THIS FILE|SOBREPOR CÓDIGO DO TELEFONE PARA ESTE ARQUIVO| +The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. The lead loader allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation, but it does allow you to check for duplicates in itself, within the campaign or within the entire system. Also, make sure that you have created the list that these leads are to be under so that you can use them. Here is a list of the fields in their proper order for the lead files:|O carregador de registros baseado em Web do VICIDIAL simplesmente recebe um arquivo de registros, de até 8MB, que é delimitado por tab ou pipe e o carrega na tabela vicidial_list. O Carregador permite escolher os campos, e os formatos TXT - Texto Simples, CSV - Separado por Virgulas, e XLS - Excel. O carregador de arquivos não valida dados, mas permite que você verifique duplicidades nele próprio, na campanha ou no sistema inteiro. Também, tenha certeza que você criou a lista em que esses registros serão carregados antes de carregar o arquivo. Aqui está uma lista dos campos e sua ordem correta para o arquivo de registros:| +NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. Also, for duplication checks against gampaign lists, the list that has new leads going into it does need to be created in the system before you start to load the leads.|ATENÇÃO: A funcionalidade de carregar registros usando arquivos EXCEL é permitida por uma série de scripts e precisa estar devidamente configurada no arquivo /etc/astguiclient.conf no servidor web. Também, alguns módulos perl devem ser carregados para que funcione, OLE-Storage_Lite e Spreadsheet-ParseExcel. Você pode verificar erros de tempo de execução neles olhando o arquivo de log do apache. Também, para verificação de duplicados na lista da campanha, a lista com os novos registros precisa existir no sistema antes de iniciar a carga.| +Campaign List Mix Added|Mesclagem de Listas Incluído| +Modify Campaign List Mix|Alterar Mesclagem de Listas| +Campaign List Mix Removed|Listas de Campanha Removida| +Campaign Statuses|Status da Campanha| +Campaign HotKeys|Atalhos da Campanha| +Campaign Lead Recycle Entries|Reciclagem de Registros da Campanha| +Campaign Auto Alt Dial Statuses|Status de Disc. Alt. da Campanha| +Campaign Agent Pause Codes|Códigos de Pausa de Agente da Campanha| +Campaign Dial Statuses|Status de Discagem da Campanha| +Campaign List Mixes|Mesclagem de Listas| + Lead Recycle |Reciclagem de Registros| + Auto-Alt Dial |Discagem Auto-Alt.| + Pause Codes |Códigos de Pausa| + List Mix |Mesclagem de Lista| + Campaigns Main |Campanhas| +List Order Mix -<\/B> Overrides the Lead Order and Dial Status fields. Will use the List and status parameters for the selected List Mix entry in the List Mix sub section instead. Default is DISABLED|Ordem de Mesclagem - Sobrepõe a ordem nos campos Ordem de Registros e Status de Discagem. | +List Mix ID -<\/B> ID of the list mix. Must be from 2-20 characters in length with no spaces or other special punctuation.|ID da Mescl. de Lista - ID da mesclagem de listas. Deve ter entre 2 e 20 caracteres de comprimento sem espaços ou pontos.| +List Mix Name -<\/B> Descriptive name of the list mix. Must be from 2-50 characters in length|Nome da Mescl. de Lista - nombre descriptivo de la mezcla dela lista. Debe ser a partir de 2-50 caracteres en longitud| +List Mix Detail -<\/B> The composition of the List Mix entry. Contains the List ID, mix order, percentages and statuses that make up this List Mix. The percentages always have to add up to 100, and the lists all have to be active and set to the campaign for the order mix entry to be Activated|Detalhes da Mescl. de Lista - Composição da Mesclagem de listas. Contém o ID, ordem, percentuais, e status que montam essa Mesclagem. Os percentuais devem sempre somar 100, e as listas devem estar ativas e configuradas na campanha em que a mesclagem vai ser configurada| +List Mix Method -<\/B> The method of mixing all of the parts of the List Mix Detail together. EVEN_MIX will mix leads from each part interleaved with the other parts, like this 1,2,3,1,2,3,1,2,3. IN_ORDER will put the leads in the order in which they are listed in the List Mix Detail screen 1,1,1,2,2,2,3,3,3. RANDOM will put them in RANDOM order 1,3,2,1,1,3,2,1,3. Default is IN_ORDER.|Método de Mesclagem - O método de Mesclagem de todos os ítens da lista. EVEN_MIX mistura os registros de cada parte intercalados com as outras partes, por exemplo: 1,2,3,1,2,3,1,2,3. IN_ORDER irá colocar os registros na ordem que estão listados na tela de detalhes 1,1,1,2,2,2,3,3,3. RANDOM irá colocar em ordem randômica: 1,3,2,1,1,3,2,1,3. O padrão é IN_ORDER.| +LIST MIXES FOR THIS CAMPAIGN: |MESCLAGEM DE LISTAS PARA ESTA CAMPANHA:| +The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls.|O campo RESPOSTA HUMANA(human_answered) é usado quando é calculado o percentual de desligamento(drop), ou índice de abandono. Configurando como Y irá usar este status quando for contar chamadas atendidas por humanos| +HUMAN ANSWER|RESPOSTA HUMANA| +ADDING VICIDIAL SYSTEM STATUSES|INCLUINDO STATUS DE SISTEMA DO VICIDIAL| +MODIFY VICIDIAL SYSTEM STATUSES|ALTERAR STATUS DE SISTEMA DO VICIDIAL| +SYSTEM STATUS NOT ADDED|STATUS DE SISTEMA NÃO INCLUÍDO| +SYSTEM STATUS ADDED|STATUS DE SISTEMA INCLUÍDO| +SYSTEM STATUS NOT DELETED|STATUS DE SISTEMA NÃO REMOVIDO| +the system status cannot be a reserved status: |el estado de sistema no puede ser un estado reservado:| +the system status needs to be at least 1 characters in length|el estado de sistema necesita ser por lo menos los caracteres 1 enlongitud| +VICIDIAL STATUSES WITHIN THIS SYSTEM: |ESTADOS DE VICIDIAL DENTRO DE ESTE SISTEMA:| +ADD NEW SYSTEM STATUS|INCLUIR STATUS DE SISTEMA| +CUSTOM CAMPAIGN STATUSES LISTINGS:|LISTA DE STATUS CUSTOMIZADOS:| +CAMPAIGN HOTKEYS LISTINGS:|LISTA DE ATALHOS DA CAMPANHA:| +CAMPAIGN LEAD RECYCLE LISTINGS:|LISTA DE RECICLAGEM DE REGISTROS:| +LEAD RECYCLES|RECICLAGEM DE REGISTROS| +CAMPAIGN LEAD AUTO-ALT DIAL LISTINGS:|LISTA DE DISC. ALTERN. DE REG.:| +CAMPAIGN AGENT PAUSE CODE LISTINGS:|LISTA DE CÓDIGOS DE PAUSA DE AGENTE:| +CAMPAIGN LIST MIX LISTINGS:|LISTA DE MESCLAGEM DE LISTA DE REGISTROS:| +The Category option allows you to group several statuses into a catogy that can be used for statistical analysis.|A opção de categoria permite agrupar vários status em uma categoria que podem ser usados para análise estatística.| +MODIFY VICIDIAL STATUS CATEGORIES|ALTERAR CATEGORIA DE STATUS| +ADDING VICIDIAL STATUS CATEGORY|INCLUIR CATEGORIA DE STATUS| + Status Categories |Categoria de Status| + System Statuses |Status do Sistema| +MODIFY VICIDIAL SYSTEM STATUSES|ALTERAR STATUS DE SISTEMA| +MODIFY VICIDIAL STATUS CATEGORY|ALTERAR CATEGORIA DE STATUS| +Through the use of system statuses, you can have statuses that exist for campaign and in-group. The Status must be 1-6 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as an agent disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a catogy that can be used for statistical analysis|Com o uso do status do sistema, você pode ter status que existem para campanhas e grupos de entrada. O Status deve ter entre 1 e 6 caracteres de comprimento, a descrição deve ter entre 2 e 30 caracteres de comprimento e Selecionável define se será mostrado no VICIDIAL na finalização da chamada. O campo human_answered é usado para calcular o percentual de drop, ou índice de abandono. Configurando human_answered para Y irá usar este status quando contando as chamadas atendidas por humanos. A opção de Categoria permite agrupar vários status em uma categoria que pode ser usada para análise estatística| +Through the use of system status categories, you can group together statuses to allow for statistical analysis on a group of statuses. The Category ID must be 2-20 characters in length with no spaces, the name must be 2-50 characters in length, the description is optional and TimeonVDAD Display defines whether that status will be one of the upto 4 statuses that can be calculated and displayed on the Time On VDAD Real-Time report|Através do uso de categoria de status de sistema, você pode agrupar status para permitir análise estatística em um grupo de status. O ID da categoria deve ter entre 2 e 20 caracteres sem espaços, o nome deve ter entre 2 e 50 caracteres, a descrição é opicional e o Mostrar TimeonVDAD define se o status deve ser um dos 4 status que podem ser calculados e mostrados no relatório em tempo real Time On VDAD | +ADD NEW STATUS CATEGORY|INCLUIR CATEG. DE STATUS| +STATUS CATEGORY NOT ADDED|CATEGORIA NÃO INCLUIDA| +there is already a status category in the system with this ID|já existe uma categoria de status com esse ID no sistema| +ID must be between 2 and 20 characters in length|ID deve ter entre 2 e 20 caracteres | +name name must be between 2 and 50 characters in length|o nome deve ter entre 2 e 50 caracteres| +STATUS CATEGORY NOT MODIFIED|CATEGORIA NÃO ALTERADA| +the status category cannot be a reserved category: |a categoria de status não pode ser uma categoria reservada:| +the status category needs to be at least 2 characters in length|a categoria de status precisa ter pelo menos 2 caracteres| +STATUS CATEGORY DELETED|CATEGORIA REMOVIDA| +STATUS CATEGORY MODIFIED|CATEGORIA ALTERADA| +Category: |Categoria:| +the system status name needs to be at least 1 characters in length|o nome do status deve ter pelo menos 1 caractere de comprimento| +SYSTEM STATUS NOT MODIFIED|STATUS DO SISTEMA NÃO ALTERADO| +SYSTEM STATUS MODIFIED|STATUS DO SISTEMA ALTERADO| +ERROR: There are already 4 Status Categories set to TimeOnVDAD Display|ERRO: Já existem 4 Categorias de Status no Relatório TimeOnVDAD| +CUSTOM CAMPAIGN STATUS MODIFIED|STATUS CUSTOMIZADO ALTERADO| +LIST MIX NOT MODIFIED|MESCLAGEM DE LISTA NÃO ALTERADA| +LIST MIX MODIFIED|MESCLAGEM DE LISTA ALTERADA| +You cannot delete the last list_id entry from a list mix|Você não pode apagar a última entrada de lista para uma mesclagem de lista| +LIST MIX ADDED: |MESCLAGEM INCLUÍDA:| +LIST MIX NOT ADDED |MESCLAGEM NÃO INCLUÍDA| +There is already a list mix with this ID in the system|Já existe uma mesclagem de lista com esse ID no sistema| +LIST MIX NOT DELETED|MESCLAGEM NÃO REMOVIDA| +LIST MIX DELETED: |MESCLAGEM REMOVIDA:| +SET TO ACTIVE|ATIVAR| +LIST MIX NOT ACTIVATED|MESCLAGEM NÃO ATIVADA| +LIST MIX ACTIVATED|MESCLAGEM ATIVADA| +Enable Agent Transfer Logfile -<\/B> This option will log to a text logfile on the webserver every time a call is transferred to an agent. Default is 0, disabled|Habilitar Log de Transf.- Esta opção irá gravar um regsitro de ocorrências em um arquivo no servidor web cada vez que uma chamada for transferida para um agente. O padrão é 0, desabilitado| +Enable Agent Transfer Logfile|Habilitar Log de Transferências| +Call Time -<\/B> This is the call time scheme to use for this inbound group. Keep in mind that the time is based on the server time. Default is 24hours|Horário de Chamada É a configuração do horário de chamada para ser usado neste grupo de entrada. Lembre-se que o horário é baseado no horário do servidor. Padrão é 24Horas| +After Hours Action -<\/B> The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field. Default is MESSAGE|Ação Fora de Expediente- A ação a ser tomada se a ligação for feita fora do horário estabelecido para esse grupo de entrada. HANGUP irá desligar imediatamente a chamada, MESSAGE irá tocar o arquivo definido no campo Arquivo de Mensagem Fora de Expediente, EXTENSION irá enviar a chamada para uma extensão do plano de discagem e VOICEMAIL irá enviar a chamada para a caixa postal listada no campo Voicemail Fora do Expediente. Padráo é MESSAGE| +After Hours Message Filename -<\/B> The audio file located on the server to be played if the Action is set to MESSAGE. Default is vm-goodbye|Arquivo Fora do Expediente - O arquivo de audio localizado no servidor, que deve ser tocado quando a ação estiver configurada como MESSAGE. Padrão é vm-goodbye| +After Hours Extension -<\/B> The dialplan extension to send the call to if the Action is set to EXTENSION. Default is 8300|Extensão Fora do Expediente - Extensão a ser enviada a chamada que entrar se o campo Ação estiver como EXTENSION. O padrão é 8300| +After Hours Voicemail -<\/B> The voicemail box to send the call to if the Action is set to VOICEMAIL|Voicemail Fora do Expediente- A caixa de VoiceMail a ser enviada a chamada, quando o campo Ação for VOICEMAIL| +Welcome Message Filename -<\/B> The audio file located on the server to be played when the call comes in. If set to ---NONE--- then no message will be played. Default is ---NONE---|Arquivo de Mensagem Boasvindas - Arquivo de audio localizado no servidor a ser tocado quando uma chamada entra. Se estiver configurado como ---NONE--- então nenhuma mensagem irá ser tocada. O padrão é ---NONE---| +Music On Hold Context -<\/B> The music on hold context to use when the customer is placed on hold. Default is default|Contexto da Música de Espera- O contexto de Música de Espera a ser usado quando o cliente é colocado em espera. O padrão é default| +On Hold Prompt Filename -<\/B> The audio file located on the server to be played at a regular interval when the customer is on hold. Default is generic_hold. This audio file MUST be 9 seconds or less in length.|Arquivo de Mensagem de Espera - Arquivo de audio localizado no servidor a ser tocado em um intervalo regular quando o cliente está em espera. O padrão é generic_hold. Este arquivo de audio deve ter até 9 segundos| +On Hold Prompt Interval -<\/B> The length of time in seconds to wait before playing the on hold prompt. Default is 60|Intervalo de Anúncio - O tempo em segundos para esperar até tocar a mensagem de Espera. O padrão é 60| +Agent Alert Extension -<\/B> The extension to send into the agent session to announce that a call is coming to the agent. This extension should have a Playback of an audio file. To not use this function set this to X. Default is X|Extensão de Alerta do Agente - É a extensão para enviar para a sessão do agente o anuncio da chamada entrante. Esta extensão deve ter um Playback de um arquivo de audio. Para não usar esta função, configure como X. O padrão é X| +Agent Alert Delay -<\/B> The length of time in milliseconds to wait before sending the call to the agent after playing the on Agent Alert Extension. Default is 1000|Atraso de Alerta ao Agente - O tempo em milisegundos para esperar antes de enviar a chamada para o agente após tocar na extensão do agente. O padrão é 1000| +Call Time: |Horário de Chamada:| +After Hours Action: |Ação Fora do Expediente:| +After Hours Message Filename: |Arquivo Fora do Expediente:| +After Hours Extension: |Extensão Fora do Expediente:| +After Hours Voicemail: |Voicemail Fora do Expediente:| +Welcome Message Filename: |Arquivo de Boas Vindas:| +Music On Hold Context: |Contexto da Música de Espera:| +On Hold Prompt Filename: |Arquivo de Aviso de Espera| +On Hold Prompt Interval: |Intervalo de Aviso de Espera:| +Agent Alert Extension: |Extensão de Alerta ao Agente:| +Agent Alert Delay: |Atraso de Alerta ao Agente:| +You will also be able to set the rank, or skill level, in this section for each of the inbound groups as well as being able to see the number of calls received from each inbound group for this specific agent|Você também poderá configurar o ranking, ou nível de conhecimento, nessa sessão para cada grupo de entrada, assim como será capaz de ver o número de chamadas recebidas por cada grupo de entrada por agente específico| +Allow Inbound and Blended -<\/B> This is where you can set whether the users of this campaign will have the option to take inbound calls with this campaign. If you want to do blended inbound and outbound then this must be set to Y. If you only want to do outbound dialing on this campaign set this to N. Default is N|Permitir Entrantes e Blended - Aqui é onde se configura se o usuário desta campanha irá ter a opção de receber chamadas entrantes nesta campanha. Se você quiser mesclar entrantes e saintes, deve estar configurado como Y. Se você quer apenas fazer chamadas saintes nesta campnaha, configure como N. O padrão é N| +Allow Inbound and Blended: |Permitir Entrantes e Blended:| +Manual Dial List ID -<\/B> The default list_id to be used when an agent placces a manual call and a new lead record is created in vicidial_list. Default is 999. This field can contain digits only|ID da Lista Manual - O list_id padrão para ser usado quando um agente faz uma chamada manual e novos registros são criados na vicidial_list. O padrão é 999. O campo pode receber somente digitos| +Manual Dial List ID: |ID da Lista Manual :| +inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest|inbound_group_rank: ordena pelo ranking dado para um agente para um grupo de entrada. Do mais alto para o mais baixo| +fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first|fewest_calls: ordena pelo número de chamadas recebidas por um agente para o grupo de entrada específico. Menor qtd de chamadas primeiro| +Campaign Ranks: |Rankings da Campanha:| +AGENT RANKS FOR THIS CAMPAIGN:|RANKING DO AGENTE NA CAMPANHA:| +Copy Campaign|Copiar Campanha| +COPY A CAMPAIGN|COPIAR CAMPANHA| +Source Campaign: |Campanha Origem:| +New Copied Campaign Addition|Inclusão de Campanha Copiada| +Copy In-Group|Copiar Grupo de Entrada| +New Copied In-Group Addition|Inclusão de Grupo de Entrada Copiada| +Copy User|Copiar Usuário| +New Copied User Addition|Inclusão de Usuário Copiado| +COPY USER|COPIAR USUÁRIO| +Copy In-Group|Copiar Grupo de Entrada| +COPY INBOUND GROUP|COPIAR GRUPO DE ENTRADA| +campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest|campaign_rank: ordena pelo ranking dado para o agente na campanha. Mais alto para Mais baixo| +Default Transfer Group -<\/B> This field is the default In-Group that will be automatically selected when the agent goes to the transfer-conference frame in their agent interface|Grupo de Transf. Padrão - Este campo é o Grupo de Entrada padrão que será automaticamente selecionado quando um agente seleciona transferência-conferência na tela do agente| +Default Transfer Group: |Grupo de Transferência Padrão:| +Allowed Transfer Groups: |Grupos de Transferência Permitidos:| +Allowed Transfer Groups -<\/B> With these checkbox listings you can select the groups that agents in this campaign can transfer calls to. Allow Closers must be enabled for this option to show up|Grupos de Transferência Permitidos - Nessa lista você pode selecionar grupos para os quais os agentes nessa campanha podem transferir chamadas. Permitir Finalizadores (closers) deve estar habilitado para que esta opção seja mostrada| +Campaign Ranks -<\/B> In this section you can define the rank an agent will have for each campaign. These ranks can be used to allow for preferred call routing when Next Agent Call is set to campaign_rank|Rankings da Campanha - Nessa sessão você define o ranking que cada agente terá em cada campanha. Esses rankings podem ser usados para permitir roteamento preferencial de chamadas quando o campo Próximo Agente está como campaign_rank| +Also in this section is the ability to give the agent a rank for each inbound group. These ranks can be used for preferred call routing when that option is selected in the in-group screen|Também nessa sessão está a possibilidade de atribuir um ranking do agente para cada Grupo de Entrada. Esses rankings podem ser usados para roteamento preferencial quando essa opção está selecionada na tela de Grupos de Entrada| +### START translations for 2.0.5 release ### +QC Enabled -<\/B> This option allows the user to log in to the Quality Control agent screen|CQ Habilitado - Esta opção permite ao usuário logar na tela de agente de Controle de Qualidade| +QC User Level -<\/B> This setting defines what the agent Quality Control user level is. This will dictate the level of functionality for the agent in the QC section|Nível de usuário CQ - Esta configuração define qual é o nível do usuário do Controle de Qualidade. Isso irá ditar o nível de funcionalidade desse agente na seção de CQ| +QC Record Pass -<\/B> This option allows the agent to specify that a record has passed the first round of QC after reviewing the record|Registro Passou no CQ - Esta opção permite ao agente especificar que um registro passou no primeiro nível de Controle de Qualidade após revisar o registro| +QC Record Finish -<\/B> This option allows the agent to specify that a record has finished the second round of QC after reviewing the passed record|Finalizado no CQ - Esta opção permite ao agente especificar que um registro finalizou o segundo nível de Controle de Qualidade após revisar o registro| +QC Record Commit -<\/B> This option allows the agent to specify that a record has been committed in QC. It can no longer be modified by anyone|Confirmado no CQ - Esta opção permite ao agente especificar que um registro foi Confirmado no Controle de Qualidade. E não poderá ser alterado por ninguém| +QC Allowed Campaigns -<\/B> This is a selectable list of Campaigns which members of this user group will be able to QC. The ALL-CAMPAIGNS option allows the users in this group to QC any campaign on the system|Campanha com CQ - Esta lista selecionável de campanhas tem os membros para esse grupo de usuários que terão habilitado o controle de qualidade. A opcão ALL-CAMPAIGNS permite ao usuário neste grupo fazer controle de qualidade em qualquer campanha do sistema| +QC Allowed Inbound Groups -<\/B> This is a selectable list of Inbound Groups which members of this user group will be able to QC. The ALL-GROUPS option allows the users in this user group to QC any inbound group on the system|Permitir CQ de Entrada- Esta é uma lista selecionável de Grupos de Entrada aos quais os membros deste grupo de usuários podem realizar Controle de Qualidade. A opção ALL-GROUPS permite que usuários deste grupo fazer Controle de Qualidade em qualquer grupo do sistema| +QC Enabled: |CQ Ativado:| +QC User Level: |Nível de Usuário CQ:| +QC Pass: |Passou no CQ:| +QC Finish: |Fim do CQ:| +QC Commit: |Confirmado CQ:| +Modify Nothing|Não Modificar Nada| +Modify Nothing Except Status|Não Modificar Nada Exceto Status| +Modify All Fields|Modificar Todos Campos| +Verify First Round of QC|Verificar primeiro nível de CQ| +View QC Statistics|Vizualizar Estatísticas de CQ| +Ability to Modify FINISHed records|Capacidade de Alterar Registros Finalizados| +Manager Level|Nível Gerente| +USERS CAN VIEW ANY CAMPAIGN|USUÁRIOS PODEM VER QUALQUER CAMPANHA| +USERS CAN QC ANY CAMPAIGN|USUÁRIOS PODEM FAZER CQ EM QUALQUER CAMPANHA| +USERS CAN QC ANY INBOUND GROUP|USUÁRIOS PODEM FAZER CQ EM QUALQUER GRUPO DE ENTRADA| +QC Allowed Campaigns: |Campanhas Permitidas no CQ:| +QC Allowed Inbound Groups: |Grupos de Entrada para CQ:| +Queue Priority -<\/B> This setting is used to define the order in which the calls from this outbound campaign should be answered in relation to the inbound calls if this campaign is in blended mode|Prioridade da Fila - Valor utilizado para definir a ordem na qual as chamadas dessa campanha de saída devem ser respondidas em relação as chamadas entrantes desta campanha em modo blended| +Queue Priority: |Prioridade da Fila:| +Drop Action: |Ação de Drop:| +Drop Transfer Group: |Grupo de Transferência de Drop:| +Drop Action -<\/B> This menu allows you to choose what happens to a call when it has been waiting for longer than what is set in the Drop Call Seconds field. HANGUP will simply hang up the call, MESSAGE will send the call the Drop Exten that you have defined below, VOICEMAIL will send the call to the voicemail box that you have defined below and IN_GROUP will send the call to the Inbound Group that is defined below|Ação de Drop - Este menu permite que você escolha o que acontece com uma chamada quando esta ficou esperando mais que o tempo configurado no campo Tempo Limite de Drop. HANGUP irá simplesmente desligar a chamada, MESSAGE irá enviar a chamada para Extensão de Drop que você definiu abaixo, VOICEMAIL irá enviar a chamada para a caixa de voicemail que você definiu abaixo e IN_GROUP irá enviar a chamada para o grupo de entrada que você define abaixo| +Drop Exten -<\/B> If Drop Action is set to MESSAGE, this is the dial plan extension that the call will be sent to if it reaches Drop Call Seconds|Extensão de Drop - Se a Ação de Drop estiver configurada como MESSAGE, este é o número do plano de discagem a ser discado para transferir a chamada após o tempo limite de drop| +Drop Call Seconds -<\/B> The number of seconds a call will stay in queue before being considered a DROP|Tempo Limite de Drop- O número em segundos que uma chamada deve ficar na fila de espera até ser considerada um DROP| +Drop Transfer Group -<\/B> If Drop Action is set to IN_GROUP, the call will be sent to this inbound group if it reaches Drop Call Seconds|Grupo de Transferência de Drop - Caso a Ação de Drop esteja configurada como IN_GROUP, a chamada será enviada para esse Grupo de Entrada após o tempo limite| +QC SETTINGS FOR THIS CAMPAIGN|CONFIGURAÇÕES DE CQ PARA CAMPANHA| +QC Enabled: |CQ Ativado:| +QC Statuses: |Status de CQ:| +Modify Campaign QC Settings|Alterar Configurações de CQ| +QC Enabled -<\/B> Setting this field to Y allows for the agent Quality Control features to work. Default is N|CQ Ativado - Configurando este campo como Y permite que os recursos de Controle de Qualidade do agente funcionem. O padrão é N| +QC Statuses -<\/B> This area is where you select which statuses of leads should be gone over by the QC system. Place a check next to the status that you want QC to review|Status de CQ - Esta área é onde você escolhe quais status de registro devem passar pelo Controle de Qualidade. Selecione o status que você quer que o CQ revise| +QC SETTINGS NOT MODIFIED|CONFIG. DE CQ NÃO ALTERADAS| +QC SETTINGS MODIFIED|CONFIG. DE CQ ALTERADAS| +QC WebForm Address -<\/B> This is the website address that a QC agent can go to when clicking on the WEBFORM link in the QC screen|Endereço WebForm de CQ - Este é o endereço do websitem que o agente de CQ pode entrar quando clicar no botão WEBFORM na tela de CQ| +QC Script -<\/B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen|Script CQ - Este é o Script que pode ser usado pelos agentes de CQ na aba SCRIPT na tela de CQ| +QC WebForm: |WebForm de CQ:| +QC Script|Script de CQ| +In-Group Recording Override -<\/B> This field allows for the overriding of the campaign call recording setting. This setting can be overridden by the vicidial_user recording override setting. DISABLED will not override the campaign recording setting. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording|Sobreposição de Gravação de Entrada - Este campo permite a sobreposição da configuração da gravação na campanha. Esta configuração pode ser sobreposta pela configuração de sobreposição de gravação do usuário. DISABLED não irá sobrepor a configuração da campanha. NEVER irá desabilitar a gravação no client. ONDEMAND é o padrão e permite ao agente iniciar e finalizar a gravação conforme necessário. ALLCALLS irá iniciar a gravação no client quando uma chamada é enviada ao agente. ALLFORCE irá iniciar gravação no client sempre que uma ligação é enviada ao agente sem dar opção ao agente de parar a gravação| +In-Group Recording Filename -<\/B> This field will override the Campaign Recording Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE|Nome do Arquivo de Gravação de Entrada- Este campo irá sobrepor o perfil de nome de arquivo de gravação da campanha, a não ser que esteja configurado como NONE. As variáveis permitidas são: CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. O padrão é FULLDATE_AGENT e irá ficar assim: 20051020-103108_6666. Outro exemplo é CAMPAIGN_TINYDATE_CUSTPHONE que irá ficar assim: TESTCAMP_51020103108_3125551212. 50 caracteres no máximo. Padrão é NONE| +In-Group Recording Override: |Sobrepor Config. de Grav. de Entr.:| +In-Group Recording Filename: |Arquivo de Gravação de Entrada:| +ADDING VICIDIAL QC STATUS CODE|INCLUINDO CÓDIGO DE STATUS DE CQ| +MODIFY VICIDIAL QC STATUS CODE|ALTERAR CÓDIGO DE STATUS DE CQ| +VICIDIAL QC STATUS CODES|CÓDIGOS DE STATUS DE CONTROLE DE QUALIDADE| +The Quality Control-QC system within VICIDIAL has its own set of status codes separate from those within the call handling functions of VICIDIAL. QC statuse codes must be between 2 and 8 characters in length and contain no special characters like a space or colon. The QC status code description must be between 2 and 30 characters in length.|O sistema de Controle de Qualidade do VICIDIAL tem seu conjunto de status separados daqueles usados na finalização de chamadas do VICIDIAL. Os códigos de CQ devem ter entre 2 e 8 caracteres de comprimento e não podem conter caracteres especiais como espaços ou virgulas. A descrição do código de status de CQ deve ter entre 2 e 30 caracteres| + QC Status Codes |Cód. de Status CQ| +VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM: |CÓDIGOS DE STATUS DE CQ NESTE SISTEMA VICIDIAL:| +ADD NEW QC STATUS CODE|INCLUIR CÓDIGO DE CQ| +QC STATUS CODE NOT DELETED|CÓDIGO DE STATUS CQ NÃO REMOVIDO| +QC STATUS CODE DELETED: |CÓDIGO DE STATUS CQ REMOVIDO:| +QC STATUS CODE NOT MODIFIED |CÓDIGO DE STATUS CQ NÃO ALTERADO| +QC STATUS CODE MODIFIED: |CÓDIGO DE STATUS CQ ALTERADO:| +the qc status code needs to be at least 1 characters in length|o código de status cq precisa ter pelo menos 1 caracter de comprimento| +the qc status code name needs to be at least 1 characters in length|o nome do status cq precisa ter pelo menos 1 caracter de comprimento| +QC STATUS CODE NOT ADDED |CÓDIGO DE STATUS CQ NÃO INCLUÍDO| +there is already a qc status code in the system with this name:|já existe um código de status cq no sistema com esse nome:| +QC STATUS CODE ADDED: |CÓDIGO DE STATUS CQ ADICIONADO:| +code must be between 1 and 8 characters in length|código deve ter entre 1 e 8 caracteres de comprimento| +code name must be between 2 and 30 characters in length|nome do código deve ter entre 2 e 30 caracteres de comprimento| +CALL HANGUP REASON STATS|ESTATÍSTICA DE MOTIVO DE DESLIGAMENTO| +After Hours Action -<\/B> The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field, IN_GROUP will send the call to the inbound group selected in the After Hours Transfer Group select list. Default is MESSAGE|Ação Fora do Expediente - A ação a ser realizada se o horário for fora do definido no horário de chamada para este grupo de entrada. HANGUP irá imediatamente desligar a chamada, MESSAGE irá tocar o arquivo no campo Arquivo de Mensagem Fora de Expediente, EXTENSION irá enviar a chamada para o extensão do campo Extensão Fora do Expediente no plano de discagem e VOICEMAIL irá enviar a chamada para a caixa de voicemail listada no campo de Voicemail Fora do Expediente, IN_GROUP irá enviar a chamada para o grupo de entrada selecionado na lista Grupo de Entrada Fora do Expediente. Padrão é MESSAGE| +After Hours Transfer Group -<\/B> If After Hours Action is set to IN_GROUP, the call will be sent to this inbound group if it enters the in-group outside of the call time scheme defined for the in-group|Grupo de Transferência Fora do Expediente- Se a Ação de Fora do Expediente estiver configurada para IN_GROUP, a chamada irá ser enviada para esse grupo de entrada se ela entrar neste grupo de entrada fora do horário configurado no Horário de Chamadas para este grupo de entrada| +After Hours Transfer Group: |Grupo de Transferência Fora do Exped.:| +Total calls taken in to this In-Group:|Total de chamadas recebidas pelo Grupo:| +CALL HOLD TIME BREAKDOWN IN SECONDS|TEMPO DE ESPERA POR SEGUNDOS| +Date Range:|Período:| +ADDING NEW PHONE ALIAS|INCLUINDO ALIAS DE RAMAL| +ADD NEW PHONE ALIAS|INCLUIR ALIAS DE RAMAL| +MODIFY PHONE ALIAS|ALTERAR ALIAS DE RAMAL| +DELETE PHONE ALIAS|REMOVER ALIAS DE RAMAL| +PHONE ALIAS LIST|LISTA DE ALIAS DE RAMAL| +Phone Alias List|Lista de Alias de Ramal| +Add A New Phone Alias|Incluir Alias de Ramal| +ADD A NEW PHONE ALIAS|INCLUIR ALIAS DE RAMAL| +Alias ID: |ID do Alias:| +Alias Name: |Nome do Alias: | +Phone Logins List: |Lista de Logins de Ramal:| +PHONE ALIAS NOT ADDED|ALIAS DE RAMAL NÃO INCLUIDO| +there is already a Phone Alias in the system with this ID|já existe um Alias de Ramal no sistema com esse ID| +there is already a Phone Login in the system with this ID|ja existe um Login no sistema com esse ID| +PHONE ALIAS ADDED|ALIAS DE RAMAL INCLUÍDO| +PHONE ALIAS NOT MODIFIED|ALIAS DE RAMAL NÃO ALTERADO| +PHONE ALIAS MODIFIED|ALIAS DE RAMAL ALTERADO| +PHONE ALIAS NOT DELETED|ALIAS DE RAMAL NÃO REMOVIDO| +PHONE ALIAS DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE ALIAS| +Click here to delete phone alias|Clique aqui para remover o alias de ramal| +PHONE ALIAS DELETION COMPLETED|REMOÇÃO DO ALIAS DE RAMAL CONCLUÍDA| +PHONE ALIAS LISTINGS|LISTAGEM DE ALIAS DE RAMAL| +there is already a Phone alias in the system with this login|já existe um alias de Ramal no sistema com esse login| +there is already a Phone in the system with this login|já existe um Ramal no sistema com este login| +DELETE THIS PHONE ALIAS|REMOVER ESTE ALIAS DE RAMAL| +MODIFY A PHONE ALIAS RECORD|ALTERAR UM ALIAS DE RAMAL| +Alias ID -<\/B> The ID of the alias used to allow for phone load balanced logins. no spaces or other special characters allowed. Must be between 2 and 20 characters in length|ID do Alias - O ID do alias usado para permitir balanceamento de carga entre ramais. Não é permitido espacos ou caracteres especiais. Deve ter entre 2 e 20 caracteres| +Alias Name -<\/B> The name used to describe a phones alias, Must be between 2 and 50 characters in length|Nome do Alias - O nome usado para descrever o alias do ramal, deve ter entre 2 e 50 caracteres| +Phones Logins List -<\/B> The comma separated list of phone logins used when an agent logs in using phone load balanced logins. The Agent application will find the active server with the fewest agents logged into it and place a call from that server to the agent upon login|Lista de Logins de Ramais - Uma lista, separada por vírgulas, logins de ramais usados quando o agente está usando ramais do balanceamento de carga. O aplicativo agente irá encontrar o servidor ativo com a menor quantidade de agentes logados e fazer a chamada a partir daquele servidor para o agente no login| +PHONES WITHIN THIS PHONES ALIAS|RAMAIS DESTE ALIAS| +Add New Shift|Incluir Turno| +New Shift Addition|Inclusão de Turno| +Modify Shift|Alterar Turno| +Delete Shift|Remover Turno| +Shifts|Turnos| +Shift ID -<\/B> This is the short name of a Vicidial Shift Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters|ID do Turno- Este é o nome curto para uma definicao de Turno. Precisa ser um identificador único. Não usar pontos ou espaços para este campo, máximo de 20 e mínimo de 2 caracteres| +Shift Name -<\/B> This is a more descriptive name of the Shift Definition. This is a short summary of the Shift definition. max 50 characters, minimum of 2 characters|Nome do Turno - Este é um nome mais descritivo da definição do turno. É um resumo da definição do turno. Máximo de 50 caracteres, mínimo de 2 caracteres| +Shift Start Time -<\/B> This is the time that the campaign shift begins. Must only be numbers, 9:30 AM would be 0930 and 5:00 PM would be 1700|Início do Turno- É o horário que o turno da campanha começa. Deve ter apenas números, 9:30 seria apenas 0930 e 17:00 seria 1700| +Shift Length -<\/B> This is the time in Hours and Minutes that the campaign shift lasts. 8 hours would be 08:00 and 7 hours and 30 minutes would be 07:30|Duração do Turno - Este é o tempo em horas e minutos que dura o turno. 8 horas seria 08:00 e 7 horas e 30 minutos seria 7:30| +Shift Weekdays -<\/B> In this section you should choose the days of the week that this shift is active|Dias do Turno - Nesta sessão você deve escolher os dias da semana em que este turno funciona| +Show Shifts|Mostrar Turnos| +Add A New Shift|Incluir Turno| +Shift ID: |ID do Turno:| +Shift Name: |Nome do Turno:| +Shift Start Time: |Início do Turno:| +Shift End Time: |Final do Turno:| +SHIFT DEFINITION NOT ADDED|CONFIGURAÇÃO DE TURNO NÃO INCLUÍDA| +there is already a shift entry with this ID|já existe uma entrada de turno com este ID| +Shift ID and name must be at least 2 characters in length|ID e Nome do turno devem ter pelo menos 2 caracteres| +Shift Start Time must be 4 digits in length and be a valid time|Horário de início deve ter 4 caracteres e ser um horário válido| +Shift Length must be 5 characters in length and be 24 hours or less|Duração do Turno deve ter 5 caracteres e 24 horas ou menos| +SHIFT ADDED: |TURNO INCLUÍDO:| +MODIFY A SHIFT|ALTERAR TURNO| +USER GROUPS USING THIS SHIFT:|GRUPOS DE USUÁRIO USANDO ESTE TURNO:| +DELETE THIS SHIFT DEFINITION|REMOVER ESTE TURNO| +MODIFY A SHIFT|ALTERAR TURNO| +SHIFT NOT DELETED|TURNO NÃO REMOVIDO| +SHIFT DELETION CONFIRMATION: |CONFIRMAÇÃO DE REMOÇÃO DE TURNO:| +Click here to delete shift|Clique aqui para remover o turno| +SHIFT DELETION COMPLETED:|REMOÇÃO DE TURNO FINALIZADA:| +SHIFT MODIFIED|TURNOS ALTERADOS| +SHIFT LISTINGS:|LISTA DE TURNOS:| +Shift Weekdays: |Dias do Turno:| +Sunday|Domingo| +Monday|Segunda| +Tuesday|Terça| +Wednesday|Quarta| +Thursday|Quinta| +Friday|Sexta| +Saturday|Sábado| +Group Shifts: |Turnos do Grupo:| +Group Shifts -<\/B> This is a selectable list of shifts that can restrict the agents login time on the system|Turnos do Grupo - Esta é uma lista selecionável de turnos que podem restringir o login do agente no sistema| + Timeclock|Relógio Ponto| +Timeclock End Of Day -<\/B> This setting defines when all users are to be auto logged out of the timeclock system. Only runs once a day. must be only 4 digits 2 digit hour and 2 digit minutes in 24 hour time. Default is 0000|Fim do dia - Esta configuração define quando os usuários devem ser retirados do sistema de ponto automaticamente. Só roda uma vez por dia. Deve ter somente 4 caracteres, 2 para hora e 2 para os minutos no formato 24 horas. O padrão é 0000| +Timeclock Last Auto Logout -<\/B> This field displays the date of the last auto-logout|Último Logout Automático do Ponto - Este campo mostra a data do último logout automático -| +Timeclock Last Auto Logout: |Último Logout Automático do Ponto:| +Timeclock End Of Day: |Timeclock Final do Dia:| +SURVEY SETTINGS FOR THIS CAMPAIGN:|CONFIG. DE PESQUISA PARA ESTA CAMPANHA:| +Modify Campaign Survey|Alterar Campanha de Pesquisa| +Survey First Audio File -<\/B> This is the audio filename that is played as soon as the customer picks up the phone when running a survey campaign.|Primeiro Audio da Pesquisa - Este é o nome do arquivo de audio que é tocado assim que o cliente atende o telefone em uma campanha de pesquisa.| +Survey DTMF Digits -<\/B> This field is where you define the digits that a customer can press as an option on a survey campaign. valid dtmf digits are |Digitos DTMF da Pesquisa - Este campo é onde você define os digitos que um cliente pode digitar como opção para campanha de pesquisa. Digitos válidos são | +Survey Not Interested Digit -<\/B> This field is where you define the customer digit pressed that will show they are Not Interested.|Digito de Não Interessado - Este campo é onde você define qual digito o cliente aperta para dizer que não está interessado.| +Survey Not Interested Status -<\/B> This field is where you select the status to be used for Not Interested. If DNC is used and the campaign is set to use DNC then the phone number will be automatically added to the VICIDIAL internal DNC list.|Status de Não Interessado - Este campo é onde você seleciona o status a ser usado para Não Interessado. Se o DNC for usado e a campanha estiver configurada para Bloquear DNC então o número do telefone irá automaticamente para a lista de Não Ligar do VICIDIAL.| +Survey Opt-in Audio File -<\/B> This is the audio filename that is played when the customer has opted-in to the survey, not opted-out or not responded if the no-response-action is set to OPTOUT. After this audio file is played, the Survey Method action is taken.|Arquivo de Aceito - Este é o arquivo de audio que é tocado quando o cliente aceita participar da pesquisa, não respondeu "não interessado" e não respondeu, se a opção de ação sem resposta for OPTOUT. Após esse arquivo de audio ser tocado, a ação do método de pesquisa é realizada | +Survey Not Interested Audio File -<\/B> This is the audio filename that is played when the customer has opted-out of the survey, not opted-in or not responded if the no-response-action is set to OPTIN. After this audio file is played, the call will be hung up|Arquivo de Não Interessado - Este é o nome do arquivo de audio que é tocado quando o cliente desistiu da pesquisa, não aceitou a pesquisa ou não respondeu, caso a ação para sem resposta seja OPTIN. Após este arquivo de audio ser tocado, a chamada será desligada| +Survey Method -<\/B> This option defines what happens to a call after the customer has opted-in. AGENT_XFER will send the call to the next available agent. VOICEMAIL will send the call to the voicemail box that is specified in the Voicemail field. EXTENSION will send the customer to the extension defined in the Survey Xfer Extension field. HANGUP will hang up the customer. CAMPREC_60_WAV will send the customer to have a recording made with their response, this recording will be placed in a folder named as the campaign inside of the Survey Campaign Recording Directory.|Método de Pesquisa - Esta opção define o que acontece com uma chamada após o cliente ter aceitado a pesquisa. AGENT_XFER irá enviar a chamada para o próximo agente disponível. VOICEMAIL irá enviar a chamada para o voicemail especificado no campo Voicemail. EXTENSION irá enviar o cliente para uma extensão definida no campo Extensão de Transf. HANGUP irá desligar o cliente. CAMPREC_60_WAV irá enviar o cliente para que grave uma resposta, esta gravação ficará na pasta com o nome da campanha, dentro do diretório de gravações da Campanha de Pesquisa| +Survey No-Response Action -<\/B> This is where you define what will happen if there is no response to the survey question. OPTIN will only send the call on to the Survey Method if the customer presses a dtmf digit. OPTOUT will send the customer on to the Survey Method even if they do not press a dtmf digit.|Ação p/ Sem Resposta - Aqui é definido o que acontece se não há resposta para a pergunta da pesquisa. OPTIN só irá enviar a chamada para o método de pesquisa se o cliente apertar algum digito DTMF. OPTOUT irá enviar o cliente para o método mesmo que ele não pressione um dígito.| +Survey Response Digit Map -<\/B> This is the section where you can define a description to go with each dtmf digit option that the customer may select.| Mapa de Digitos de Resposta - Aqui você pode definir uma descrição para representar cada dígito que o cliente pode selecionar| +Survey Xfer Extension -<\/B> If the Survey Method of EXTENSION is selected then the customer call would be directed to this dialplan extension|Extensão de Transfer. - Se o método de pesquisa selecionado for EXTENSION o cliente será transferido para esta extensão do plano de discagem| +Survey Campaign Recording Directory -<\/B> If the Survey Method of CAMPREC_60_WAV is selected then the customer response will be recorded and placed in a directory named after the campaign inside of this directory.|Diretório de Gravação - Se o método de pesquisa selecionado for CAMPREC_60_WAV então o cliente poderá gravar uma mensagem que será colocada no diretório com o nome da campanha, dentro deste diretório| +SURVEY SETTINGS NOT MODIFIED|CONFIGURAÇÃO DE PESQUISA NÃO ALTERADA| +SURVEY SETTINGS MODIFIED|CONFIGURAÇÃO DE PESQUISA ALTERADA| +Survey First Audio File|Primeiro Arquivo de Audio| +Survey DTMF Digits|Dígitos DTMF| +Survey Not Interested Digit|Dígito p/ Não Interessado| +Survey Not Interested Status|Status p/ Não Interessado| +Survey Opt-in Audio File|Arquivo de Audio para Interessado| +Survey Not Interested Audio File|Arquivo de Audio para não Interessado| +Survey Method|Método de Pesquisa| +Survey No-Response Action|Ação p/ sem Resposta| +Survey Response Digit Map|Mapa de Digitos| +Survey Xfer Extension|Extensão de Transfer.| +Survey Campaign Recording Directory|Diretório de Gravações da Pesquisa| +Add Timeclock Log Record -<\/B> This option allows the user to add records to the timeclock log|Incluir Registro de Ponto - Esta opção permite ao usuário adicionar registros de log ao Relógio de Ponto| +Modify Timeclock Log Record -<\/B> This option allows the user to modify records in the timeclock log|Alterar Registro de Log do Ponto - Esta opção permite ao usuário alterar os registros do log do Relógio de ponto| +Delete Timeclock Log Record -<\/B> This option allows the user to delete records in the timeclock log|Remover Registro de Log do Ponto - Esta opção permite ao usuário remover registros do log do relógio de ponto| +Add Timeclock Log Record|Incluir Registro de Ponto| +Modify Timeclock Log Record|Alterar Registro de Log do Ponto| +Delete Timeclock Log Record|Remover Registro de Log do Ponto| +USER GROUP TIMECLOCK STATUS REPORT|RELATÓRIO DE STATUS DE RELÓGIO DE PONTO| +Click here to see the Timeclock Status for this user group|Clique aqui para ver o Status de Relógio de ponto para este usuário| +ADD NUMBERS TO THE DNC LIST|INCLUIR NÚMEROS PARA LISTA DE BLOQUEIO| +Phone Numbers: |Números de Telefone:| +one phone number per line only|somente um telefone por linha| +VICIDIAL DNC List -<\/B> This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add numbers to this list so that they will not be called by campaigns that use the internal DNC list|Lista de Bloqueio do VICIDIAL - Esta lista de bloqueio contém cada registro que foi enviado para um status de Não Ligar no sistema. Através da página: LISTAS - INCLUIR BLOQUEIO você pode manualmente adicionar números para esta lista para que não sejam ligados por campanhas que usam a lista de bloqueio interna| + Time Sheet |Planilha de Horário| +Timeclock Record Edit|Alteração de Ponto| +Default date format with year month day|Formato de data Padrão com ano mês dia| +USA date format with month day year|Formato de data dos EUA com mês dia ano| +European date format with day month year|Formato de data Europeu com dia mês ano| +Text date format with abbreviated month day|Formato de data abreviada em texto com mes e dia| +followed by 24 hour time|seguido por horário 24 horas| +followed by 12 hour time|seguido por horário 12 horas| +Agent Screen Header Date Format -<\/B> This menu allows you to choose the format of the date that shows up at the top of the VICIDIAL agent screen. The options for this setting are: default is|Formato da data do cabeçalho da tela do agente - Este menu permite você escolher o formato da data que é mostrada na parte de cima da tela do agente. As opções para esta configuração são: o padrão é| +Agent Screen Customer Date Format -<\/B> This menu allows you to choose the format of the customer time zone date that shows up at the top of the Customer Information section of the VICIDIAL agent screen. The options for this setting are: default is|Formato da data do cliente na tela do agente - Este menú permite você selecionar o formato para a data no fuso horário do cliente que aparece no topo das informações sobre o cliente na tela do agente. As opções para esta configuração são: o padrão é| +Agent Screen Customer Phone Format -<\/B> This menu allows you to choose the format of the customer phone number that shows up in the status section of the VICIDIAL agent screen. The options for this setting are: default is|Formato do Telefone do Cliente na Tela do Agente - Este menú permite escolher o formato do telefone do cliente que é mostrado na seção de status da tela do agente. As opções são: o padrão é| +dash separated phone number|número separado por traço| +dash separated number with area code in parenthesis|número separado por traço, ddd entre parentesis| +No formatting|Sem Formatação| +with space after city code|com espaço após o código da cidade| +space separated phone number|número separado por espaços| +Agent Screen Header Date Format|Formato da Data no Cabeçalho da tela do Agente| +Agent Screen Customer Date Format|Formato da Data do Cliente na tela do Agente| +Agent Screen Customer Phone Format|Formato do Número do Telefone na tela do Agente| +ERROR- There is a problem with the data that you entered, please go back|ERRO - Existe um problema com os dados digitados, por favor retorne| +A timeclock session cannot overlap another timeclock session|Uma sessão de Ponto não pode sobrepor outra sessão de ponto| +Disable Alter Customer Phone -<\/B> If set to Y, does not change the customer phone number when an agent dispositions the call. Default is Y|Desab. Alterar Telefone do Cliente - Se configurado como Y, não altera o telefone do cliente quando um agente finaliza a chamada. O padrão é Y| +Agent API Access -<\/B> This option allows the account to be used with the vicidial agent API commands|Agente para Acesso ao API - Esta opção permite esta conta ser usada com comandos de API| +Agent Alter Customer Phone Override -<\/B> This option will override whatever the option is in the campaign for altering of customer phone number. NOT_ACTIVE will use whatever setting is present for the campaign. ALLOW_ALTER will always allow for the agent to alter the customer phone number, no matter what the campaign setting is. Default is NOT_ACTIVE|Sobrepor Permissão de Alter. de Telefone- Esta opção irá sobrepor qualquer configuração na campanha sobre alterar o telefone do cliente. NOT_ACTIVE irá usar a configuração presente na campanha. ALLOW_ALTER irá sempre permitir que o agente altere o telefone do cliente, não importando a configuração da campanha. O padrão é NOT_ACTIVE| +Agent API Active -<\/B> If set to 1, this will allow the Agent API interface to function. Default is 0|API do Agente Ativa - Se configurado como 1, irá permitir que a interface API do agente Funcione. O padrão é 0| +Agent Alter Customer Phone Override: |Sobrepor Permissão de Alter. de Telefone:| +Agent API Access: |Agente para Acesso ao API:| +Disable Alter Customer Phone: |Desab. Alterar Telefone do Cliente :| +Agent API Active: |API do Agente Ativa:| +Agent Display Queue Count -<\/B> If set to Y, when a customer is waiting for an agent, the Queue Calls display at the top of the agent screen will turn red and show the number of waiting calls. Default is Y|Mostrar Contagem da Fila ao Agente - Quando configurada como Y, quando um cliente está esperando um agente, será demonstrado na tela do agente a quantidade de clientes em espera. O padrão é Y| +Agent Display Queue Count: |Mostrar Clientes em Espera ao Agente:| +agents in dead calls|agentes em chamadas perdidas| +QC Last Pull Time: |Última Hora de Retirada do CQ:| +and less than 43200 seconds or 12 hours|e menos de 43200 segundos ou 12 horas| +LEADS AT LIMIT|REGISTROS NO LIMITE| +Lead counts taken from active lists in the campaign only|Contagem de registros tirada das listas ativas nesta campanha| +QC Get Record Launch-<\/B> This allows one of the following actions to be triggered upon a QC agent receiving a new record|Entrada do Registro de CQ - Isso permite uma das seguintes ações a ser ativada na entrada de um registro de CQ para um agente| +QC Show Recording -<\/B> This allows for a recording that may be linked with the QC record to be display in the QC agent screen|Mostrar Gravação do CQ - Permite que uma gravação que está ligada com o registro do CQ seja mostrada na tela do agente de CQ| +QC Shift -<\/B> This is the shift timeframe used to pull QC records for a campaign. The days of the week are ignored for these functions|Turno de CQ- Este é o controle de tempo usado para trazer registros de uma campanha para o CQ. Os dias da semana são ignorados para esta função| +QC Get Record Launch|Entrada de registro CQ| +QC Show Recording|Mostrar Gravações CQ| +QC Shift|Turno de CQ| +Inbound Group QC Settings|Config. de CQ para Entrantes| +QC Shift -<\/B> This is the shift timeframe used to pull QC records for an inbound_group. The days of the week are ignored for these functions|Turno de CQ - Este é o turno usado pelo CQ para trazer registros de CQ para um grupo de entrada. Os dias da semana são ignorados para estas funções| +The Sale Category and Dead Lead Category are both used by the List Suggestion system when analyzing list statistics.|A Categoria de Venda e a Categoria Registro Ruim são ambas usadas pelo sistema de Sugestão de Listas quando analisando as estatisticas da lista.| +Sale Category: |Categoria de Venda:| +Dead Lead Category: |Categoria de Registro Ruim:| +Manual Dial Filter -<\/B> This allows you to filter the calls that agents make in manual dial mode for this campaign by any combination of the following: DNC - to kick out, CAMPAIGNLISTS - the number must be within the lists for the campaign, NONE - no filter on manual dial or fast dial lists|Filtro de Discagem Manual - Permite que você filtre as chamadas que os agentes fazem no modo manual de discagem para esta campanha por uma combinação dos seguintes: DNC - para tirar, CAMPAIGNLISTS - o número deve estar nas lístas para a campanha, NONE - sem filtros na discagem manual ou lista de discagem rápida | +Manual Dial Filter: |Filtro de Discagem Manual:| +Agent Screen Clipboard Copy -<\/B> THIS FEATURE IS CURRENTLY ONLY ENABLED FOR INTERNET EXPLORER. This feature allows you to select a field that will be copied to the computer clipboard of the agent computer upon a call being sent to an agent. Common uses for this are to allow for easy pasting of account numbers or phone numbers into legacy client applications on the agent computer|Cópia p/ Área de Transf. do Agente - ESTE RECURSO SÓ FUNCIONA NO INTERNET EXPLORER. Este recurso permite que você escolha um campo que será copiado para a área de transferência do agente quando uma chamada é enviada ao agente. Um uso comum para este recurso é permitir fácil uso do comando "colar" para números do cliente ou números de telefone em aplicativos cliente no computador do agente| +Agent Screen Clipboard Copy|Cópia p/ Área de Transf. do Agente| +EXTENDED alternate numbers are numbers loaded into the system outside of the standard lead information screen. Using EXTENDED you can have hundreds of phone numbers for a single customer record.|EXTENDIDOS são números alternativos que são carregados no sistema fora da tela padrão de informações sobre registros. Usando EXTENDED você pode ter centenas de números de telefone para um único registro de cliente. | +Agent Screen Extended Alt Dial -<\/B> This feature allows for agents to access extended alternate phone numbers for leads beyond the standard Alt Phone and Address3 fields that can be used in VICIDIAL for phone numbers beyond the main phone number. The Extended phone numbers can be dialed automatically using the Auto-Alt-Dial feature in VICIDIAL Campaign settings, but enabling this Agent Screen feature will also allow for the agent to call these numbers from their agent screen as well as edit their information|Discagem Extendida na tela do Agente - Este recurso permite ao agente acessar a lista extendida de telefones alternativos para o registro, além dos campos Alt Phone e Address3, que podem ser usados no vicidial para números de telefone além do telefone principal do cliente. Os números extendidos podem ser discados automaticamente usando-se o recurso Auto-Alt-Dial nas config. da campanha, mas habilitar isso na tela do Agente irá permitir ao agente ligar para estes números a partir da tela e também alterar essas informações| +Agent Screen Extended Alt Dial:|Discagem Extendida na tela do Agente :| +Use Campaign DNC List -<\/B> This defines whether this campaign is to filter leads against a DNC list that is specific to that campaign only. If it is set to Y, the hopper will look for each phone number in the campaign-specific DNC list before placing it in the hopper. If it is in the campaign-specific DNC list then it will change that lead status to DNCC so it cannot be dialed. Default is N.|Usar Lista de Bloqueio - Este recurso define se a campanha deve filtrar registros usando a lista de Bloqueio que é específica para esta campanha. Se configurado como Y, o hopper irá procurar cada número na lista específica de Bloqueio antes de colocar o número na lista do hopper. Se estiver em uma lista específica de Bloqueio, então ele irá alterar o status do registro para DNCC para que este registro não seja discado. O padrão é N| +Use Campaign DNC List|Usar Lista de Bloqueio| +and possibly the campaign-specific DNC list|e possivelmente a lista específica de bloqueio| +There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them|Existe também a opção de incluir registros em listas de bloqueio específicas de campanhas| +NOTE: Copying a campaign will copy all settings from the master campaign you select, but it will not copy a campaign-specific DNC list if there was one on the selected master campaign|ATENÇÃO: Copiar uma campanha irá copiar todas as configurações da campanha que você escolher, mas não irá copiar a lista de bloqueio específica da campanha que você selecionar| +Add New |Incluir| +Copy |Copiar| +New DID Addition|Incluir DDR| +New Copied DID Addition|Inclusão de DDR por cópia| +Modify |Alterar| +Delete |Remover| +Play Place in Line -<\/B> This defines whether the caller will hear their place in line when they enter the queue as well as when they hear the announcemend. Default is N|Tocar Posição na Fila - Isto define se o cliente irá ouvir seu lugar na fila de atendimento quando entram na fila e também periodicamente. O padrão é N| +Play Estimated Hold Time -<\/B> This defines whether the caller will hear the estimated hold time before they are transferred to an agent. Default is N|Tocar Tempo Estimado - Isto define se o cliente irá ouvir o tempo estimado de espera antes de ser transferido para um agente. O padrão é N| +Hold Time Option -<\/B> This allows you to specify the routing of the call if the estimated hold time is over the amount of seconds specified below. Default is NONE|Opção de Tempo de Espera - Permite que você especifique uma rota para a chamada caso o tempo de espera esteja superior a quantidade de segundos configurada abaixo. O padrão é NONE| +Hold Time Option Seconds -<\/B> If Hold Time Option is set to anything but NONE, this is the number of seconds of estimated hold time that will trigger the hold time option. Default is 360 seconds|Tempo de Opção de Espera - Se a opção de tempo de espera estiver configurado para um valor diferente de NONE, este número em segundos de tempo estimado de atendimento irá acionar esta opção de espera. O padrão é 360 segundos| +Hold Time Option Extension -<\/B> If Hold Time Option is set to EXTENSION, this is the dialplan extension that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|Extensão de Opção de Tempo - Se a Opção de Tempo de Espera estiver como EXTENSION, esta extensão do plano de discagem será usada para enviar a chamada quando o tempo de espera superar a configuração de tempo de espera| +Hold Time Option Voicemail -<\/B> If Hold Time Option is set to VOICEMAIL, this is the voicemail box that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|VoiceMail da Opção de Espera - Se a Opção de Espera estiver como VOICEMAIL, esta é a caixa de voicemail que a chamada será direcionada, caso o tempo de espera exceda o tempo configurado na opção de tempo| +Hold Time Option Transfer In-Group -<\/B> If Hold Time Option is set to IN_GROUP, this is the inbound group that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds|Gr. de Entr. da Opção de Espera - Se a Opção de Espera for IN_GROUP, este grupo de entrada será usado para transferir a chamada que entrar e o tempo de espera estimado for maior que o tempo da opção.| +Hold Time Option Callback Filename -<\/B> If Hold Time Option is set to CALLERID_CALLBACK, this is the filename prompt that is played before the call is logged as a new lead to the list ID specified below if the estimated hold time exceeds the Hold Time Option Seconds|Arquivo de Agendamento da Espera - Se a configuração de Opção de Tempo de Espera estiver como CALLERID_CALLBACK, esse arquivo será tocado e então a chamada será considerada com status de novo para a lista abaixo se o tempo estimado de espera exceder o tempo configurado| +Hold Time Option Callback List ID -<\/B> If Hold Time Option is set to CALLERID_CALLBACK, this is the List ID the call is added to as a new lead if the estimated hold time exceeds the Hold Time Option Seconds|ID da Lista de Agendamento de Espera - Se a Opção de Tempo de Espera estiver como CALLERID_CALLBACK, esta é a ID da lista na qual a chamada é adicionada como novo registro caso o tempo de chamada exceda o tempo definido na configuração | +Hold Recall Transfer In-Group -<\/B> If a customer calls back to this in-group more than once and this is not set to NONE, then the call will automatically be sent on to the In-Group selected in this field. Default is NONE|Grupo de Rechamada de Espera- Se um cliente liga de volta para este grupo de entrada mais de uma vez e esta config. estiver como NONE, então a chamada é automaticamente desviada para o Grupo de Entrada selecionado neste campo. O padrão é NONE| +No Delay Call Route -<\/B> Setting this to Y will remove all wait times and audio prompts and attempt to send the call right to an agent. Does not override welcome message or on hold prompt settings. Default is N|Rotear Sem Atraso - Configurando como Y irá remover qualquer tempo de espera ou anuncios de audio e irá tentar enviar a chamada direto para o agente. Não sobrepõe mensagem de boas vindas e anuncios da fila de espera. O padrão é N| +Play Welcome Message -<\/B> These settings select when to play the defined welcome message, ALWAYS will play it every time, NEVER will never play it, IF_WAIT_ONLY will only play the welcome message if the call does not immediately go to an agent, and YES_UNLESS_NODELAY will always play the welcome message unless the NO_DELAY setting is enabled. Default is ALWAYS|Tocar Mensagem de Boas Vindas - Esta configuração seleciona quando tocar mensagens de boas vindas, ALWAYS irá tocar toda vez, NEVER nunca irá tocar, IF_WAIT_ONLY irá somente tocar a mensagem se a chamada não for diretamente para o agente, e YES_UNLESS_NODELAY irá sempre tocar a mensagem a não ser que a configuração de Sem Atraso estiver habilitada. O padrão é ALWAYS| +Play Place in Line: |Tocar Lugar na Fila:| +Play Estimated Hold Time: |Tocar Tempo Estimado:| +Hold Time Option: |Opção de Espera:| +Hold Time Option Seconds: |Tempo de Opção de Espera:| +Hold Time Option Extension: |Extensão de Opção de Espera:| +Hold Time Option Voicemail: |Voicemail da Opção de Espera:| +Hold Time Option Transfer In-Group: |Grupo de Entrada da Opção de Espera:| +Hold Time Option Callback Filename: |Arq. de Agend. da Opção de Espera:| +Hold Time Option Callback List ID: |Lista de Agend. da Opção de Espera:| +Hold Recall Transfer In-Group: |Grupo de Transferência de Rechamada:| +No Delay Call Route: |Rotear sem Atrasos:| +Play Welcome Message: |Tocar Mens. de Boas Vindas:| +DID Extension -<\/B> This is the number, extension or DID that will trigger this entry and that you will route within the system using this function|Extensão DDR- Este é o número, extensão ou DDR que irá acionar esta entrada e que você irá rotear no sistema usando este recurso| +DID Description -<\/B> This is the description of the DID routing entry|Descrição do DDR - Esta é a descrição do roteamento ao DDR| +DID Active -<\/B> This the field where you set the DID entry to active or not. Default is Y|DDR Ativo - Este é o campo que você configura se o DDR está ativo ou não. O padrão é Y| +DID Route -<\/B> This the type of route that you set the DID to use. EXTEN will send calls to the extension entered below, VOICEMAIL will send calls directly to the voicemail box entered below, AGENT will send calls to a VICIDIAL agent if they are logged in, PHONE will send the call to a phones entry selected below, IN_GROUP will send calls directly to the specified inbound group. Default is EXTEN|Rota DDR - Este é o tipo de rota que seu DDR irá usar. EXTEN irá enviar as chamadas para a extensão abaixo, VOICEMAIL irá enviar as chamadas para uma caixa de voicemail digitada abaixo, AGENT irá enviar as chamadas para um agente do VICIDIAL se ele estiver logado no sistema, PHONE irá enviar a chamada para um ramal configurado abaixo, IN_GROUP irá enviar as chamadas diretamente para um grupo de entrada especificado abaixo. O padrão é EXTEN| +Extension -<\/B> If EXTEN is selected as the DID Route, then this is the dialplan extension that calls will be sent to. Default is 9998811112, no-service|Extensão - Se EXTEN for selecionado como rota, então este é a extensão do plano de discagem que as chamadas serão enviadas. O padrão é 999811112, sem-serviço| +Extension Context -<\/B> If EXTEN is selected as the DID Route, then this is the dialplan context that calls will be sent to. Default is default|Contexto da Extensão - Se EXTEN estiver selecionado como Rota do DDR, então este é o contexto do plano de discagem para o qual as chamadas serão enviadas. O padrão é default| +Voicemail Box -<\/B> If VOICEMAIL is selected as the DID Route, then this is the voicemail box that calls will be sent to. Default is empty|Caixa de VoiceMail - Se VOICEMAIL estiver selecionado como rota de DDR, então esta é a caixa de voicemail que a chamada deve ser enviada. O padrão é vazio| +Phone Extension -<\/B> If PHONE is selected as the DID Route, then this is the phone extension that calls will be sent to.|Extensão do Ramal - Se PHONE estiver selecionado na rota DDR, então esta é a extensão do ramal que as chamadas serão enviadas.| +Phone Server IP -<\/B> If PHONE is selected as the DID Route, then this is the server IP for the phone extension that calls will be sent to|IP do Servidor do Ramal - Se PHONE estiver selecionado como rota DDR, então este é o IP do servidor do ramal que as chamadas devem ser enviadas| +User Agent -<\/B> If AGENT is selected as the DID Route, then this is the VICIDIAL Agent that calls will be sent to|Usuário do Agente - Se AGENT estiver selecionado como rota DDR, então este é o agente do vicidial que as chamadas devem ser enviadas| +User Unavailable Action -<\/B> If AGENT is selected as the DID Route, and the user is not logged in or available, then this is the route that the calls will take|Ação p/ Usuário não Dispon. - Se AGENT estiver selecionado como rota de DDR, e o usuário não estiver logado ou disponível, então esta é a rota que as chamadas serão direcionadas| +User Route Settings In-Group - If AGENT is selected as the DID Route, then this is the In-Group that will be used for the queue settings as the caller is waiting to be sent to the agent. Default is AGENTDIRECT|Config. de Grupo de Entr. do Agente - Se AGENT estiver selecionado como roda DDR, então este é o grupo de entrada que irá ser usado para configurações de fila na qual o cliente ficará esperando para ser direcionado ao agente. O padrão é AGENTDIRECT| +In-Group ID -<\/B> If IN_GROUP is selected as the DID Route, then this is the In-Group that calls will be sent to|ID do Grupo de Entr. - Se IN_GROUP estiver selecionado como rota de DDR, então este é o grupo de entrada a ser enviadas as chamadas| +In-Group Call Handle Method -<\/B> If IN_GROUP is selected as the DID Route, then this is the call handling method used for these calls. CID will add a new lead record with every call using the CallerID as the phone number, CIDLOOKUP will attempt to lookup the phone number by the CallerID in the entire system, CIDLOOKUPRL will attampt to lookup the phone number by the CallerID in only one specified list, CIDLOOKUPRC will attampt to lookup the phone number by the CallerID in all of the lists that belong to the specified campaign, CLOSER is specified for VICIDIAL Closer calls, ANI will add a new lead record with every call using the ANI as the phone number, ANILOOKUP will attempt to lookup the phone number by the ANI in the entire system, ANILOOKUPRL will attampt to lookup the phone number by the ANI in only one specified list, XDIGITID will prompt the caller for an X digit code before the call will be put into the queue. Default is CID|Método de Manuseio do Grupo de Entrada - Se IN_GROUP estiver selecionado como rota de DDR, então este é o método usado para manusear estas chamadas. CID irá incluir um registro de chamada para cada chamada usando o CallerID como número do telefone, CIDLOOKUP irá tentar localizar o número do telefone pelo CallerID no sistema inteiro, CIDLOOKUPRL irá tentar localizar o número do telefone somente em uma lista específica, CIDLOOKUPRC irá tentar encontrar o número do telefone em todas as listas que pertencem a uma campanha específica, CLOSER é especificado para chamadas de finalização, ANI irá incluir um novo registro para cada chamada usando o ANI como número de telefone, ANILOOKUP irá tentar procurar o telefone pelo ANI no sistema todo, ANILOOKUPRL irá tentar localizar o telefone pelo ANI somente na lista especificada, XDIGITID irá pedir para o cliente uma quantidade de dígitos antes da chamada ser colocada na fila. O padrão é CID| +In-Group Agent Search Method -<\/B> If IN_GROUP is selected as the DID Route, then this is the agent search method to be used by the inbound group, LO is Load-Balanced-Overflow and will try to send the call to an agent on the local server before trying to send it to an agent on another server, LB is Load-Balanced and will try to send the call to the next agent no matter what server they are on, SO is Server-Only and will only try to send the calls to agents on the server that the call came in on. Default is LB|Método de Busca do Grupo de Entrada - Se IN_GROUP estiver selecionado na rota de DDR, então este é o método de pesquisa do agente a ser usado pelo grupo de entrada, LO é Balanceamento de Carga com Transbordo e irá tentar enviar a chamada para um agente no servidor local antes de tentar enviar para outro servidor, LB é balanceamento de carga e tentará enviar a chamada para o próximo agente não importando o servidor que estiver logado, SO é Somente Servidor e tentará enviar a chamada somente para agentes no mesmo servidor da chamada. O padrão é LB| +In-Group List ID -<\/B> If IN_GROUP is selected as the DID Route, then this is the List ID that leads may be searched through and that leads will be inserted into if necessary|ID da Lista do Grupo de Entrada- Se IN_GROUP estiver selecionado como rota de DDR, então este é o ID da lista que os registros devem ser pesquisados e onde o novo registro será incluído se necessário| +In-Group Campaign ID -<\/B> If IN_GROUP is selected as the DID Route, then this is the Campaign ID that leads may be searched for in if the call handle method is CIDLOOKUPRC|ID da Camp. do Grp. de Entrada- Se IN_GROUP estiver selecionado como rota de DDR, então este é o ID da campanha que os registros devem ser procurados quando o método de pesquisa for CIDLOOKUPRC| +In-Group Phone Code -<\/B> If IN_GROUP is selected as the DID Route, then this is the Phone Code used if a new lead is created|Código do Tel. de Entrada - Se IN_GROUP estiver selecionado como rota de DDR, então este é o código de telefone usado para um novo registro| +Phones Email -<\/B> The email address associated with this phone entry. This is used for voicemail settings|Email do Ramal - Endereço de email associado ao ramal. Isto pode ser usado para configurações de VoiceMail| +ADD A NEW DID|INCLUIR DDR| +DID Extension: |Extensão DDR:| +DID Description: |Descrição DDR:| +COPY DID|COPIAR DDR| +Source DID: |DDR Origem:| +DID NOT ADDED|DDR NÃO INCLUÍDO| +there is already a DID in the system with this ID|já existe um DDR com este ID no sistema| +there is already a DID in the system with this extension|já existe um DDR com esta extensão no sistema| +DID NOT MODIFIED|DDR NÃO ALTERADO| +DID MODIFIED|DDR ALTERADO| +MODIFY A DID RECORD: |ALTERAR UM REGISTRO DDR:| +DID Route: |Rota DDR:| +Extension: |Extensão:| +Extension Context: |Contexto da Extensão:| +Voicemail Box: |Caixa do Voicemail:| +Phone Extension: |Extensão do Ramal:| +User Agent: |Agente:| +User Unavailable Action: |Ação p/ Agente não Disponível:| +User Route Settings In-Group: |Config. de Rota de Entrada do Agente:| +In-Group ID: |ID do Grp. de Entrada:| +In-Group Call Handle Method: |Método de Manuseio de Chamada Entrante:| +In-Group Agent Search Method: |Método de Busca de Agente p/ Ch. Entr.:| +In-Group List ID: |ID da Lista de Entrada:| +In-Group Campaign ID: |ID da Campanha de Entrada:| +In-Group Phone Code: |Código do Ramal de Entrada:| +DELETE THIS DID|REMOVER DDR| +Email: |Email:| +DID NOT DELETED|DDR NÃO REMOVIDO| +DID DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DO DDR| +Click here to delete |Clique aqui para remover| +DID DELETION COMPLETED|REMOÇÃO DO DDR FINALIZADA| +Delete DIDs: |Remover DDRs:| +Modify DIDs: |Alterar DDRs:| +To disable the On Hold Prompt, set the interval to 0|Para desabilitar a Mensagem em Espera, configuro o intervalo como 0| +3-Way Call Outbound CallerID -<\/B> This defines what is sent out as the outbound callerID number from 3-way calls placed by the agent, CAMPAIGN uses the custom campaign callerID, CUSTOMER uses the number of the customer that is active on the agents screen and AGENT_PHONE uses the callerID for the phone that the agent is logged into|CallerID de Chamada a 3 - Isso define o que é enviado como número do CallerID em chamadas a 3 realizadas pelo agente. CAMPAIGN usa o CallerID customizado da campanha, CUSTOMER usa o número do cliente que está ativo na tela do agente e AGENT_PHONE usa o callerID do ramal que o agente está logado| +3-Way Call Outbound CallerID:|CallerID de Chamada a 3:| +INBOUND_MAN allows the agent to place manual dial calls from a campaign list while being able to take inbound calls between manual dial calls|INBOUND_MAN permite ao agente fazer chamadas manuais a partir de uma campanha enquanto está disponível para receber chamadas entrantes, entre as chamadas manuais| +FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button|FORCE irá forçar o agente escolher um código de pausa se eles clicar no botão pausa| +3-Way Call Dial Prefix -<\/B> This defines what is used as the dial prefix for 3-way calls, default is empty so the campaign dial prefix is used, passthru so you can hear ringing is 88|Prefixo para Chamadas a 3 - Isso define o que será usado como prefixo de discagem nas chamadas a 3, o padrão é vazio, então o prefixo da campanha é usado, uma alternativa para se ouvir tocar é 88| +3-Way Call Dial Prefix|Prefixo para chamadas a 3| +Force Timeclock Login -<\/B> This option allows you to not let an agent log in to the VICIDIAL agent interface if they have not logged into the timeclock. Default is N. There is an option to exempt admin users, levels 8 and 9|Forçar Login no Ponto - Esta opção permite você não deixar um agente entrar na interface de agente do VICIDIAL se ele não estiver logado no sistema de relógio de ponto. O padrão é N. Existe uma opção para isentar usuários admin, níveis 8 e 9| +Force Timeclock Login|Forçar Login no Ponto| +Stats Percent of Calls Answered Within X seconds - This field allows you to set the number of hold seconds that the realtime stats display will use to calculate the percentage of answered calls that were answered within X number of seconds on hold|Percentual Estatístico de Chamadas Atendidas em X seg - Este campo permite você configurar o número de segundos que a tela de estatísticas em tempo real demorará para calcular o percentual de chamadas atendidas que foram atendidas antes de X segundos em espera| +Stats Percent of Calls Answered Within X seconds|Percentual Estatístico de Chamadas Atendidas em X seg| +Web Form Target-<\/B> This is where you can set the custom web page frame that the web form will be opened in when the user clicks on the WEB FORM button. Default is _blank.|Target do Form. Web- Esta configuração é onde você coloca o frame da página que o formulário web irá ser aberto quando o usuário clica no botão WEB FORM. O padrão é _blank.| +Web Form Target|Target do Form. Web| +To customize the query string after the web form, simply begin the web form with VAR and then the URL that you want to use, replacing the variables with the variable names that you want to use --A--phone_number--B-- just like in the SCRIPTS tab section|Para personalizar a string de pesquisa do formulário web, simplesmente inicie o formulário web com VAR e então a URL que você quer usar, substituindo as variáveis com os nomes de variável que você quer usar --A--phone_number--B-- da mesma forma que na seção SCRIPTS| +Recording Web Link -<\/B> This setting allows you to override the default of the display of the recording link in the admin web pages. Default is SERVER_IP|Link Web de Gravação - Esta configuração permite que você altere o padrão do link apresentado na tela de gravação no site admin. O padrão é SERVER_IP| +Alternate Recording Server IP -<\/B> This setting is where you can put a server IP or other machine name that can be used in place of the server_ip in the links to recordings within the admin web pages. Default is empty|IP do Serv. Altern. de Gravação- Esta configuração é onde você pode colocar um IP do servidor ou outro nome de máquina que pode ser usado para colocar no lugar do server_ip nos links de gravação nas páginas do site admin. O padrão é vazio| +Recording Web Link|Link Web de Gravação| +Enable Vtiger Integration -<\/B> This setting allows you to enable Vtiger integration with VICIDIAL. Currently links to Vtiger admin and search as well as user replication are the only integration features available. Default is 0|Habilitar Integração com Vtiger - Esta configuração permite que seja habilitada a integração entre VICIDIAL e VTIGER. Atualmente o único tipo de integração disponível são links para o site de administração, pesquisa e replicação do cadastro de usuários. O padrão é 0| +Vtiger DB Server IP -<\/B> This is the IP address of the database for your Vtiger installation|IP do Serv. BD Vtiger - É o endereço IP do servidor de banco de dados da instalação do Vtiger| +Vtiger Database Name -<\/B> This is the database name for your Vtiger database|Base de Dados Vtiger - Este é o nome da base de dados para o Vtiger| +Vtiger Database Login -<\/B> This is the user name used to log in to your Vtiger database|Login do BD do Vtiger - É o nome do usuário usado para acessar o BD do Vtiger| +Vtiger Database Password -<\/B> This is the password used to log in to your Vtiger database|Senha do BD Vtiger - É a senha usada para acessar o BD do Vtiger| +Vtiger URL -<\/B> This is the URL or web site address used to get to your Vtiger installation|URL do Vtiger - Esta é a URL ou endereço do site usado para acessar o Vtiger| +Enable Vtiger Integration:|Habilitar Integração com Vtiger:| +Vtiger DB Server IP|IP do Servidor Vtiger| +Vtiger Database Name|Base de Dados do Vtiger| +Vtiger Database Login|Login do BD do Vtiger| +Vtiger Database Password|Senha do BD do Vtiger| +Vtiger URL|URL do Vtiger| +VTIGER HOME|VTIGER HOME| +Active -<\/B> This field defines whether the user is active in the system and can use VICIDIAL resources. Default is Y|Ativo - Este campo define se o usuário está ativo no sistema e pode usar os recursos do VICIDIAL. O padrão é Y| +show only active users|mostrar somente usuários ativos| +show all users|mostrar todos usuários| +Vtiger Search Category -<\/B> If Vtiger integration is enabled in the system settings then this setting will define where the vtiger_search.php page will search for the phone number that was entered. There are 4 options that can be used in this field: LEAD- This option will search through the Vtiger leads only, ACCOUNT- This option will search through the Vtiger accounts and all contacts and sub-contacts for the phone number, VENDOR- This option will only search through the Vtiger vendors, ACCTID- This option works only for accounts and it will take the vicidial vendor_lead_code field and try to search for the Vtiger account ID. If unsuccessful it will try any other methods listed that you have selected. Multiple options can be used for each search, but on large databases this is not recommended. Default is LEAD|Categoria de Pesquisa Vtiger- Se a integração do Vtiger estiver habilitada no sistema então esta configuração irá definir onde a página vtiger_search.php irá pesquisar o número do telefone que foi digitado. Existem 4 opções que podem ser usadas nesse campo: LEAD- Esta opção irá pesquisar apenas nos registros do Vtiger, ACCOUNT- Esta opção irá pesquisar nas contas do Vtiger e todos os contatos e sub-contatos para o número do telefone, VENDOR- Esta opção irá apenas pesquisar nos vendedores do Vtiger, ACCTID- Esta opção funciona somente para contas e irá pegar o campo vendor_lead_code no vicidial e tentará procurar no ID da conta do Vtiger. Se nao tiver sucesso irá tentar outros métodos listados que você selecionou. Múltiplas opções podem ser usadas para pesquisa, mas em bases de dados grandes não é recomendado. O padrão é LEAD| +Vtiger Search Category:|Categoria de Pesquisa Vtiger:| +ACTIVE LISTS CHANGED|LISTAS ATIVAS ALTERADAS| +SUBMIT ACTIVE LIST CHANGES|ENVIAR ALTERAÇÕES EM LISTAS ATIVAS| +LAST CALL DATE|ÚLTIMA CHAMADA| +User Group Bulk Change|Troca de Grupo de Usuário em Lote| +Bulk Group Change|Troca de Grupo em lote| +Vtiger Create Call Record -<\/B> If Vtiger integration is enabled in the system settings then this setting will define whether a new Vtiger activity record is created for the call when the agent goes to the vtiger_search page. Default is Y|Vtiger Cria Registro de Chamada - Se a integração com Vtiger estiver habilitada, esta configuração define se um registro de atividade do Vtiger é gravado quando o agente entra na página de pesquisa do vtiger (vtiger_search). O padrão é Y| +Vtiger Create Call Record:|Criar Registro de Chamada no Vtiger:| +Vtiger Create Lead Record -<\/B> If Vtiger integration is enabled in the system settings and Vtiger Search Category includes LEAD then this setting will define whether a new Vtiger lead record is created when the agent goes to the vtiger_search page and no record is found to have the call phone number. Default is Y|Criar Registro de Tel. no Vtiger- Se a integração com o Vtiger estiver habilitada no sistema e a Categoria de Pesquisa no Vtiger incluir LEAD, esta configuração define se um novo registro da chamada do Vtiger é criado quando o agente entra na página de pesquisa do vtiger e o registro não é encontrado para que se tenha um número de telefone. O padrão é Y| +Vtiger Create Lead Record:|Criar Registro de Tel. no Vtiger:| +Vtiger Screen Login -<\/B> If Vtiger integration is enabled in the system settings then this setting will define whether the user is logged into the Vtiger interface automatically when they login to VICIDIAL. Default is Y|Tela de Login do Vtiger - Se a integração do Vtiger estiver habilitada então esta configuração irá definir se o usuário será logado automaticamente na interface do Vtiger quando entra no VICIDIAL. O padrão é Y| +Vtiger Screen Login:|Tela de Login do Vtiger:| +Alert Enabled -<\/B> This field shows whether the agent has web browser alerts enabled for when calls come into their vicidial.php session. Default is 0 for NO|Alerta Ativo - Este campo mostra se o agente tem alertas pelo browser habilitados para quando chamadas entram na sessão do usuário. O padrão é 0 para Não| +Alert Enabled:|Alerta Ativo:| +QC Features Active -<\/B> This option allows you to enable or disable the QC or Quality Control features. Default is 0 for inactive|Recursos de CQ Ativos - Esta opção permite habilitar ou desabilitar os recursos de CQ ou Controle de Qualidade. O padrão é 0 para Inativo| +Outbound Auto-Dial Active -<\/B> This option allows you to enable or disable outbound auto-dialing within VICIDIAL, setting this field to 0 will remove the LISTS and FILTERS sections and many fields from the Campaign Modification screens. Manual entry dialing will still be allowable from within the agent screen, but no list dialing will be possible. Default is 1 for active|Discagem Automática Ativa- Esta opção permite você habilitar ou desabilitar a discagem automática de saída do VICIDIAL, configurando este campo como 0 irá remover as seções de LISTAS e FILTROS e vários campos das telas de configuração de Campanha. Discagem Manual ainda será permitida pela tela do agente, mas a discagem por listas não será possível. O padrão é 1 para ativo| +QC Features Active:|Recursos de CQ Ativos:| +Outbound Auto-Dial Active:|Discagem Automática Ativa:| +Close Panel|Fechar Painel| +Choose Report Display Options|Escolher Opções do Relat.| +To select more than 1 campaign, hold down the Ctrl key and click|Para selecionar mais de 1 campanha, aperte Ctrl e clique| +CPD AMD Action -<\/B> If you are using the Sangoma ParaXip Call Progress Detection software then you will want to enable this setting either setting it to DISPO which will disposition the call as AA and hang it up if the call is being processed and has not been sent to an agent yet or MESSAGE which will send the call to the defined Answering Machine Message for this campaign. Default is DISABLED|Ação CPD AMD - Se você estiver usando o software de Detecção Sangoma ParaXip Call Progress então você deve habilitar esta configuração para DISPO que irá finalizar a chamada como AA e desligar se a chamada estiver sendo processada e ainda não foi enviada para um agente ou MESSAGE que irá enviar a chamada para o campo definido como Mensagem de Secretária Eletrônica para esta Campanha. O padrão é DISABLED| +CPD AMD Action:|Ação CPD AMD:| +Click here for user multiple day status detail report|Clique aqui para um relatório de status de vários dias| +Click here to download this list|Clique aqui para fazer download desta lista| +Download Lists:|Download de Listas:| +Active Asterisk Server -<\/B> If Asterisk is not running on this server, or if VICIDIAL should not be using this server, or if are only using this server for other scripts like the hopper loading script you would want to set this to N. Default is Y|Servidor Asterisk Ativo - Se o Asterisk não estiver rodando neste servidor, ou se o VICIDIAL não deveria estar usando este servidor, ou se estiver usando este servidor para outros scripts como o de carregamento de hopper, você deve configurar para N. O padrão é Y| +Generate conf files -<\/B> If you would like the system to auto-generate asterisk conf files based upon the phones entries, carrier entries and load balancing setup within VICIDIAL then set this to Y. Default is Y|Gerar Arquivos Conf - Se você deseja que o sistema gere automaticamente os arquivos conf do asterisk baseados nas configurações de ramal, operadoras, e balanceamento de carga no VICIDIAL então configure como Y. O padrão é Y| +Rebuild conf files -<\/B> If you want to force a rebuilding of the Asterisk conf files or if any of the phones or carrier entries have changed then this should be set to Y. After the conf files have been generated and Asterisk has been reloaded then this will be changed to N. Default is Y|Reconstruir Arquivos Conf - Se você quer forçar a reconstrução dos arquivos conf do Asterisk ou se qualquer um dos ramais ou operadoras foi alterado então isso deve ser Y. Após os aquivos conf terem sido criados e o Asterisk ter sido recarregado, então isso será alterado para N. O padrão é Y| +Active Asterisk Server:|Servidor Asterisk Ativo:| +Generate conf files:|Gerar Arquivos Conf:| +Rebuild conf files:|Reconstruir Arquivos Conf:| +Show Templates|Mostrar Templates| +Add A New Template|Incluir Template| +ADD NEW CONF TEMPLATE|INCLUIR TEMPLATE CONF| +ADD NEW CARRIER|Incluir Operadora| +ADDING NEW CONF TEMPLATE|INCLUINDO TEMPLATE CONF| +ADDING NEW CARRIER|INCLUIR OPERADORA| +MODIFY CONF TEMPLATE|ALTERAR TEMPLATE CONF| +MODIFY CARRIER|ALTERAR OPERADORA| +DELETE CONF TEMPLATE|REMOVER TEMPLATE CONF| +DELETE CARRIER|REMOVER OPERADORA| +CONF TEMPLATE LIST|LISTA DE TEMPLATES CONF| +CARRIER LIST|LISTA DE OPERADORAS| +Template ID:|ID do Template:| +Template Name:|Nome do Template:| +Template Contents:|Conteúdo do Template:| +Carrier ID:|ID da Operadora:| +Carrier Name:|Nome da Operadora:| +Registration String:|String de Registro:| +Account Entry:|Dados da Conta:| +Protocol:|Protocolo:| +Globals String:|String Global:| +Dialplan Entry:|Plano de Discagem:| +CONF TEMPLATE NOT ADDED|TEMPLATE DE CONF NÃO INCLUÍDA| +there is already a template in the system with this ID|já existe um template no sistema com esse ID| +CONF TEMPLATE ADDED|TEMPLATE DE CONF INCLUÍDO| +CARRIER NOT ADDED|OPERADORA NÃO INCLUÍDA| +there is already a carrier in the system with this ID|já existe uma operadora no sistema com este ID| +CONF TEMPLATE NOT MODIFIED|TEMPLATE DE CONF NÃO ALTERADO| +CARRIER NOT MODIFIED|OPERADORA NÃO ALTERADA| +CARRIER MODIFIED|OPERADORA ALTERADA| +CONF TEMPLATE NOT DELETED|TEMPLATE DE CONF NÃO REMOVIDO| +Template ID be at least 2 characters in length|ID do template deve ter pelo menos 2 caracteres| +CONF TEMPLATE DELETION CONFIRMATION|CONFIRMAR REMOÇÃO DO TEMPLATE DE CONF| +Click here to delete conf template|Clique aqui para remover esta template de conf| +CARRIER NOT DELETED|OPERADORA NÃO REMOVIDA| +Carrier ID be at least 2 characters in length|O ID da operadora precisa ter pelo menos 2 caracteres| +CARRIER DELETION CONFIRMATION|CONFIRMAR REMOÇÃO DA OPERADORA| +Click here to delete carrier|Clique aqui para remover a operadora| +CONF TEMPLATE DELETION COMPLETED|REMOÇÃO DO TEMPLATE DE CONF FINALIZADA| +CARRIER DELETION COMPLETED|REMOÇÃO DA OPERADORA FINALIZADA| +MODIFY A CONF TEMPLATE RECORD|ALTERAR UM REGISTRO DE TEMPLATE DE CONF| +DELETE THIS CONF TEMPLATE|REMOVER TEMPLATE DE CONF| +MODIFY A CARRIER RECORD|ALTERAR OPERADORA| +DELETE THIS CARRIER|REMOVER OPERADORA| +CARRIERS WITHIN THIS SERVER|OPERADORAS NESTE SERVIDOR| +CONF TEMPLATE LISTINGS|LISTA DAS TEMPLATES DE CONF| +CARRIER LISTINGS|LISTAS DAS OPERADORAS| +PHONES USING THIS CONF TEMPLATE|RAMAIS USANDO ESTA TEMPLATE DE CONF| +CARRIERS USING THIS CONF TEMPLATE|OPERADORAS USANDO ESTA TEMPLATE DE CONF| +Conf Override:|Sobrepor Conf:| +Template ID -<\/B> This field needs to be at least 2 characters in length and no more than 15 characters in length, no spaces. This is the ID that will be used to identify the conf template throughout the system|ID da Template - Este campo precisa ter pelo menos 2 caracteres de comprimento e não mais que 15 caracteres, sem espaços. Este é o ID que irá ser usado para identificar o template de conf no sistema| +Template Name -<\/B> This is the descriptive name of the conf file template entry|Nome da Template - Este é o nome descritivo da configuração da template| +Template Contents -<\/B> This field is where you can enter in the specific settings to be used by all phones and-or carriers that are set to use this conf template. Fields that should NOT be included in this box are: secret, accountcode, account, username and mailbox|Conteúdo da Template - Este campo é onde você pode configurar itens específicos para serem usados por todos os ramais e/ou todas as operadoras que estão configuradas para usar este template. Campos que NÃO devem ser incluídos nesse ítem são: secret, accountcode, account, username e mailbox| +Carrier ID -<\/B> This field needs to be at least 2 characters in length and no more than 15 characters in length, no spaces. This is the ID that will be used to identify the carrier for this specific entry throughout the system|ID da Operadora - Este campo precisa ter entre 2 e 15 caracteres de comprimento, sem espaços. Este é o ID que irá ser usado para identificar a operadora no sistema| +Carrier Name -<\/B> This is the descriptive name of the carrier entry|Nome da Operadora - Este é o nome descritivo da operadora no sistema| +Registration String -<\/B> This field is where you can enter in the exact string needed in the IAX or SIP configuration file to register to the provider. Optional but highly recommended if your carrier allows registration|String de Registro - Este campo é onde você coloca a string necessária na configuração do IAX ou SIP para registrar a operadora. Opcional mas altamente recomendado se sua operadora permite registro | +Template ID -<\/B> This optional field allows you to choose a conf file template for this carrier entry|ID do Template - Este campo opcional permite você escolha um template para esta configuração de operadora| +Account Entry -<\/B> This field is used if you have not selected a template to use, and it is where you can enter in the specific account settings to be used for this carrier|Dados da Conta - Este campo é usado se você não selecionou um template para ser usado, e é onde você pode entrar com configurações específicas para serem usadas para esta operadora| +Protocol -<\/B> This field allows you to define the protocol to use for the carrier entry. Currently only IAX and SIP are supported|Protocolo - Este campo permite que você defina o protocolo a ser usado para esta configuração de operadora. Atualmente somente IAX e SIP são suportados| +Globals String -<\/B> This optional field allows you to define a global variable to use for the carrier in the dialplan|String Global- Este campo opcional permite definir uma variável global para uso desta operadora no plano de discagem| +Dialplan Entry -<\/B> This optional field allows you to define a set of dialplan entries to use for this carrier|Plano de Discagem- Este campo opcional permite definir um conjunto de entradas no plano de discagem para serem usados com esta operadora| +Server IP -<\/B> This is the server that this specific carrier record is associated with|IP do Servidor - Este é o servidor que este registro de operadora está configurado| +Active -<\/B> This defines whether the carrier will be included in the auto-generated conf files or not|Ativo - Isto define se a operadora irá ser incluída nos arquivos conf gerados automáticamente ou não| +Conf Override Settings -<\/B> If populated, and the Template ID is set to --NONE-- then the contents of this field are used as the conf file entries for this phone. generate_vicidial_conf for this phones server must be set to Y for this to work. This field should NOT contain the [extension] line, that will be automatically generated|Config. Sobreposição de conf - Se preenchido, e o ID do Template estiver --NONE-- então o conteúdo deste campo será usado nas entradas do arquivo conf para este ramal. generate_vicidial_conf para o servidor deste ramal deve estar configurado como Y para funcionar. Este campo nao deve conter a linha [extension], que será automaticamente gerada| +Template ID -<\/B> This is the conf file template ID that this phone entry will use for its Asterisk settings. Default is --NONE--|ID do Template - Este é o ID do Template de arquivo conf que este ramal irá usar para as configurações do Asterisk. O padrão é --NONE--| +If you will be taking in inbound calls from this carrier trunk you might want to set the context=trunkinbound within this field so that you can use the DID handling process within VICIDIAL|Se você receberá chamadas entrantes desta operadora, você deve configurar o context=trunkinbound neste campo para que possa ser usado o processo de controle de DDR do VICIDIAL| +There is a reserved default DID that you can use which is just the word -default- without the dashes, that will allos you to send any call that does not match any other existing patterns to the default DID|Existe um DDR padrão reservado que você pode usar que é a palavra -default- sem os traços, que irá permitir que você envie uma chamada que não pertenca a nenhum padrão existente para o DDR padrão| +Campaign VDAD extension|Extensão VDAD da Campanha| +This field allows for a custom VDAD transfer extension. This allows you to use different call handling methods depending upon your campaign.|Este campo permite personalizar a extensão de transferência do VDAD. Isso permite que você use métodos de controle da chamada dependendo da sua campanha| + - 8364 - same as 8368|- 8364 - mesma que 8368 | + - 8365 - Will send the call only to an agent on the same server as the call is on|- 8365 - Irá enviar a chamada somente para o servidor no qual o agente está logado| + - 8366 - Used for press-1 and survey campaigns|- 8366 - Utilizado somente para campanhas de pressione-1 e pesquisa| + - 8367 - Will try to first send the call to an agent on the local server, then it will look on other servers|- 8367 - Irá tentar enviar a chamada para um agente no servidor local, então irá procurar em outros servidores| + - 8368 - DEFAULT – Will send the call to the next available agent no matter what server they are on|- 8368 - PADRÃO Irá enviar a chamada para o próximo agente disponível não importando o servidor em que está| + - 8369 - Used for Answering Machine Detection after that, same behavior as 8368|- 8369 - Usado para detecção de secretária eletrônica, após a detecção segue o mesmo caminho da 8368| + - 8373 - Used for Answering Machine Detection after that same behavior as 8366|- 8373 - Usado para detecção de secretária eletrônica, após a detecção segue o mesmo caminho da 8366| +Also in this section are the WEB VARs for each campaign. These allow each agent to have a different variable string that can be added to the WEB FORM or SCRIPT tab URLs by simply putting --A--web_vars--B-- as you would put any other field.|Também nesta seção estão as variáveis WEB para caba campanha. Elas permitem cada agente ter variáveis diferentes que podem ser adicionadas a URL do WEB FORM ou do SCRIPT, simplestemnte colocando --A--web_vars--B-- da mesma forma que faria com qualquer outro campo| +Group Alias List|Lista de Alias de Grupo| +Add A New Group Alias|Incluir Alias de Grupo| +ADD NEW GROUP ALIAS|INCLUIR ALIAS DE GRUPO| +ADDING NEW GROUP ALIAS|INCLUINDO ALIAS DE GRUPO| +MODIFY GROUP ALIAS|ALTERAR ALIAS DE GRUPO| +DELETE GROUP ALIAS|REMOVER ALIAS DE GRUPO| +GROUP ALIAS LIST|LISTA DE ALIAS DE GRUPOS| +GROUP ALIAS LISTINGS|LISTAS DE ALIAS DE GRUPO| +MODIFY A GROUP ALIAS RECORD|ALTERAR ALIAS DE GRUPO| +Group Alias ID|ID do Alias| +Group Alias Name|Nome do Alias| +CallerID Number|Número CallerID| +CallerID Name|Nome CallerID| +DELETE THIS GROUP ALIAS|REMOVER ESTE ALIAS DE GRUPO| +GROUP ALIAS NOT MODIFIED|ALIAS DE GRUPO NÃO ALTERADO| +GROUP ALIAS MODIFIED|ALIAS DE GRUPO ALTERADO| +ADD A NEW GROUP ALIAS|INCLUIR NOVO ALIAS DE GRUPO| +MODIFY A GROUP ALIAS RECORD|ALTERAR ALIAS DE GRUPO| +GROUP ALIAS NOT ADDED|ALIAS DE GRUPO NÃO INCLUÍDO| +GROUP ALIAS ADDED|ALIAS DE GRUPO INCLUÍDO| +GROUP ALIAS NOT DELETED|ALIAS DE GRUPO NÃO REMOVIDO| +GROUP ALIAS DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE ALIAS DE GRUPO| +Click here to delete group alias|Clique aqui para remover alias de grupo| +GROUP ALIAS DELETION COMPLETED|REMOÇÃO DO ALIAS DE GRUPO FINALIZADA| +Group Alias ID -<\/B> The ID of the group alias used by agents to dial out calls from the VICIDIAL agent interface with different Caller IDs. no spaces or other special characters allowed. Must be between 2 and 20 characters in length|ID do Alias de Grupo - É o ID do alias de grupo usado por agentes do sistema para realizar chamadas pela interface do VICIDIAL com CallerIDs diferentes. Não é permitido uso de caracteres especiais ou espaços. Deve ter entre 2 e 20 caracteres| +Group Alias Name -<\/B> The name used to describe a group alias, Must be between 2 and 50 characters in length|Nome do Alias de Grupo - O nome usado para descrever um alias de grupo, Deve ter entre 2 e 20 caracteres de comprimento| +Caller ID Number -<\/B> The Caller ID number used in this Group Alias. Must be digits only|Número do CallerID - O Número do Caller ID usado para este alias de grupo. Deve ter apenas dígitos| +Caller ID Name -<\/B> The Caller ID name that can be sent out with this Group Alias. As far as we know this will only work in Canada on PRI circuits and using an IAX loop trunk through Asterisk|Nome do CallerID - O Nome do Caller ID que é enviado com esse Alias de Grupo. Até onde sabemos isso só funciona nos circuitos PRI do Canadá e usando trunk IAX com Asterisk| +Group Alias Allowed -<\/B> If you want to allow your agents to use group aliases then you need to set this to Y. Group Aliases are explained more in the Admin section, they allow agents to select different callerIDs for outbound manual calls that they may place. Default is N|Alias de Grupo Permitidas - Se você quer permitir seus agentes a usarem alias de grupo então você deve configurar como Y. Alias de grupo são explicados melhor na seção Admin, eles permitem que os agentes usem CallerIDs diferentes para chamadas manuais que realizam. O padrão é N| +Default Group Alias -<\/B> If you have allowed Group Aliases then this is the group alias that is selected first by default when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty|Alias de Grupo Padrão - Se você permitiu Alias de Grupo então este é o alias de grupo que será selecionado como padrão quando o agente escolhe usar um alias de grupo em uma chamada manual. O padrão é NONE ou vazio| +Default Group Alias -<\/B> If you have allowed Group Aliases for the campaign that the agent is logged into then this is the group alias that is selected first by default on a call coming in from this inbound group when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty|Alias de Grupo Padrão - Se você permitium Alias de Grupo para a campanha que o agente está logado, então este é o alias de grupo que é selecionado como padrão em uma chamada vindo deste grupo de entrada quando o agente escolhe um alias de grupo para uma chamada manual. O padrão é NONE ou vazio| +Group Alias Allowed|Alias de Grupo Permitido| +Default Group Alias|Alias de Grupo Padrão| +AGENT_CHOOSE allows the agent to choose which callerID to use for 3-way calls from a list of choices.|AGENT_CHOOSE permite que o agente escolha qual CallerID usar em chamadas a 3 a partir de uma lista de opções| +you cannot use reserved words in group aliases|não pode ser usado palavras reservadas neste alias de grupo| +Agent Shift Enforcement Override|Sobrepor Controle de Turno do Agente| +Manager Shift Enforcement Override|Sobrepor Controle de Turno do Gerente| +Shift Enforcement|Controle de Turno| +Max Calls per Second|Máx. de Chamadas por Segundo| +Max FILL Calls per Second|Máx. de Cham. Trasnf. por Segundo| +This setting will override whatever the users user group has set for Shift Enforcement. DISABLED will use the user group setting. OFF will not enforce shifts at all. START will only enforce the login time but will not affect an agent that is running over their shift time if they are already logged in. ALL will enforce shift start time and will log an agent out after they run over the end of their shift time. Default is DISABLED.|Esta configuração irá sobrepor qualquer configuração feita no grupo do agente para controle de turno. DISABLED irá usár a configuração do grupo. OFF não irá forçar turnos. START irá somente forçar o horário de login do turno mas não terá efeito sobre horário acima do final do turno se o usuário ainda estiver logado. ALL irá forçar o inicio do turno e irá fazer logout do agente caso passe do final do horário do turno. O padrão é DISABLED.| +This setting if set to 1 will allow a manager to enter their user and password on an agent screen to override the shift restrictions on an agent session if the agent is trying to log in outside of their shift. Default is 0.|Esta configuração quando 1 irá permitir ao gerente entrar com suas credenciais na tela do agente para sobrepor o controle do turno caso o agente esteja tentando logar fora do horário determinado para seu turno. O padrão é 0.| +This setting allows you to restrict agent logins based upon the shifts that are selected below. OFF will not enforce shifts at all. START will only enforce the login time but will not affect an agent that is running over their shift time if they are already logged in. ALL will enforce shift start time and will log an agent out after they run over the end of their shift time. Default is OFF.|Esta configuração permite você restringir logins do agente baseado nos turnos selecionados abaixo. OFF não irá forçar controle de turno. START irá forçar o horário de login mas não terá efeito sobre um agente que está fazendo horário além do limite final e não saiu do sistema. ALL irá forçar o horário de início e fim, retirando o agente do sistema quando o horário do turno estiver terminado. O padrão é OFF| +This setting determines the maximum number of calls that can be placed by the outbound auto-dialing script on this server per second. Must be from 1 to 100. Default is 20.|Esta configuração determina o número máximo de chamadas que podem ser feitas pelo script de discagem automática neste servidor por segundo. Deve ser de 1 a 100. O padrão é 20| +This setting determines the maximum number of calls that can be placed by the auto-FILL outbound auto-dialing script on for all servers, per second. Must be from 1 to 200. Default is 40.|Esta configuração determina o número máximo de chamadas que podem ser feitas pelo discador automático de saída para todos os servidores, por segundo. Deve ter entre 1 e 200 caracteres. O padrão é 40.| +System Load|Carga do Sistema| +Live Channels|Canais Falando| +Disk Usage|Uso do HD| +These two statistics show the loadavg of a system times 100 and the CPU usage percentage of the server and is updated every minute. The loadavg should on average be below 100 multiplied by the number of CPU cores your system has, for optimal performance. The CPU usage percentage should stay below 50 for optimal performance.|Estas duas estatísticas mostram a média de carga de um sistema vezes 100 e o percentual de uso de CPU do servidor, atualizados a cada minuto. A média de carga deve ser em média menor que 100 multiplicado pelo número de núcleos de CPU que seu sistema tem, para melhor performance. O percentual de uso do CPU deve ficar abaixo de 50 para melhor performance.| +This field shows the current number of Asterisk channels that are live on the system right now. It is important to note that the number of Asterisk channels is usually much higher than the number of actual calls on a system. This field is updated once every minute.|Este campo mostra o número atual de canais ativos no Asterisk que estão falando neste momento. É importante perceber que o número de canais do Asterisk é normalmente muito mais alto do que as chamadas atuais do sistema. Este campo é atualizado a cada minuto.| +This field will show the disk usage for every partition on this server. This field is updated once every minute.|Este campo irá mostrar o uso de disco para cada partição neste servidor. Este campo é atualizado a cada minuto.| +ADMIN CHANGE LOG|LOG DE ALT. ADMIN| +USER ADMIN CHANGE LOG|LOG DE ALT. DO USUÁRIO ADMIN| +SECTION ADMIN CHANGE LOG|LOG DE ALT. DA SEÇÃO ADMIN| +DETAIL ADMIN CHANGE LOG|LOG DE ALT. DE DETALHES ADMIN| +Last 10000 records|Últimos 10000 registros| +Changes made by|Alterado por| +Record Detail|Detalhes do Reg.| +Section Records|Registros de Seção| +Click here to see Admin chages to this record|Clique aqui para ver alterações Admin para este registro| +Click here to see Admin chages to this campaign|Clique aqui para ver alterações Admin para esta campanha| +Click here to see Admin chages to this list|Clique aqui para ver alterações Admin para esta lista| +Click here to see Admin chages to this In-Group|Clique aqui para ver alterações Admin para este grupo de entrada| +Click here to see Admin chages to this DID|Clique aqui para ver alterações Admin para este DDR| +Click here to see Admin chages to this remote agent|Clique aqui para ver alterações Admin para este Agente Remoto| +Click here to see Admin chages to this user group|Clique aqui para ver as alterações Admin para este Grupo de usuários| +Click here to see Admin chages to this script|Clique aqui para ver as alterações Admin para este script| +Click here to see Admin chages to this filter|Clique aqui para ver as alterações Admin para este Filtro| +Click here to see Admin chages to this call time|Clique aqui para ver as alterações Admin para este Horário de Chamada| +Click here to see Admin chages to this shift|Clique aqui para ver as alterações Admin para este Turno| +Click here to see Admin chages to this phone alias|Clique aqui para ver as alterações Admin para este Alias de Ramal| +Click here to see Admin chages to this group alias|Clique aqui para ver as alterações Admin para este Alias de Grupo| +Click here to see Admin chages to this server|Clique aqui para ver as alterações Admin para este Servidor| +Click here to see Admin chages to this conf template|Clique aqui para ver as alterações Admin para este template de conf| +Click here to see Admin chages to this carrier|Clique aqui para ver as alterações Admin para esta Operadora| +Click here to see Admin chages to the system settings|Clique aqui para ver as alterações Admin para esta Configuração de sistema| +Export Reports|Exportar Relatórios| +This setting if set to 1 will allow a manager to access the export call reports on the REPORTS screen. Default is 0.|Esta configuração quando configurada como 1 irá permitir ao gerente acessar o ítem de exportação de relatórios na tela de relatórios. O padrão é 0| +This setting if set to 1 will allow a manager to click on the download list link at the bottom of a list modification screen to export the entire contents of a list to a flat data file. Default is 0.|Esta configuração quando 1 permite aoa gerente clicar no download da lista na parte inferior da tela de alteração de listas para exportar o conteúdo da lista para um arquivo em formato de texto. O padrão é 0.| +Export Calls Report|Exportar Relatórios de Chamadas| +EXPORT CALLS REPORT|EXPORTAR RELAT. DE CHAMADAS| +For the Export Calls Report, the following field order is used for exports| +Para a exportação do Relatório de Chamadas, a seguinte ordem de campos é usada na exportação| +Timeclock|Relógio Ponto| +Logout|Sair| +Show Users|Mostrar Usuários| +Add A New User|Incluir Usuário| +Search For A User|Pesquisar Usuário| +User Stats|Estatísticas de Usuário| +User Status|Status do Usuário| +Time Sheet|Planilha de Tempo| +Days Status|Status Diário| +Campaigns Main|Campanhas| +Statuses|Status| +HotKeys|Atalhos| +Lead Recycle|Reciclar Registro| +Auto Alt-Dial|Discar Num. Alt.| +Auto Alt Dial|Discar Num. Alt.| +List Mix|Mesclagem de Lista| +Pause Codes|Códigos de Pausa| +Basic|Básico| +Detail|Detalhes| +Survey|Pesquisa| +Real-Time|Tempo Real| +CAMPAIGN ID|ID| +DIAL PLAN|PLANO DE DISC.| +DIAL METHOD|MÉTODO DE DISC.| +LEADS COUNT|TOTAL DE REG.| +LEAD ORDER|ORDEM DOS REG.| +DIAL STATUSES|STATUS DE DISC.| +SCRIPT ID|ID DO SCRIPT| +SCRIPT NAME|NOME DO SCRIPT| +USER GROUP|GRUPO DE USUÁRIOS| +GROUP NAME|NOME DO GRUPO| +PRIORITY|PRIORIDADE| +FORCE TIMECLOCK|FORÇAR PONTO| +CALLTIME ID|ID DO HORÁRIO| +CALLTIME NAME|NOME DO HORÁRIO| +DEFAULT START|INÍCIO PADRÃO| +DEFAULT STOP|FIM PADRÃO| +SHIFT ID|ID DO TURNO| +SHIFT NAME|NOME DO TURNO| +SHIFT START|INÍCIO DO TURNO| +SHIFT LENGTH|FIM DO TURNO| +WEEKDAYS|SEMANAL| +Template ID|ID do Template| +Template Name|Nome do Template| +Carrier ID|ID da Operadora| +Carrier Name|Nome da Operadora| +Registration|Registro| +Active|Ativo| +USER ID|ID DO USUÁRIO| +FULL NAME|NOME COMPLETO| +LEVEL|NÍVEL| +LINKS|LINKS| +TRUNKS|TRUNKS| +HUMAN|HUMANO| +ANSWER|RESPOSTA| +CATEGORY|CATEGORIA| +STATUSES IN THIS CATEGORY|STATUS NESTA CATEGORIA| +Display|Mostrar| +Dates|Datas| +PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK|POR FAVOR SELECIONE UMA CAMPANHA OU GRUPO DE USUÁRIO E PERÍODO ACIMA E CLIQUE| +PLEASE SELECT A USER AND DATE-TIME ABOVE AND CLICK|POR FAVOR SELECIONE UM USUÁRIO E PERÍODO ACIMA E CLIQUE| +PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK|POR FAVOR SELECIONE UMA CAMPANHA E PERÍODO ACIMA E CLIQUE| +PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT|POR FAVOR SELECIONE UM GRUPO DE ENTRADA E PERÍODO ACIMA E CLIQUE ENVIAR| +DOWNLOAD|DOWNLOAD| +Users|Usuários| +User|Usuário| +Reports|Relatórios| +OUTBOUND|SAINTE| +INBOUND|ENTRANTE| +Server Stats and Reports|Estatísticas do Servidor e Relatórios| +Click here to see a VDAD report for this campaign|Clique aqui para ver um relatório VDAD para esta campanha| +Show DIDs|Mostrar DDRs| +Add A New DID|Incluir DDR| +Templates|Templates| +Carriers|Operadoras| +Carrier Name|Nome da Operadora| +Click here to see all CallBack Holds in this user group|Clique aqui para ver todos os registros de CallBack para este grupo de usuários| +Click here to see all CallBack Holds in this list|Clique aqui para ver todos os registros de Callback para esta lista| +Click here to see a report for this inbound group|Clique aqui para ver um relatório deste grupo de entrada| +Click here to Synchronize users with Vtiger|Clique aqui para sincronizar usuários com o Vtiger| +Alert Enabled|Alerta Habilitado| +Change Date|Data da Alter.| +Login Date|Data do Login| +List Last Call Date|Data da última chamada da lista| +Phone Code Override|Sobrepor Código do Telefone| +GROUP ALIAS ID|ID DO ALIAS DE GRUPO| +GROUP ALIAS NAME|NOME DO ALIAS DE GRUPO| +CID NUMBER|NÚMERO CID| +CID NAME|NOME CID| +PHONE ALIAS|ALIAS DE RAMAL| +ALIAS ID|ID DO ALIAS| +ALIAS NAME|NOME DO ALIAS| +PHONE LOGINS LIST|LISTA DE LOGINS DE RAMAL| +Shift Length|Duração do Turno| +short description of the shift|descrição curta do turno| +DELETE THIS SERVER|REMOVER ESTE SERVIDOR| +DELETE THIS CONFERENCE|REMOVER ESTA CONFERÊNCIA| +DELETE THIS VICIDIAL CONFERENCE|REMOVER ESTA CONFERÊNCIA VICIDIAL| +Install Date|Data da Instalação| +Human Answer|Resposta Humana| +STATUS CATEGORIES|CATEGORIA DE STATUS| +per campaign|por campanha| +all campaigns|todas campanhas| +CAMPAIGN|CAMPANHA| +STATUSES|STATUS| +### START translations for 2.2.0 release ### +Delete From DNC Lists|Remover da Lista de Bloqueio| +This setting if set to 1 will allow a manager to remove phone numbers from the DNC lists in the VICIDIAL system|Esta configuração quando 1 permite que o gerente remova números de telefone da lista de bloqueio no sistema VICIDIAL | +DNC NOT DELETED|BLOQUEIO NÃO REMOVIDO| +This phone number is not in the Do Not Call List|Este número de telefone não está na lista de bloqueio| +DNC DELETED|BLOQUEIO REMOVIDO| +ADD OR DELETE NUMBERS FROM THE DNC LIST|INCLUIR OU REMOVER TELEFONES DA LISTA DE BLOQUEIO| +Add or Delete|Incluir ou Remover| +Add-Delete Number From DNC|Incluir-Remover Número do Bloqueio| +Vtiger Search Dead Accounts|Pesquisar contas Mortas no Vtiger| +If Vtiger integration is enabled in the system settings then this setting will define whether deleted accounts will be searched when the agent clicks WEB FORM to search in the Vtiger system. DISABLED- deleted leads will not be searched, ASK- deleted leads will be searched and the vtiger search web page will ask the agent if they want to make the Vtiger account active, RESURRECT- will automatically make the deleted account active again and will take the agent to the account screen without delay upon clicking on WEB FORM. Default is DISABLED|Se a integração com o Vtiger estiver habilitada nas confifurações do sistema então esta configuração define se contas apagadas serão pesquisadas quando o agente clica em WEB FORM para procurar no sistema Vtiger. DISABLED- registros apagados não serão pesquisados, ASK- registros apagados serão pesquisados e a página de pesquisa do vtiger irá perguntar ao agente se ele quer ativar a conta no Vtiger, RESURRECT- irá automaticamente ativar a conta e levar o agente para a tela da conta sem atrasos após clicar em WEB FORM. O padrão é DISABLED| +The DISPO option will create a call record for the Vtiger account without the agent needing to go to the vtiger search page through the WEB FORM|A opção DISPO irá criar um registro de chamada para a conta Vtiger sem que o agente precise ir para a página da conta no Vtiger através do botão WEB FORM| +The NEW_WINDOW option will open a new window upon login to the VICIDIAL agent screen|A opção NEW_WINDOW irá abrir uma nova janela ao efetuar login na tela do agente do VICIDIAL| +Vtiger Status Call|Status da Chamada no Vtiger| +If Vtiger integration is enabled in the system settings then this setting will define whether the status of the Vtiger Account will be updated with the status of the VICIDIAL call after it has been dispositioned. Default is N|Se a integração com o Vtiger estiver habilitada nas configurações do sistema então esta configuração irá definir se o status da conta no Vtiger irá ser atualizada com o status da chamada no VICIDIAL depois que ela foi finalizada. O padrão é N| +There are also 5 additional settings that will define the kind of status: sale, dnc, customer contact, not interested, unworkable|Existem também 5 configurações adicionais que irão definir o tipo do status: sale, dnc, customer contact, not interested, unworkable| +If the customer is on hold and hears this estimated hold time message, the minimum time that will be played is 15 seconds|Se o cliente está em espera e ouve o tempo estimado de atendimento, o tempo mínimo que será tocado é de 15 segundos| +Email, User Code and Territory|Email, Código do Usuário e Território| +These are optional fields|Estes são campos opcionais| +All options except for the Not Interested, Third and Fourth digit options will move on to the Survey Method call path|Todas as opções, com exceção de Not Interested, Terceiro e Quarto dígito, irão mover a chamada para o método de Pesquisa(Survey)| +Survey Third Digit|Terceiro Dígito| +This allows for a third call path if the Third digit as defined in this field is pressed by the customer|Isto permite que exista um terceiro caminho se o terceiro dígito conforme definido por este campo for pressionado pelo cliente| +Survey Fourth Digit|Quarto Dígito| +This allows for a fourth call path if the Fourth digit as defined in this field is pressed by the customer|Isto permite que exista um quarto caminho se o quarto digito conforme digitado neste campo for digitado pelo cliente| +Survey Third Audio File|Terceiro Arquivo de Audio| +Survey Fourth Audio File|Quarto Arquivo de Audio| +This is the third audio file to be played upon the selection by the customer of the Third Digit option|Este é o terceiro arquivo de audio a ser tocado assim que seja selecionado pelo cliente a terceira opção| +Survey Third Status|Terceiro Status| +Survey Fourth Status|Quarto Status| +This is the third status used for the call upon the selection by the customer of the Third Digit option|Este é o terceiro status usado para a chamada assim que o cliente escolhe a terceira opção| +Survey Third Extension|Terceira Extensão| +Survey Fourth Extension|Quarta Extensão| +This is the third extension used for the call upon the selection by the customer of the Third Digit option. Default is 8300 which immediately hangs up the call after the Audio File message is played|Esta é a terceira extensão usada pela chamada assim que é selecionada pelo cliente a terceira opção. O padrão é 8300 que imediatamente desliga a chamada após a mensagem de audio é reproduzida| +RANDOM: Randomly grabs lead within the statuses and lists defined|RANDOM: Aleatoriamente pega um registro entre os status e listas definidas| +UP LAST CALL TIME: Sorts by the newest local call time for the leads|HORA DA ÚLTIMA CHAMADA PARA CIMA: Ordena os registros pela chamada mais recente | +DOWN LAST CALL TIME: Sorts by the oldest local call time for the leads|HORA DA ÚLTIMA CHAMADA PARA BAIXO: Ordena os registros pela chamada mais antiga| +WARNING, we only recommend List Mix for advanced users, Please read the ViciDial Manager Manual|ATENÇÃO, só recomendamos Mesclagem de Listas para usuários avançados, Por favor leia o Manual de Gerente do Vicidial| +Add Call Menu|Incluir Menu de Chamada| +Copy Call Menu|Copiar Menu de Chamada| +New Call Menu|Novo Menu de Chamada| +Modify Call Menu|Alterar Menu de Chamada| +Delete Call Menu|Remover Menu de Chamada| +Call Menus|Menus de Chamada| +Menu ID|ID do Menu| +This is the ID for this step of the call menu. This will also show up as the context that is used in the dialplan for this call menu|Este é o ID para este passo do menu de chamadas. Ele irá aparecer como o contexto que é usado no plano de discagem para este menu de chamadas| +Menu Name|Nome do Menu| +This field is the descriptive name for the call menu|Este campo é o nome descritivo do menu de chamadas| +Menu Prompt|Audio do Menu| +This field contains the file name of the audio prompt to play at the beginning of this menu|Este campo contém o nome do arquivo para o audio que será tocado no inicio do menu| +Menu Timeout|Tempo max do menu| +This field is where you set the timeout in seconds that the menu will wait for the caller to enter in a DTMF choice|Este campo é onde você configura o tempo máximo em segundos que um menu irá aguardar o cliente digitar uma opção em DTMF| +Menu Timeout Prompt|Audio de tempo excedido do menu| +This field contains the file name of the audio prompt to play when the timeout has been reached. Default is NONE to play no audio at timeout|Este campo contém o arquivo de audio a ser tocado caso o tempo máximo de espera tenha sido alcançado. O padrão é NONE para nao tocar audio| +Menu Invalid Prompt|Audio de Opção Inválida do menu| +This field contains the file name of the audio prompt to play when the caller has selected an invalid option. Default is NONE to play no audio at invalid|Este campo contém o nome do arquivo de audio que será tocado quando o cliente selecionar uma opção inválida. O padrão é NONE que não toca audio quando a opção é inválida| +Menu Repeat|Repetir Menu| +This field is where you define the number of times that the menu will play after the first time if no valid choice is made by the caller. Default is 1 to repeat the menu once|Este campo é onde você define o número de vezes que o menu irá tocar depois da primeira vez, se nenhuma opção for escolhida pelo cliente. O padrão é 1 para repetir o menu uma vez| +Menu Time Check|Verif. Horário de Menu| +This field is where you can select whether to restrict the Call Menu access to the specific hours set up in the selected Call Time. If the Call Time is blank, this setting will be ignored. Default is 0 for disabled|Este campo é onde você seleciona se as chamadas á URA devem ser restritas a horários específicos cadastrados no Cadastro de Horários de Chamada. Se o Horário de chamada estiver vazio, esta configuração será ignorada. O padrão é 0 para desabilitado| +Call Time ID|ID Hor. de Chamadas| +This is the Call Time ID that will be used to restrict calling times if the Menu Time Check option is enabled|Este é o ID do Horário de chamadas que será usado para restringir horários de chamada para este menu, quando a opção estiver habilitada| +Track Calls in Real-Time Report|Rastrear Chamadas no Relat. Tempo-Real| +This field is where you can select whether you want the call to be tracked in the Real-time screen as an incoming IVR type call. Default is 1 for active|Este campo é onde você seleciona se deseja que as chamadas devem ser rastreadas no relatório de Tempo-Real como uma chamada de URA. O padrão é 1 para ativo| +Option Value|Valor da Opção| +This field is where you define the menu option, possible choices are|Este campo é onde você define a opção de menu, as opções são| +Option Route|Rota da Opção| +This menu contains the options for where to send the call if this option is selected|Este menu contém as opções para onde enviar a chamada quando este menu for selecionado| +The special option TIMECHECK can be used only if you have Menu Time Check enabled and there is a Call Time defined for the Menu|A opção especial TIMECHECK pode ser usada somente se você habilitou a verificação de horário e existe um horário de chamadas definido para o menu| +Option Route Value|Valor da rota da opção| +This field is where you enter the value that defines where in the selected Option Route that the call is to be directed to|Este campo é onde você coloca o valor que define para onde, na Opção de Rota selecionada, a chamada deve ser direcionada | +Option Route Value Context|Contexto do valor da rota da opção| +This field is optional and only used for EXTENSION Option Routes|Este campo é opcional e somente é usado para Rotas do tipo EXTENSION| +ADD A NEW CALL MENU|INCLUIR UM MENU| +COPY CALL MENU|COPIAR UM MENU| +This menu contains the options for where to send the call if this option is selected: CALLMENU,INGROUP,DID,HANGUP,EXTENSION,PHONE. For CALLMENU, the Route Value should be the Menu ID of the Call Menu that you want the call sent to. For INGROUP, the In-Group that you want the call to be sent to needs to be selected as well as the other 5 options that need to be set to properly route a call to an Inbound Group. For DID, the Route Value needs to be the DID pattern that you want to send the call to. For HANGUP, the Route Value can be the name of an audio file to play before hanging up the call. For EXTENSION, the Route Value needs to be the dialplan extension you want to send the call to, and the Route Value Context is the context that extension is located in, if left blank the context will default to default. For PHONE, the Route Value needs to be the phone login value for the phones entry that you want to send the call to. For VOICEMAIL, the Route Value needs to be the voicemail box number, the unavailable mesage will be played. For AGI, the Route Value needs to be the agi script and any values taht need to be passed to it.| +Este menu contém as opções para onde enviar a chamada se esta opção for selecionada: CALLMENU,INGROUP,DID,HANGUP,EXTENSION,PHONE. Para CALLMENU, o Valor da Rota deve ser o ID do menu de chamadas para o qual você quer enviar a chamada. Para INGROUP, o In-Group que você quer que a chamada seja enviada deve estar selecionado junto com outras 5 opções que precisam estar configuradas para rotear corretamente a chamada para um grupo de entrada. Para DID, o valor de rota precisa ser o padrão DID para o qual você quer enviar a chamada. Para HANGUP, o Valor da Rota pode ser o nome do arquivo de audio a ser tocado antes de desligar a chamada. Para EXTENSION, o valor de rota precisa ser a extensão do plano de discagem para o qual você quer enviar a chamada, e o Valor do Contexto da Rota, é o contexto no qual a extensão está localizada. se deixado em branco o contexto usado será o default. Para PHONE, o valor da rota precisa ser o login do ramal para o qual deseja desviar a chamada. Para VOICEMAIL, o Valor da Rota precisa ser o número da caixa postal, a mensagem de não disponível será tocada. Para AGI, o valor da rota precisa ser o script agi e os valores que precisam ser passados a ele.| +Option Description|Descrição da Opção| +This field is where you can describe the option, this description will be put into the dialplan as a comment above the option|Este campo é onde você descreve a opção, esta descrição será colocada no plano de discagem como um comentário acima da opção| +Source Menu|Menu Origem| +CALL MENU NOT ADDED|MENU NÃO INCLUÍDO| +Call Menu ID must be between 2 and 50 characters in length and contain no|O ID do menu deve ter entre 2 e 50 caracteres de comprimento e nao conter| +CALL MENU ADDED|MENU INCLUÍDO| +CALL MENU NOT MODIFIED|MENU NÃO ALTERADO| +CALL MENU MODIFIED|MENU ALTERADO| +Click here to see Admin chages to this CALL MENU|Clique aqui para ver as alterações deste MENU| +DELETE THIS CALL MENU|REMOVER ESTE MENU| +MODIFY A CALL MENU RECORD|ALTERAR O REGISTRO DE MENU| +Time Check|Verif. Horário| +No Time Check|Sem Verif. Horário| +Realtime Tracking|Rastrear em Tempo-Real| +No Realtime Tracking|Sem Rastream. em Tempo-Real| +Call Menu Options|Opções do Menu| +Option|Opção| +CALL MENU NOT DELETED|MENU NÃO REMOVIDO| +CALL MENU DELETION CONFIRMATION|CONFIRMAÇÃO DE REMOÇÃO DE MENU| +Click here to delete CALL MENU|Clique aqui para remover o MENU| +CALL MENU DELETION COMPLETED|REMOÇÃO DE MENU COMPLETADA| +CALL MENU LISTINGS|LISTA DE MENUS| +CALLMENU will send the call to the defined Call Menu|MENU irá enviar a chamada para o menu determinado| +Call Menu|Menu| +If CALLMENU is selected as the DID Route, then this is the Call Menu that calls will be sent to|Se CALLMENU estiver selecionado como Rota de DDR, então este é o Menu para o qual a chamada será transferida| +Show Call Menus|Mostrar Menus| +Add A New Call Menu|Incluir um Menu| +Copy Call Menu|Copiar um Menu| +To delete an Option, just set the Route to REMOVE and the option will be deleted when you click the SUBMIT button|Para remover uma opção, apenas selecione a rota como REMOVE e a opção será removida quando você clicar no botão enviar| +Agent Only Callback Campaign Lock|Trava para Agendamento Vinculado| +This option defines whether AGENTONLY callbacks are locked to the campaign that the agent originally created them under. Setting this to 1 means that the agent can only dial them from the campaign they were set under, 0 means that the agent can access them no matter what campaign they are logged into. Default is 1|Esta opção define se Agendamento Vinculado(AGENTONLY) serão travados para a campanha que o a gente originalmente agendou. Configurando como 1 significa que o agente somente pode discar para eles a partir da campanha que os configurou, 0 significa que o agente pode acessar os agendamentos não importando a campanha que eles foram criados. O padrão é 1| +Central Sound Control Active|Controle Central de Audio Ativado| +This option defines whether the sound synchronization system is active across all servers. Default is 0 for inactive|Esta opção define se o sistema de sincronia de som está ativado entre todos os servidores. O padrão é 0 para inativo| +Sounds Web Server|Servidor Web de Sons| +This is the server name or IP address of the web server that will be handling the sound files on this system, this must match the server name or IP of the machine you are trying to access the audio_store.php webpage on or it will not work. Default is 127.0.0.1|Este é o nome do servidor ou endereço IP para o servidor web que estará controlando os arquivos de audio no sistema, isto deve combinar com o nome do servidor ou endereço IP no qual você está tentando acessar a página audio_store.php. O padrão é 127.0.0.1| +Sounds Web Directory|Diretório Web de Sons| +This auto-generated directory name is created at random by the system as the place that the audio store will be kept. All audio files will reside in this directory|Esta auto-generado nombre del directorio es creado al azar por el sistema como el lugar que la tienda de audio se mantendrá. Todos los archivos de audio residir en este directorio| +Audio Store|Audio de la tienda| +Audio File to Upload|Audio de un archivo para subir| +This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here|Esta utilidad te permite subir archivos de audio para el servidor de forma que puedan ser distribuidos a todos los servidores de Vicidial en un multi-cluster de servidores. Una nota importante, sólo dos tipos de archivos de audio de trabajo,. Archivos WAV PCM de 16 bits que se 8k y los archivos. GSM que se 8bit 8k. Por favor, verifique que los archivos tienen el formato correcto antes de subirlos aquí| +Sounds Update|Actualización de los sonidos| +If you want to force a check of the sound files on this server, and the central audio store is enabled as a system setting, then this field will allow the sounds updater to run at the next top of the minute. Any time an audio file is uploaded from the web interface this is automatically set to Y for all servers that have Asterisk active. Default is N|Si desea forzar una comprobación de los archivos de sonido en este servidor, y el almacén central de audio está activado como una configuración del sistema, este campo permitirán a los sonidos de actualización para ejecutar en la parte superior de la siguiente minuto. Toda vez que un archivo de audio se carga desde la interfaz web de este se ajusta automáticamente a Y para todos los servidores que tienen activos de Asterisk. Por defecto es n| +Active Voicemail Server|Servidor de correo de voz activo| +In multi-server systems, this is the server that will handle all voicemail boxes. This server is also where the dial-in generated prompts will be uploaded from, the 8168 recordings|En sistemas multi-servidor, este es el servidor que se encargará de todas las casillas de correo de voz. Este servidor es también donde la línea telefónica en mensajes generados se cargan desde el 8168 grabaciones| +Auto Dial Limit|Marcado automático de límite de| +This is the maximum limit of the auto dial level in the campaign screen|Este es el límite máximo de la escala de marcación automática en la pantalla de la campaña| +User Territories are not active on this system|Territorios de usuario no están activos en este sistema| +User Territories|Territorios de usuario| +List All Territories:|Lista de todos los territorios:| +User Territories Active|Territorios de usuario de Active| +This setting allows you to enable the User Territories setttings from the user modification screen. This feature was added to allow for more integration with a customized Vtiger installation but can have applications in a pure ViciDial system as well. Default is 0 for disabled|Esta configuración le permite habilitar la setttings territorios de usuario desde la pantalla de modificación del usuario. Esta característica se agregó para permitir una mayor integración con una instalación personalizada Vtiger pero puede tener aplicaciones en un sistema de Vicidial pura también. Por defecto es 0 para discapacitados| +List Territories|Lista de territorios| +Add Territory|Añadir Territorio| +Add User Territory|Añadir usuario Territorio| +Territory|Territorio| +Territory Description|Territorio Descripción| +Territory and Territory Description must be filled in|Territorio y Territorio Descripción deben ser rellenados| +there is already a territory in the system with this name|ya existe un territorio en el sistema con ese nombre| +Territory Added|Territorio en que se agregó| +Modify Territory|Modificar Territorio| +Territory not found|Territorio que no se encuentra| +This territory is not in the system with this name|Este territorio no está en el sistema con ese nombre| +Territory Modified|Territorio Modificado| +Territory must be filled in|Territorio debe ser llenado en| +Territory Deleted|Territorio eliminados| +Delete This Territory|Suprimir este territorio| +Vtiger Accounts|Cuentas Vtiger| +Agents|Agentes| +Territory, User and Level must be filled in|Territorio, y de nivel de usuario debe ser llenado en| +this territory user is already in the system|este usuario territorio ya está en el sistema de| +User Territory Added|Usuario Territorio Añadido| +this territory user is not in the system|este usuario territorio no está en el sistema| +User Territory Modified|Usuario Territorio Modificado| +Territory and User must be filled in|Territorio y el usuario deberá ser llenado en| +User Territory Deleted|Usuario Territorio eliminados| +Vtiger Change Territory Owner|Vtiger Cambio Territorio Propietario| +Had to add user territory|Tuvo que añadir el territorio de usuario| +Vtiger Territory Owner Changed|Vtiger Territorio Propietario cambiado| +Records Changed|Registros modificados| +ViciDial Recording Limit|Grabación Vicidial Límite| +This field is where you set the maximum number of minutes that a call recording initiated by ViciDial can be. Default is 60 minutes|Este campo es donde se define el número máximo de minutos que una grabación de la llamada iniciada por Vicidial puede ser. Por defecto es de 60 minutos| +This is the dial plan context that the agent applications, like ViciDial, primarily use. It is assumed that all numbers dialed by the client apps are using this context so it is a good idea to make sure this is the most wide context possible. verify with extensions.conf file before changing. default is default|Este es el contexto del plan de marcado que las solicitudes de agente, como Vicidial, principalmente el uso. Se supone que todos los números marcados por las aplicaciones cliente utilizan este contexto, por lo que es una buena idea para asegurarse de que este es el contexto más amplio posible. verificar con el archivo extensions.conf antes de cambiar. por defecto es por defecto| +Phone Context|Teléfono Contexto| +This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default|Este es el contexto del plan de marcado que este teléfono se utiliza para marcar. Si está ejecutando un centro de llamadas y usted no desea que sus agentes sean capaces de marcar fuera de la aplicación Vicidial por ejemplo, entonces puedes establecer este campo a un contexto dialplan que no existe, algo como agente nodial. por defecto es por defecto| +Use the HIDE option to completely remove the customer phone number from the agent display|Utilice la opción Ocultar para eliminar completamente el número de teléfono del cliente de la pantalla del agente de| +Click here to see a traffic report for this DID|Haga clic aquí para ver un informe de tráfico para este DID| +Agent Time Detail|Agente Tiempo Detalle| +User Timeclock Detail Report|Usuario Timeclock Detalle Informe| +Carrier Logging Active|Portador de registro activo| +This setting allows you to log all hangup return codes for any outbound list dialing calls that you are placing. Default is N.|Esta configuración le permite registrar todos los códigos de retorno para colgar cualquier lista de marcación saliente llamadas que están haciendo. Por defecto es N.| +Drop Lockout Time|Tiempo de caída de bloqueo| +This is a number of hours that DROP abandon calls will be prevented from being dialed, to disable set to 0. This setting is very useful in countries like the UK where there are regulations preventing the attempted calling of customers within 72 hours of an Abandon, or DROP. Default is 0|Este es un número de horas que DROP abandonar pide se le impida que se está marcando, para establecer inhabilitar a 0. Esta opción es muy útil en países como el Reino Unido, donde existen normas que impiden la tentativa de llamar a los clientes dentro de las 72 horas de abandono, o DROP. Por defecto es 0| +Phone Ring Timeout|Teléfono Anillo de tiempo de espera| +This is the amount of time, in seconds, that the phone will ring in the dialplan before sending the call to voicemail. Default is 60 seconds|Esta es la cantidad de tiempo, en segundos, que el teléfono sonará en el dialplan antes de enviar la llamada al buzón de voz. El valor predeterminado es 60 segundos| +Allow Custom Dialplan Entries|Permitir Custom Dialplan entradas| +This option allows you to enter custom dialplan lines into Call Menus. Default is 0 for inactive|Esta opción le permite introducir líneas personalizadas dialplan en llamadas menús. El valor predeterminado es 0 para los inactivos| +Custom Dilplan Entry|Custom Dilplan entrada| +This field allows you to enter in any dialplan elements that you want for the Call Menu|Este campo le permite entrar en los elementos dialplan que desea para el menú de llamada| +You can enter multiple propmts in this field and the other prompt fields by separating them with a pipe character|Puede introducir propmts múltiples en este campo y los demás ámbitos del sistema mediante la separación de ellos con un carácter de canalización| +Setting this field to zero 0 will mean that there will be no wait time after the prompt is played|Establecer este campo a cero 0 significa que no habrá tiempo de espera después de que el sistema se juega| +Conf File Secret|Conf. Archivo Secreto| +This is the secret, or password, for the phone in the iax or sip auto-generated conf file for this phone. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test|Este es el secreto o la contraseña, por el teléfono de la SIP IAX o auto-generados conf para este teléfono. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba| +Tracking Group|Grupo de seguimiento de| +This is the ID that you can use to track calls to this Call Menu when looking at the IVR Report. The list includes CALLMENU as the default as well as all of the In-Groups|Esta es la identificación que se puede utilizar para rastrear las llamadas a este menú de llamada cuando se mira al Informe de IVR. La lista incluye CALLMENU como predeterminado, así como todos los Grupos de In -| +Agent Alert Filename|Agente de Alerta Nombre de archivo| +The audio file to play to an agent to announce that a call is coming to the agent. To not use this function set this to X. Default is ding|El archivo de audio a jugar a un agente de anunciar que una llamada está llegando a su agente. Para no utilizar esta función establezca este valor por defecto es a X. Ding| +This field as with the other audio fields in In-Groups, with the exception of the Agent Alert Filename, can have multiple audio files played if you put a pipe-separated list of audio files into the field|Este campo como con los otros campos de audio en In-grupos, con la excepción del nombre de archivo de alerta de agente, puede tener múltiples archivos de audio reproducido si se pone un tubo de lista separada de los archivos de audio en el campo| +No Agents No Queueing|N de colas n Agentes| +If this field is set to Y or NO_PAUSED then no calls will be put into the queue for this in-group if there are no agents logged in and the calls will go to the No Agent No Queue Action. The NO_PAUSED option will also not send the callers into the queue if there are only paused agents in the in-group. Default is N|Si este campo está establecido en Y o NO_PAUSED entonces no se pide se pondrá en la cola de este grupo en si no hay agentes conectado y las llamadas se vaya a la agente n Ninguna acción de la cola. La opción NO_PAUSED no se envían también las personas que llaman a la cola si sólo hay una pausa en los agentes en el grupo. Por defecto es n| +No Agent No Queue Action|No No Acción cola de agente| +If No Agent No Queue is enabled, then this field defines where the call will go if there are no agents in the In-Group. Default is MESSAGE, this plays the sound files in the Action Value field and then hangs up|Si está activada ninguna cola Ningún Agente, entonces este campo se define en la llamada pasará si no hay agentes en la A-Group. Por defecto es el mensaje, este reproduce los archivos de sonido en el campo el valor de acción y luego cuelga el| +No Agent No Queue Action Value|No hay ninguna cola Acción Agente Valor| +This is the value for the Action above. Default is|Este es el valor de la acción anterior. El valor predeterminado es| +Quick Transfer Button|Rápida transferencia Button| +This option will add a Quick Transfer button to the agent screen below the Transfer-Conf button that will allow one click blind transferring of calls to the selected In-Group or number. IN_GROUP will send calls to the Default Xfer Group for this Campaign, or In-Group if there was an inbound call. The PRESET options will send the calls to the preset selected. Default is N for disabled|Esta opción agrega un botón de la transferencia rápida a la pantalla por debajo de la agente de transferencia de botón Conf. que permitirá la transferencia de un solo clic ciego de llamadas a los seleccionados en Grupo o un número. IN_GROUP enviará pide al Grupo de Xfer predeterminado para esta campaña, o en grupo-si hay una llamada entrante. Las opciones predeterminadas enviará las llamadas a los preset seleccionado. Por defecto es n para discapacitados| +PrePopulate Transfer Preset|Transferencia de rellenar previamente Preset| +This option will fill in the Number to Dial field in the Transfer Conference frame of the agent screen if defined. Default is N for disabled|Esta opción le proporcione el número telefónico al campo en el marco de la Conferencia de transferencia de la pantalla si el agente definido. Por defecto es n para discapacitados| +Enable TTS Integration|Habilitar TTS Integración| +This setting allows you to enable Text To Speech integration with Cepstral. This is currently only available for outbound Survey type campaigns. Default is 0 for disabled|Esta configuración le permite habilitar Texto a la integración de voz con Cepstral. Esto sólo está disponible actualmente para las campañas de tipo de encuesta de salida. Por defecto es 0 para discapacitados| +ADD NEW TTS ENTRY|ADD NEW TTS ENTRADA| +ADDING NEW TTS ENTRY|AGREGAR NUEVO TTS ENTRADA| +MODIFY TTS ENTRY|MODIFICAR TTS ENTRADA| +DELETE TTS ENTRY|DELETE TTS ENTRADA| +TTS ENTRY LIST|TTS LISTA INSCRITOS| +TEXT-TO-SPEECH(TTS) LISTINGS|Texto-a-voz (TTS) LISTINGS| +Text To Speech|Text To Speech| +Show TTS Entries|Mostrar las entradas TTS| +Add A New TTS Entry|Agregar una nueva entrada TTS| +TTS ID|TTS ID| +TTS Name|Nombre TTS| +TTS Text|TTS Texto| +TTS ENTRY NOT ADDED|TTS entrada no AGREGADOS| +there is already a tts entry in the system with this ID|ya hay una entrada de TTS en el sistema con este ID| +TTS ENTRY ADDED|TTS añadido la entrada de| +MODIFY A TTS RECORD|TTS MODIFICAR UN RECORD| +Click here to see Admin chages to this TTS entry|Haga clic aquí para ver chages Admin a esta entrada a TTS| +DELETE THIS TTS ENTRY|ELIMINAR ESTA ENTRADA TTS| +TTS ENTRY NOT MODIFIED|TTS ENTRADA SIN MODIFICAR| +TTS ENTRY MODIFIED|TTS entrada modificada| +TTS ENTRY NOT DELETED|TTS entrada no DELETED| +TTS ENTRY DELETION CONFIRMATION|TTS DE ENTRADA SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete tts entry|Haga clic aquí para eliminar TTS entrada| +This is the short name of a TTS entry. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters|Este es el nombre corto de una entrada de TTS. Esto debe ser un identificador único. No utilice espacios ni puntuacion para este campo. caracteres como máximo 50, mínimo de 2 caracteres| +This is a more descriptive name of the TTS entry. This is a short summary of the TTS definition. max 100 characters, minimum of 2 characters|Este es un nombre más descriptivo de la entrada TTS. Este es un breve resumen de la definición de TTS. 100 caracteres como máximo, mínimo de 2 caracteres de| +This option allows you to set the TTS entry to active or inactive|Esta opción le permite establecer la entrada de TTS a activos o inactivos| +This is the actual Text To Speech data field that is sent to Cepstral for creation of the audio file to be played to the customer. you can use Speech Synthesis Markup Language -SSML- in this field, for example|Este es el texto real de campo de datos de voz que se envía a Cepstral para la creación del archivo de audio que deben desempeñar para el cliente. Usted puede utilizar Speech Syntesis Markup Language-SSML-en este campo, por ejemplo,| +for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--. Here is a list of the available variables: |de 1 segundo descanso. También puede utilizar varias variables como el nombre, apellido y el título como variables Vicidial tal como lo harías en una secuencia de comandos: - A - first_name - B -. Aquí está una lista de las variables disponibles:| +Multiple Campaign Drop Rate Group|Varias campañas Drop Rate Grupo| +This feature allows you to set a campaign as a member of a Campaign Drop Rate Group, or a group of campaigns whose Human Answered calls and Drop calls for all campaigns in the group will be combined into a shared drop percentage, or abandon rate. This allows you to to run multiple campaigns at once and more easily control your drop rate. This is particularly useful in the UK where regulations permit this drop rate calculation method with campaign grouping for the same company even if there are several campaigns that company is running during the same day. To enable this for a campaign, just select a group from the list. There are 10 groups defined in the system by default, you can contact your system administrator to add more. Default is DISABLED|Esta característica le permite establecer una campaña como miembro de una campaña de la velocidad de descenso del Grupo, o un grupo de campañas cuyas llamadas contestadas y llamadas Humanos Drop para todas las campañas en el grupo se combinarán en un porcentaje de caída compartida, o tasa de abandono. Esto le permite ejecutar varias campañas a la vez y más fácil de controlar su tasa de caída. Esto es particularmente útil en el Reino Unido, donde las regulaciones lo permiten esta disminución método del tipo de cálculo con la campaña de la agrupación por la misma empresa, incluso si hay varias campañas que la empresa está ejecutando en el mismo día. Para habilitar esta para una campaña, sólo tienes que seleccionar un grupo de la lista. Hay 10 grupos definidos en el sistema por defecto, puede ponerse en contacto con el administrador del sistema para añadir más. Desactivado por defecto| +IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Conf File Secret field further down on this page|Importante, esta es la única contraseña para la red de interfaz de usuario del agente de teléfono, para cambiar el sip.conf iax.conf o contraseña, o en secreto, para este dispositivo de teléfono que tenga que modificar el campo Archivo Secreto Conf. más abajo en esta página| +Agent Status Viewable Groups|Estado del agente visible Grupos| +This is a selectable list of User Groups and user functions to which members of this user group can view the status of as well as transfer calls to inside of the agent screen. The ALL-GROUPS option allows the users in this group to see and transfer calls to any user on the system. The CAMPAIGN-AGENTS option allows users in this group to see and transfer calls to any user in the campaign that they are logged into|Esta es una lista seleccionable de grupos de usuarios y las funciones de usuario al que los miembros de este grupo de usuarios pueden ver el estado de las llamadas, así como la transferencia al interior de la pantalla del agente. La opción de grupo permite a los usuarios de este grupo para ver y transferir llamadas a cualquier usuario en el sistema. La campaña-AGENTES opción permite a los usuarios en este grupo para ver y transferir llamadas a cualquier usuario en la campaña que se registran en la| +Agent Status View Time|Ver estado del agente de turno| +This option defines whether the agent will see the amount of time that users in their agent sidebar have been in their current status. Default is N for no or disabled|Esta opción define si el agente va a ver la cantidad de tiempo que los usuarios en su barra lateral agente han sido en su estado actual. Por defecto es n sin o con discapacidad| +This option allows an agent to disposition a call as CALLBK and choose the date and time at which the lead will be re-activated|Esta opción permite que un agente a disposición de una llamada como CALLBK y elegir la fecha y hora en que el plomo se vuelva a activar| +Agent View Calls in Queue|Agente Pide Ver en cola| +If set to anything but NONE, agents will be able to see details about the calls that are waiting in queue in their agent screen. If set to a number value, the calls displayed will be limited to the number selected. Default is NONE|Si se pone a nada, pero NINGUNO, los agentes podrán consultar los detalles de las llamadas que están esperando en la cola en la pantalla de su agente. Si se establece en un valor de número, las llamadas que aparecerá será limitada al número seleccionado. El valor predeterminado es NINGUNO| +View Calls in Queue Launch|Ver las llamadas en cola de lanzamiento| +This setting if set to AUTO will have the Calls in Queue frame show up upon login by the agent into the agent screen. Default is MANUAL|Este ajuste, si en AUTO tendrá las convocatorias en el marco de la cola aparecen en inicio de sesión por el agente en la pantalla del agente. El valor predeterminado es MANUAL| +Agent Grab Calls in Queue|Agente Pide Agarre en cola| +This option if set to Y will allow the agent to select the call that they want to take from the Calls in Queue display by clicking on it while paused. Agents will only be able to grab inbound calls or transferred calls, not outbound calls. Default is N|Esta opción si se define Y permitirá que el agente para seleccionar la llamada que desea tomar de las llamadas en la pantalla de la cola haciendo clic en él durante la pausa. Los agentes sólo podrán coger las llamadas entrantes o las llamadas transferidas, las llamadas no de salida. Por defecto es n| +Agent Call Re-Queue Button|Agente de Call Re-Cola Button| +This option if set to Y will add a Re-Queue Customer button to the agent screen, allowing the agent to send the call into an AGENTDIRECT queue that is reserved for the agent only. Default is N|Esta opción si se define Y agregará un botón Re-cliente de la cola a la pantalla del agente, permite a las agencias para enviar la llamada en una cola de AGENTDIRECT que está reservado para el único agente. Por defecto es n| +Agent Pause After Each Call|Agente de pausa después de cada llamada| +This option if set to Y will pause the agent after every call automatically. Default is N|Esta opción si se define como Y hará una pausa en el agente después de cada llamada automáticamente. Por defecto es n| +Starts with the highest rank and works its way down|Comienza con la más alta categoría y se abre camino hacia abajo| +Starts with the lowest rank and works its way up|Comienza con el rango más bajo y se abre camino hasta| +Starts with owners beginning with Z and works its way down|Comienza con los propietarios de inicio con Z y obras de su camino hacia abajo| +Starts with owners beginning with A and works its way up|Comienza con los propietarios empiezan con la letra y se abre camino hasta| +No Hopper Dialing|N marcado Hopper| +If This is enabled, the hopper will not run for this campaign. This option is only available when the dial method is set to MANUAL or INBOUND_MAN. It is recommended that you do not enable this option if you have a very large lead database, over 100,000 leads. With No Hopper Dialing, the following features do not work: lead recycling, auto-alt-dialing, list mix, list ordering with Xth NEW. If you want to use Owner Only Dialing you must have No Hopper Dialing enabled. Default is N for disabled|Si esta opción está activada, la tolva no se ejecutará para esta campaña. Esta opción sólo está disponible cuando el método de línea se establece en Manual o INBOUND_MAN. Se recomienda que no habilite esta opción si usted tiene una base de datos de plomo muy grande, más de 100.000 clientes potenciales. Con n marcado Hopper, las características siguientes no funcionan: reciclaje de plomo, auto-alt-marcación, la mezcla lista, lista de pedido con X NEW. Si desea utilizar único dueño de marcado no debe tener marcado Hopper habilitado. Por defecto es n para discapacitados| +Owner Only Dialing|Único propietario de marcado| +If This is enabled, the agent will only receive leads that they are within the ownership parameters for. If this is set to USER then the agent must be the user defined in the database as the owner of this lead. If this is set to TERRITORY then the owner of the lead must match the territory listed in the User Modification screen for this agent. If this is set to USER_GROUP then the owner of the lead must match the user group that the agent is a member of. For this feature to work the dial method must be set to MANUAL or INBOUND_MAN and No Hopper Dialing must be enabled. Default is NONE for disabled|Si esta opción está activada, el agente sólo recibirá las pistas que están dentro de los parámetros de la propiedad. Si esto se establece a usuario entonces el agente debe ser definida por el usuario en la base de datos como el propietario de este lugar. Si esto se establece en territorio que entonces el dueño de la iniciativa debe coincidir con el territorio que figuran en la pantalla de modificación del usuario de este agente. Si esto se establece a USER_GROUP entonces el dueño de la iniciativa debe coincidir con el grupo de usuarios que el agente es un miembro de. Para que esta característica funcione el método de línea se debe establecer en Manual o INBOUND_MAN marcado Hopper y no debe estar activado. El valor predeterminado es NINGUNO para discapacitados| +Reset Times|Perdí Times| +This field allows you to put times in, separated by a dash-, that this list will be automatically reset by the system. The times must be in 24 hour format with no punctuation, for example 0800-1700 would reset the list at 8AM and 5PM every day. Default is empty|Este campo le permite poner veces, separados por un guión, que esta lista se restablece automáticamente por el sistema. Los tiempos deben estar en formato de 24 horas sin puntuacion, por ejemplo 0800-1700 se restablecer la lista de las 8 AM y las 5 PM todos los días. Por defecto está vacío| +Owner: |Propietario:| +OWNERS WITHIN THIS LIST|PROPIETARIOS dentro de esta lista| +RANKS WITHIN THIS LIST|RANKS dentro de esta lista| +Allow Alerts|Permitir Alertas| +This field gives you the ability to allow agent browser alerts to be enabled by the agent for when calls come into their vicidial.php session. Default is 0 for NO|Este campo le da la capacidad para permitir navegador agente de alertas para ser habilitado por el agente para cuando las llamadas entran en su período de sesiones vicidial.php. Por defecto es 0 para el NO| +Agent Display Dialable Leads|Agente de pantalla Dialable Leads| +This option if enabled will show the number of dialable leads available in the campaign in the agent screen. This number is updated in the system once a minute and will be refreshed on the agent screen every few seconds|Esta opción se mostrará si está habilitado el número de derivaciones dialable disponibles en la campaña en la pantalla del agente. Este segundo número se actualiza en el sistema una vez por minuto y se actualiza en la pantalla del agente por cada par de| +VICIDIAL Balance Rank|Balance Vicidial Rank| +This field allows you to set the order in which this server is to be used for balance dialing, if balance dialing is enabled. The server with the highest rank will be used first in placing Balance fill calls. Default is 0|Este campo le permite establecer el orden en que este servidor se va a utilizar para la marcación de equilibrio, si está activada la marcación de equilibrio. El servidor con el rango más alto será usado primero en la colocación de Balance llenar las llamadas. Por defecto es 0| +Inbound Summary Hourly Report|Resumen horario de entrada Informe| +orders by the amount of time agent has been actively waiting for a call|pedidos por la cantidad de tiempo que el agente ha estado activamente la espera de una llamada de| +Agent Script Override|Agente de secuencias de comandos Reemplazar| +If this field is set, this will be the script that the agent sees on their screen instead of the campaign script when the lead is from this list. Default is not set|Si se establece este campo, esta será la secuencia de comandos que el agente ve en su pantalla en lugar de la secuencia de comandos de campaña cuando la ventaja es de esta lista. Por defecto no se establece| +Music On Hold|Música en espera| +ADD NEW MUSIC ON HOLD ENTRY|ADD NEW MUSIC EN ESPERA DE ENTRADA| +ADDING NEW MUSIC ON HOLD ENTRY|ADDING NEW MUSIC EN ESPERA DE ENTRADA| +MODIFY MUSIC ON HOLD ENTRY|MODIFICAR MÚSICA EN ESPERA DE ENTRADA| +DELETE MUSIC ON HOLD ENTRY|DELETE MÚSICA EN ESPERA DE ENTRADA| +MUSIC ON HOLD ENTRY LIST|MÚSICA EN ESPERA LISTA DE ENTRADA| +We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files|Le recomendamos ENCARECIDAMENTE cargar sólo 16 bits 8k archivos de audio WAV PCM| +Music On Hold ID|Música en espera de identificación| +This is the short name of a Music On Hold entry. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 100 characters, minimum of 2 characters|Este es el nombre corto de una música en espera de entrada. Esto debe ser un identificador único. No utilice espacios ni puntuacion para este campo. 100 caracteres como máximo, mínimo de 2 caracteres de| +Music On Hold Name|Música en espera Nombre| +This is a more descriptive name of the Music On Hold entry. This is a short summary of the Music On Hold context and will show as a comment in the musiconhold-vicidial.conf file. max 255 characters, minimum of 2 characters|Este es un nombre más descriptivo de la música en espera de entrada. Este es un breve resumen de la música en espera contexto y se verá como un comentario en el musiconhold archivo vicidial.conf. máximo de 255 caracteres, mínimo de 2 caracteres| +This option allows you to set the Music On Hold entry to active or inactive. Inactive will remove the entry from the conf files|Esta opción le permite definir la música en espera la entrada en activo o inactivo. Inactivo eliminará la entrada de los archivos de conf| +Random Order|Orden aleatorio| +This option allows you to define the playback of the audio files in a random order. If set to N then the defined order will be used|Esta opción le permite definir la reproducción de los archivos de audio en un orden aleatorio. Si se establece a N, entonces el orden definido se utilizará| +To add a new audio file to a Music On Hold entry the file must first be in the audio store, then you can select the file and click submit to add it to the file list. Music on hold is updated once per minute if there have been changes made. Any files not listed in a music on hold entry that are present in the music on hold folder will be deleted|Para añadir un nuevo archivo de audio a una música en espera de entrada el primer archivo debe estar en la tienda de audio, puede seleccionar el archivo y haga clic en Enviar para añadirlo a la lista de archivos. Música en espera se actualiza una vez por minuto si se han producido cambios realizados. Cualquier archivo que no figuran en la música en la entrada de reserva que están presentes en la música en la carpeta celebrar serán eliminados| +MUSIC ON HOLD ENTRY NOT ADDED|MÚSICA EN ESPERA entrada no AGREGADOS| +there is already a moh entry in the system with this ID|ya hay una entrada en el Ministerio de Salud en el sistema con este ID| +MUSIC ON HOLD ENTRY ADDED|MÚSICA EN ESPERA añadido la entrada de| +Click here to see Admin chages to this Music On Hold entry|Haga clic aquí para ver chages de administración para esta música en espera de entrada| +Audio Files|Archivos de Audio| +Add An Audio File|Añadir un archivo de audio| +Rank: |Rango:| +MUSIC ON HOLD ENTRY NOT MODIFIED|MÚSICA EN ESPERA DE ENTRADA SIN MODIFICAR| +MUSIC ON HOLD ENTRY MODIFIED|MÚSICA EN ESPERA entrada modificada| +Add A New MOH Entry|Agregar una nueva entrada del Ministerio de Salud| +Show MOH Entries|Mostrar las entradas del Ministerio de Salud| +Active Agent Server|Active Server Agent| +Setting this option to N will prevent agents from being able to login to this server through the vicidial agent screen. This is very useful when using a phone login load balanced setup. Default is Y|Al establecer esta opción a N de impedir que los agentes de poder acceder a este servidor a través de la pantalla del agente Vicidial. Esto es muy útil cuando se utiliza una carga de inicio de sesión de instalación del teléfono equilibrada. Por defecto es Y| +Rebuild Music On Hold|Volver a generar música en espera| +If you want to force a rebuilding of the music on hold files or if the music on hold entries or server entries have changed then this should be set to Y. After the music on hold files have been synchronized and reloaded then this will be changed to N. Default is Y|Si desea forzar una reconstrucción de la música en los archivos de la bodega o si la música en las entradas de espera ni entradas de servidor han cambiado entonces esto debe establecerse en Y. Después de la música en espera los archivos se han sincronizado y volver a cargar entonces esto va a ser cambiado a N. defecto es Y| +MUSIC ON HOLD ENTRY NOT DELETED|MÚSICA EN ESPERA DE ENTRADA no se eliminan| +MUSIC ON HOLD ENTRY DELETION CONFIRMATION|MÚSICA EN ESPERA DE ENTRADA SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete music on hold entry|Haga clic aquí para borrar música en espera de entrada| +MUSIC ON HOLD DELETION COMPLETED|MÚSICA EN ESPERA SUPRESIÓN COMPLETA| +Starts with Eastern timezones and works West|Comienza con las zonas horarias del Este y del Oeste de obras| +Starts with Western timezones and works East|Comienza con las zonas horarias occidental y oriental de obras| +you must select a user group|usted debe seleccionar un grupo de usuarios| +Enable Second Webform|Formulario de Asistencia Segunda Habilitar| +WaitForSilence Options|Opciones WaitForSilence| +If Wait For Silence is desired on calls that are detected as Answering Machines then this field has those options. There are two settings separated by a comma, the first option is how long to detect silence in milliseconds and the second option is for how many times to detect that before playing the message. Default is EMPTY for disabled. A standard value for this would be wait for 2 seconds of silence twice|Si Wait For silencio es deseada en las llamadas que se detectan como Contestadoras entonces este campo tiene esas opciones. Hay dos opciones separadas por una coma, la primera opción es el tiempo para detectar silencio en milisegundos y la segunda opción es para cuántas veces se detecta que antes de reproducir el mensaje. Por defecto está vacío para discapacitados. Un valor estándar para este sería esperar 2 segundos de silencio en dos ocasiones| +This field is for entering the prompt to play when the agent gets an answering machine and clicks on the Answering Machine Message button in the transfer conference frame. You must set this to either an audio file in the audio store or a TTS prompt if TTS is enabled on your system|Este campo es para entrar en el sistema para jugar cuando el agente recibe un contestador automático y hace clic en el botón Responder a máquina contestadora en el marco de conferencias de transferencia. Debe establecer que esto sea un archivo de audio en la tienda de audio o un sistema TTS TTS si está habilitada en su sistema de| +EXTENDED ALTERNATE PHONE NUMBERS FOR THIS LEAD|EXTENDED SUPLENTE NÚMEROS DE TELÉFONO PARA ESTE DE PLOMO| +ADD NEW VOICEMAIL BOX|ADD NEW contestador| +ADDING NEW VOICEMAIL BOX|AGREGAR NUEVO contestador| +MODIFY VOICEMAIL BOX|MODIFICAR contestador| +MODIFY A VOICEMAIL BOX|MODIFICAR UN contestador| +DELETE VOICEMAIL BOX|DELETE contestador| +VOICEMAIL BOXES LIST|LISTA DE CORREO DE VOZ CAJAS| +VOICEMAIL BOXES|CAJAS DE CORREO DE VOZ| +ADD NEW VOICEMAIL BOX|ADD NEW contestador| +Voicemail ID|ID de correo de voz| +This is the all numbers identifier of this mailbox. This must not be a duplicate of an existing voicemail ID or the voicemail ID of a phone on the system, minimum of 2 characters|Este es el identificador de todos los números de este buzón. Esto no debe ser un duplicado de un mensaje de voz existentes de identificación o la identificación del correo de voz de un teléfono en el sistema, mínimo de 2 caracteres| +This is name associated with this voicemail box. max 100 characters, minimum of 2 characters|Este es el nombre asociado a este buzón de voz. 100 caracteres como máximo, mínimo de 2 caracteres de| +This is the password that is used to gain access to the voicemail box when dialing in to check messages max 10 characters, minimum of 2 characters|Esta es la contraseña que se utiliza para acceder al buzón de voz cuando se marca para revisar los mensajes máximo 10 caracteres, mínimo de 2 caracteres| +This option allows you to set the voicemail box to active or inactive. If the box is inactive you cannot leave messages on it and you cannot check messages in it|Esta opción le permite configurar la casilla de correo de voz activo o inactivo. Si el cuadro está inactivo no se puede dejar mensajes en él y no se puede revisar los mensajes en él| +This optional setting allows you to have the voicemail messages sent to an email account, if your system is set up to send out email. If this field is empty then no emails will be sent out|Este ajuste opcional le permite tener los mensajes de correo de voz enviado a una cuenta de correo electrónico, si su sistema está configurado para enviar correo electrónico. Si este campo está vacío, entonces no los correos electrónicos se envían| +VOICEMAIL BOX NOT ADDED|Contestador NO AGREGADOS| +there is already a voicemail box in the system with this ID|ya existe un buzón de voz en el sistema con este ID| +there is already a phone in the system with this voicemail ID|ya hay un teléfono en el sistema de correo de voz con este ID| +VOICEMAIL BOX ADDED|Contestador AGREGADOS| +VOICEMAIL BOX NOT MODIFIED|Contestador SIN MODIFICAR| +VOICEMAIL BOX MODIFIED|Contestador MODIFICADOS| +VOICEMAIL BOX NOT DELETED|Contestador no se eliminan| +VOICEMAIL BOX DELETION COMPLETED|Contestador SUPRESIÓN COMPLETA| +VOICEMAIL BOX DELETION CONFIRMATION|Contestador SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete voicemail box|Haga clic aquí para eliminar buzón de voz| +DELETE THIS VOICEMAIL BOX|Este mensaje de voz DELETE BOX| +Click here to see Admin chages to this voicemail box|Haga clic aquí para ver chages de administración para esta casilla de correo de voz| +The following fields must have data|Los siguientes campos deben disponer de datos| +Campaign CID Override|Campaña CID Override| +If this field is set, this will override the campaign CallerID that is set for calls that are placed to leads in this list. Default is not set|Si se establece este campo, que reemplazarán la campaña CallerID que se establece para las llamadas que se colocan a la cabeza en esta lista. Por defecto no se establece| +Answering Machine Message Override|Contestador automático de mensajes Override| +If this field is set, this will override the Answering Machine Message set in the campaign for customers in this list. Default is not set|Si se establece este campo, esto anulará el mensaje de contestador automático situado en la campaña para los clientes en esta lista. Por defecto no se establece| +Drop Inbound Group Override|Drop de entrada Grupo de Override| +If this field is set, this in-group will be used for outbound calls within this list that drop from the outbound campaign instead of the drop in-group set in the campaign detail screen. Default is not set|Si se establece este campo, en este grupo se utilizará para las llamadas salientes dentro de esta lista que la caída de la campaña de salida en lugar de la caída en grupo situado en la pantalla de detalle de la campaña. Por defecto no se establece| +Agent Select Territories|Agente Seleccione territorios| +If this option is enabled and the agent belongs to at least one territory, the agent will have the option of selecting territories to dial leads from. The agent will see a list of available territories upon login and they will have the ability to go back to that territory list when paused to change their territories. For this function to work the Owner Only Dialing option must be set to TERRITORY and User Terriories must be enabled in the System Settings.|Si esta opción está activada y el agente pertenece a al menos un territorio, el agente tendrá la opción de selección de territorios a los cables de línea. El agente podrá ver una lista de los territorios disponibles a inicio de sesión y tendrán la capacidad de volver a la lista territorio cuando se detuvo a cambiar sus territorios. Para esta función a la labor del único dueño de marcado opción debe configurarse con el territorio y territorios de usuario debe estar habilitado en la configuración del sistema.| +Agent Choose Territories|Agente Elija territorios| +This option if set to 1 allows the user to choose the territories that they will receive calls from when they login to a MANUAL or INBOUND_MAN campaign. Otherwise the user will be set to use all of the territories that they are set to belong to in the User Territories administrative section|Esta opción si se establece en 1 permite al usuario elegir los territorios que van a recibir llamadas de los usuarios cuando ingresan a un manual o campaña INBOUND_MAN. De lo contrario el usuario será configurado para utilizar todos los territorios que se establecen a pertenecer a los territorios de usuario administrativos sección| +The AREACODE option is just like the Y option, except it is used to also filter out an entire area code in North America from being dialed, in this case using the 201XXXXXXX entry in the DNC list would block all calls to the 201 areacode if enabled|La opción codigoDeArea es como la opción-y, excepto que se utiliza para filtrar también un código de área en toda América del Norte desde que se está marcando, en este caso mediante la entrada en la lista 201XXXXXXX DNC podría bloquear todas las llamadas a los 201 codigoDeArea si está habilitada| +If you have the active DNC option set to AREACODE then you can also use area code wildcard entries like this 201XXXXXXX to block all calls to the 201 areacode when enabled|Si usted tiene la opción de DNC activas de codigoDeArea a continuación, usted también puede usar el código de entradas de la zona este 201XXXXXXX como comodín para bloquear todas las llamadas a los 201 codigoDeArea cuando está activado| +Carrier Description|Descripción Carrier| +This is put in the comments of the asterisk conf files above the dialplan and account entries. Maximum 255 characters|Éste se coloca en los comentarios de los archivos de conf asterisco encima del dialplan y anotaciones en cuenta. Máximo 255 caracteres| +CAMPAIGNS ALLOWING THIS IN-GROUP|CAMPAÑAS QUE PERMITA EN ESTE GRUPO| +This is the secret, or password, for the server in the iax auto-generated conf file for this server on other servers. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test|Este es el secreto, o la contraseña, para que el servidor en el auto iax generado conf para este servidor en otros servidores. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba| +Delete Voicemail After Email|Eliminar correo de voz después del email| +This optional setting allows you to have the voicemail messages deleted from the system after they have been emailed out. Default is N|Este ajuste opcional le permite tener los mensajes de correo de voz se elimina del sistema después de haber sido enviado por correo electrónico a cabo. Por defecto es n| +Last Campaign Call Date|Última fecha de convocatoria de la Campaña| +This is the last time that a call was handled by an agent logged into this campaign|Esta es la última vez que una llamada fue manejado por un agente registrado en esta campaña| +Custom User Fields|Los campos de usuario personalizada| +These five fields can be used for various purposes, and they can be populated in the web form addresses and scripts as user_custom_one and so on|Estos cinco campos se puede utilizar para diversos fines, y que se puede rellenar en el formulario web y direcciones de secuencias de comandos como user_custom_one y así sucesivamente| +CRM Popup Login|CRM Popup Login| +If set to Y, the CRM Popup Address is used to open a new window on agent login to this campaign. Default is N|Si se establece en Y, la Dirección de Popup CRM se utiliza para abrir una nueva ventana de inicio de sesión agente a esta campaña. Por defecto es n| +CRM Popup Address|CRM Dirección Popup| +The web address of a CRM login page, it can have variables populated just like the web form address, with the VAR in the front and using --A--user_custom_one--B-- to define variables|La dirección en Internet de una página de acceso de CRM, puede tener las variables de población como la dirección de formulario web, con el VAR en el frente y con la opción - A - user_custom_one - B - para definir variables| +If IN_GROUP is selected as the DID Route, then this is the call handling method used for these calls. CID will add a new lead record with every call using the CallerID as the phone number, CIDLOOKUP will attempt to lookup the phone number by the CallerID in the entire system, CIDLOOKUPRL will attempt to lookup the phone number by the CallerID in only one specified list, CIDLOOKUPRC will attempt to lookup the phone number by the CallerID in all of the lists that belong to the specified campaign, CLOSER is specified for VICIDIAL Closer calls, ANI will add a new lead record with every call using the ANI as the phone number, ANILOOKUP will attempt to lookup the phone number by the ANI in the entire system, ANILOOKUPRL will attempt to lookup the phone number by the ANI in only one specified list, XDIGITID will prompt the caller for an X digit code before the call will be put into the queue, VIDPROMPT will prompt the caller for their ID number and will create a new lead record with the CallerID as the phone number and the ID as the Vendor ID, VIDPROMPTLOOKUP will attempt to lookup the ID in the entire system, VIDPROMPTLOOKUPRL will attempt to lookup the vendor ID by the ID in only one specified list, VIDPROMPTLOOKUPRC will attempt to lookup the vendor ID by the ID in all of the lists that belong to the specified campaign. Default is CID|IN_GROUP Si se selecciona como la Ruta de DID, entonces este es el llamado método de control utilizado para estas llamadas. Cid agregar un registro de conducir nuevo con cada llamada mediante la CallerID como el número de teléfono, CIDLOOKUP intentará buscar el número de teléfono por el CallerID en todo el sistema, CIDLOOKUPRL intentará buscar el número de teléfono por el CallerID en una sola lista especificada , CIDLOOKUPRC intentará buscar el número de teléfono por el CallerID en todas las listas que pertenecen a la campaña especificada, más cerca se especifica para Vicidial Closer llamadas, ANI añadirá un nuevo registro de conducir con cada llamada mediante la ANI como el número de teléfono, ANILOOKUP intentará buscar el número de teléfono de la ANI en todo el sistema, ANILOOKUPRL intentará buscar el número de teléfono de la ANI en una sola lista especificada, XDIGITID pedirá la llamada de un código de dos dígitos X antes de la llamada se pondrá en la cola, VIDPROMPT pedirá la persona que llama por su número de identificación y creará un registro de conducir nuevo con el CallerID como el número de teléfono y el ID como el identificador de proveedor, VIDPROMPTLOOKUP intentará buscar el ID en todo el sistema, VIDPROMPTLOOKUPRL intentará búsqueda del proveedor de identificación de la identificación en una sola lista se especifica, VIDPROMPTLOOKUPRC tratará de buscar el proveedor de identificación de la identificación en todas las listas que pertenecen a la campaña especificado. El valor predeterminado es CID| +UNIFIED_CONTACT- This option will use the beta Vtiger 5.1.0 feature to search by phone number and bring up a search page in Vtiger|UNIFIED_CONTACT-Esta opción se utiliza la versión beta 5.1.0 Vtiger función para buscar por número de teléfono y acceder a la página de búsqueda en Vtiger| +Timer Action|Temporizador de Acción de| +This feature allows you to trigger actions after a certain amount of time. the D1 and D2 DIAL options will launch a call to the Transfer Conference Number presets and send them to the agent session, this is usually used for simple IVR validation AGI applications or just to play a pre-recorded message. WEBFORM will open the web form address. MESSAGE_ONLY will simply display the message that is in the field below. NONE will disable this feature and is the default|Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado| +Timer Action Message|Temporizador de mensaje de acción| +This is the message that appears on the agent screen at the time the Timer Action is triggered|Este es el mensaje que aparece en la pantalla del agente en el momento de la acción del temporizador se dispara| +Timer Action Seconds|Temporizador Segundos Acción| +This is the amount of time after the call is connected to the customer that the Timer Action is triggered. Default is -1 which is also inactive|Esta es la cantidad de tiempo después de la llamada se conecta a los clientes que se desencadena la acción del temporizador. El valor predeterminado es -1, que también está inactivo| +This setting will override the Campaign settings|Esta configuración anula la configuración de la campaña| +Start Call URL|Iniciar llamada URL| +This web URL address is not seen by the agent, but it is called every time a call is sent to an agent if it is populated. Uses the same variables as the web form fields and scripts. This URL can NOT be a relative path. The Start URL does not work for Manual dial calls. Default is blank|Esta web dirección URL no es visto por el agente, sino que es llamado cada vez que una llamada se envía a un agente si se poblaron. Utiliza las mismas variables que los campos de formulario web y scripts. Esta URL no puede ser una ruta relativa. La URL de inicio no funciona para las llamadas de marcación manual. Por defecto está en blanco| +Dispo Call URL|Dispo Call URL| +This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. This URL can NOT be a relative path. Default is blank|Esta web dirección URL no es visto por el agente, sino que es llamado cada vez que una llamada es dispositioned por un agente, si se poblaron. Utiliza las mismas variables que los campos de formulario web y scripts. dispo y talk_time son las variables que puede utilizar para recuperar el agente definido por la disposición de la llamada y el tiempo de conversación real en segundos de la llamada. Esta URL no puede ser una ruta relativa. Por defecto está en blanco| +Xfer-Conf Number Override|Xfer-Conf Número Override| +These five fields allow for you to override the Transfer Conference number presets when the lead is from this list. Default is blank|Estos cinco campos permiten reemplazar la transferencia de presets Conferencia número cuando la iniciativa es de esta lista. Por defecto está en blanco| +These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-ViciDial consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field|Estos cuatro campos permiten que usted tenga dos conjuntos de transferencia de la Conferencia y presets DTMF. Cuando se carga la llamada o de la campaña, la secuencia de comandos vicidial.php mostrará dos botones en el marco de la transferencia de conferencias y rellenará de forma automática el número a marcar y el enviar los campos DTMF cuando se presiona. Si desea permitir Consultivo transferencias, un Fronter a una mayor, que el agente utiliza la casilla de consulta, que no funciona por falta de terceros Vicidial llamadas de consulta. Para aquellos que sólo tienen el agente, haga clic en el dial con el botón del cliente. Entonces, el agente puede dejar-3way-CALL y pasar a la siguiente llamada. Si desea permitir la transferencia ciega de los clientes a una secuencia de comandos AGI Vicidial para el registro o un IVR, a continuación, AXFER lugar en el número a marcar el terreno. También puede especificar una extensión personalizada después de la AXFER, por ejemplo, si usted quiere hacer una llamada a un IVR especiales que se han fijado a la extensión 83900 pondrías AXFER83900 en el número a marcar el terreno| diff --git a/agc_2-X/trunk/www/vicidial/welcome_demo.php b/agc_2-X/trunk/www/vicidial/welcome_demo.php index 238cf5cf..3175fa64 100644 --- a/agc_2-X/trunk/www/vicidial/welcome_demo.php +++ b/agc_2-X/trunk/www/vicidial/welcome_demo.php @@ -2,7 +2,7 @@ # welcome_demo.php - VICIDIAL welcome Demo page # # -# Copyright (C) 2009 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -78,6 +78,9 @@ echo "  
"; echo "   French Administration"; +echo "
"; +echo "   Brazilian Portuguese Administration"; echo "
\n"; echo "
 
\n"; diff --git a/agc_2-X/trunk/www/vicidial/welcome_languages.php b/agc_2-X/trunk/www/vicidial/welcome_languages.php index d53707a9..75b9382e 100644 --- a/agc_2-X/trunk/www/vicidial/welcome_languages.php +++ b/agc_2-X/trunk/www/vicidial/welcome_languages.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -78,6 +78,9 @@ echo "  
"; echo "   French Administration"; +echo "
"; +echo "   Brazilian Portuguese Administration"; echo "
\n"; echo "
 
\n";